wood burning stoves 2.0*
The moose likes JDBC and the fly likes Connecting to two different dbs in the same application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connecting to two different dbs in the same application" Watch "Connecting to two different dbs in the same application" New topic
Author

Connecting to two different dbs in the same application

Kjetil Nilsen
Greenhorn

Joined: Jan 26, 2005
Posts: 5
Hello.

I have a problem concerning connections to a database. I have an application that connects to a postgresql db, retrieves inforamtion which is processed an than used in a query to an oracle db, but when I try to connect to this db I get an SQLException saying that my oracle table isn't in my postgresql base. I have two different databaseaccess classes to handle the different connections, but still I get the same error.

So my question is; is it possible to connect to two different dbs in the same application and if so how?

I hope this wasn't to unclear.
Thanks!!

Kjetil


---------------------------------<br />Kjetil
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


So my question is; is it possible to connect to two different dbs in the same application and if so how?

Yes. Just uses two connections - one for each DB.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Kjetil Nilsen
Greenhorn

Joined: Jan 26, 2005
Posts: 5
Thanks for your answer Paul.

I had allerady found a solution. I made a new object which held a static variable to a connection manager. I had forgotten that.

But anyway thanks!

Kjetil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to two different dbs in the same application
 
Similar Threads
Apache Derby or MySQL
EJB Application with two data sources
Connection between two databases
Hibernate Configuration help!
invalid column type exception on Oracle db