Can i create weblogic datasource with user/password field empty?, and make connection with the database dyanamically using getConnection() method.
If yes, what all changes have to be made in Datasource setup as well as the java code?
At the time of DataSource (and Connection Pool) creation, one is required to enter the database userid/password in WebLogic console. This requires you to enter a generic database user/password with fixed assigned database role.
What are you trying to achieve ? Are you trying to use the application user for setting up the database connection ? If yes then there are several options available. You can use Client Identifier to pass the client identity. If the database is Oracle then you can use the Oracle Proxy Authentication mechanism.
The app servers allow you to get to the native connection object but generally they donot accept the connection back into the pool after application code is done with it.
Joined: Aug 03, 2011
Im working on an application which is used to change the Teradata passwords. If a person want to change the password in the Teradata DB, He should provide the Old password as well as new password to the application. With the help of the userID and the old password, it will connect to the Teradata DB and updates the password. So actually, I dont want to use the userID/ password in the Datasource setup to connect to teradata.
In short, the connection is to be made only with the help of the username/password provided during running the application, not with the datasource username/password.
Joined: Feb 13, 2004
From the description it looks like you don't need the data source at all. You can keep all the data source connection options (url, ip etc) in a properties file.
Just create a data source or connection object directly and use it for password mgmt.
Joined: Aug 03, 2011
Thanks deepak for the idea
I am a newbie to the weblogic server. When I searched in google about the properties file, I got a lot of results. Now I am confused about which code I've to use. Can you please help me ??