wood burning stoves*
The moose likes JDBC and the fly likes DriverManager.getConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DriverManager.getConnection" Watch "DriverManager.getConnection" New topic
Author

DriverManager.getConnection

Vidya pr
Greenhorn

Joined: Sep 10, 2001
Posts: 1
Hi,
Could anybody help me out with this
con = DriverManager.getConnection(url,User,Pass);
ie.. instead of giving username and Password i wish to globalise the variables so that i can connect to various databases just by changing a single variable but its not working.
I wud b thankful if anybody cud help me with this .
regards
Vidya
Shiv Sidhaarth
Ranch Hand

Joined: Aug 06, 2001
Posts: 119
Hi,
I am not getting ur question clearly. You can keep your URL, username and encrypted password in a text file. Then, read them thru ur appln and use them to connect to different database (Provided driver is same for diff. databases). If u have diff. driver, then include driver class name also in the text file. Hence, whenever u want to change datbase, u just need to change the text file. Is this, u wanted?
-Sankar
 
wood burning stoves
 
subject: DriverManager.getConnection
 
Similar Threads
render combo box
how To connect the mysql database from java with my webserver
concurrent problem
Abstract HttpServlet??
Ajax Error