use "java:comp/env/jdbc/OracleDS" with a <res-ref> in your deployment descriptor, then map the server-specific name to that name.

-danch

Jon Haugsand wrote:
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?


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to