File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve data from two different data base?

 
krishna dey
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic