This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes multiple data base connections best practices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "multiple data base connections best practices" Watch "multiple data base connections best practices" New topic
Author

multiple data base connections best practices

faisal ishaque
Greenhorn

Joined: Feb 21, 2003
Posts: 14
Hello
I have a problem that in my application there are two data bases Oracle and SQL Server and i want to dynamically check that which data base is available and then connect to available data base.
best regards
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1821

How do you mean, check to see if they're available? Do these databases get turned off occassionally?
You could attempt to connect to one, and if that connection fails, attempt to connect to the other. More likely, however, is that you want to store the connection information in some .properties file and have the user select which connection they want to use, yes?


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
faisal ishaque
Greenhorn

Joined: Feb 21, 2003
Posts: 14
I am little confused with your answer , actually our client use two DBMS (Oracle and SQL Server) due to their differenc interfaces, thats why whole data can be stored on both servers.
In this case if one DBMS does down then, then the customer must connect to anpther dbms dynamically.
Is this possible in minimum efforts or it requires more to do?
best regards
Faisal Ishaque
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

What Joel is saying is that you should identify which is the primary ( first choice for connecting to ) and which is the secondary ( second choice ) database to connect to.

Jamie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple data base connections best practices