File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple data base connections best practices

 
faisal ishaque
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
faisal ishaque
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic