• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Look up data from different databases

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem here is how to fire a query on two connections simultaniously?
Any suggestions?
Regards,
Ashish Saraf
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic