This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Weblogic datasource problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Weblogic datasource problem" Watch "Weblogic datasource problem" New topic
Author

Weblogic datasource problem

Skip Jack
Greenhorn

Joined: Aug 03, 2011
Posts: 4
Hi,

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?

Please help me in this issue.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
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.
Skip Jack
Greenhorn

Joined: Aug 03, 2011
Posts: 4
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.

Any idea???
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
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.
Skip Jack
Greenhorn

Joined: Aug 03, 2011
Posts: 4
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 ??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weblogic datasource problem
 
Similar Threads
classpath
How to deploy/undeploy EJBs application through HOT Deployment on websphere 6.1?
WA #1.....word association
Happy New Year! Welcome to our new forums!
How to convert xml to pdf form in java