aspose file tools*
The moose likes JDBC and the fly likes How to retrieve data from two different data base? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to retrieve data from two different data base?" Watch "How to retrieve data from two different data base?" New topic
Author

How to retrieve data from two different data base?

krishna dey
Greenhorn

Joined: Mar 11, 2008
Posts: 12
Hi,
i want to retrieve two different fields from two different database. suppose 1st name from databse1 and last name from dtabase2 and then i want to display both in a jsp page. what is the procedure to get the values from different DB?
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Option 1:

Make two separate JDBC call.

Option 2:

Create a DB link to another database and then you can do in one JDBC call, but you need have some relationship to do this one call.

Thanks,
Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

Originally posted by krishna dey:
what is the procedure to get the values from different DB?

Do two different queries.

Note that it is considered poor practice to do any queries directly from the JSP. You really should be going through a servlet or Java object.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: How to retrieve data from two different data base?
 
Similar Threads
Retrieving datasource info
regarding the jsp data store
Retrieving datasource info
sqlException column not found
Share data between jsp and servlet without using request or session