Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

help

Thread view: 
anji - 29 Mar 2008 05:24 GMT
Hi,

how to get data from two different database and different tables
Lew - 29 Mar 2008 05:29 GMT
> how to get data from two different database and different tables

<http://java.sun.com/javase/6/docs/api/java/sql/package-summary.html>

Second part first:

You can set up queries against different tables in a single database, using
JOINs and the like, and build them into PreparedStatement objects.  Executing
the PreparedStatement generates a ResultSet which you an unpack into your
favorite object model.

You can get data from different databases, that is, ones that require separate
connections, by setting up those separate connections, each with its own
PreparedStatements.

Correlating data from one database to data from another is harder.

Signature

Lew

Roedy Green - 29 Mar 2008 07:08 GMT
>Correlating data from one database to data from another is harder.

You might want to export some data from one data base and import it
into the other periodically so that you can do joins.

Seem to me I recall coming across tools that claimed to make several
databases appear as one.  I can't recall what they were called.
Perhaps someone else can.  Maybe Hibernate can do that.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Patricia Shanahan - 29 Mar 2008 14:33 GMT
>> Correlating data from one database to data from another is harder.
>
[quoted text clipped - 4 lines]
> databases appear as one.  I can't recall what they were called.
> Perhaps someone else can.  Maybe Hibernate can do that.

Is "federated database" what you mean? See
http://en.wikipedia.org/wiki/Federated_database_system

Patricia
Logan Shaw - 30 Mar 2008 04:38 GMT
>> Correlating data from one database to data from another is harder.
>
[quoted text clipped - 4 lines]
> databases appear as one.  I can't recall what they were called.
> Perhaps someone else can.  Maybe Hibernate can do that.

Well, if you don't mind being database-specific, and if your database
is already Oracle, then Oracle supports distributed queries.  You
can go into one database and create a link to another, then do a
join (or whatever) across databases.

  - Logan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.