This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Several JDBC connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Several JDBC connections" Watch "Several JDBC connections" New topic

Several JDBC connections

Colm Keogh

Joined: Jan 18, 2002
Posts: 4
I want to connect to several databases one after the other using JDBC (about 20 in total). What's the best approach/technique to use, I have no problem connecting to a single database.
The only difference in each URL is the IP address.
Graeme Brown
Ranch Hand

Joined: Oct 13, 2000
Posts: 193
What is the problem? Are you wanting to do the same thing on each database, or different things?
There is nothing stopping you connecting to a database, doing some stuff, disconnecting then going on to the next one. You can put this in a loop if you want to do the same stuff to each database. You can connect to multiple databases at the same time if you want.
I agree. Here's the link:
subject: Several JDBC connections
It's not a secret anymore!