users@glassfish.java.net

Re: RE: JNDI lookup, dependency injection, datasource

From: <glassfish_at_javadesktop.org>
Date: Tue, 15 Jun 2010 11:02:20 PDT

It is not advisable for applications to use the actual datasource as it is managed by the application server to provide transactional, pooling characteristics.
You can use datasource.getConnection("username","passwod"), but changing databaseName dynamically is not allowed.
Yes, this resource will be available only within the scope of the application.

You can try using "java:global/" prefix such that the resource is exported to all applications in the server.
[Message sent by forum member 'jr158900']

http://forums.java.net/jive/thread.jspa?messageID=474366