Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting to two different dbs in the same application

 
Kjetil Nilsen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Kjetil Nilsen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic