Skip to main content

Using a JDBC Pool with different credentials

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
petenelson
Offline
Joined: 2006-08-24

In both Tomcat and WebLogic, I can configure connection pools that require the DataSource.getConnection(String user, String pass). How do I do this in GlassFish 4?

Basically, I need to have JDBC connection pools that allow different credentials. The only other option would be to create so many single-user connection pools that it would be unmaintainable under GlassFish.

Thanks for any help or suggestions!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
petenelson
Offline
Joined: 2006-08-24

It took a bit, but I found a solution to my question.

Basically, when invoking the Resource, you just need to set:

authenticationType=Resource.AuthenticationType.APPLICATION

And then my application MUST use getConnection(Username, Password) to succeed.