We have an application that we are trying out on several application
servers, i.e. Borland, Weblogic and of course JBoss.  This
application uses CMP, but we also need to do some JDBC calls directly,
and consequently we need to get the name of the datasource from the
application server.

We do it like this in JBoss:

            Context ctx = new InitialContext();
            DataSource pool = (DataSource)ctx.lookup("java:OracleDS");
            return pool.getConnection();

However using "java:" does not work in Borland and Weblogic, it works
well with:

            Context ctx = new InitialContext();
            DataSource pool = (DataSource)ctx.lookup("OracleDS");
            return pool.getConnection();

So, is there a way that works in all cases?

-- 
  Jon Haugsand, <[EMAIL PROTECTED]>
  Norges Bank, <http://www.norges-bank.no>



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to