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

Look up data from different databases

 
Suneel Setlur
Ranch Hand
Posts: 202
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a situation where I need to look up data from different databases.This is the case :
I have data on Oracle and also data on Informix. I have entire access to the data on Oracle but not on the other. The only thing I can do is read data. How do I frame my query to retrieve data. Can some help me. Please give it to me as a sequence of steps
Thanks
Suneel
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see what the problem is... simply create two separate Connection objects, one for each database.
 
Suneel Setlur
Ranch Hand
Posts: 202
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thomas
Thanks for the answer. But I think I must also add that I don't have a common field to link the 2 databases. What I wanted to know was that do I need to create a relation table and then frame a query. If I do need to, how do I go about it?
Thanks
Suneel

 
Ashish Saraf
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem here is how to fire a query on two connections simultaniously?
Any suggestions?
Regards,
Ashish Saraf
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashish:
as of the latest release of jdbc(not including the jdk 1.4 beta) you can only have one connection per statement/prepared statement. So you can not do this in java as you would need two different connections if you were to join 2 tables from different databases in one statement.
You can have 2 different connections open at the same time, but you can only have 1 connection for a statement.
Jamie

[This message has been edited by Jamie Robertson (edited September 24, 2001).]
 
Anders Domeij
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashish & Jamie,
Db2 UDB has a function called federated databe support.
This lets a DB2 server 'front' two or more different databases so that an application can use only one connection (to the DB2 server) and actually access two other databases.
/Anders
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic