wood burning stoves 2.0*
The moose likes JDBC and the fly likes Making Connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Making Connections" Watch "Making Connections" New topic

Making Connections

Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Hi all,
I have to write a servlet, or a Java class which calls 2 databases and selects some values from 2 tables.
That is, when I come to that servlet, at first the servlet has to Select values x,y and Z from table A. Then this servlet has to select values r,t,y from table B.
But table A and table B exist in two databases ans at 2 locations. I am getting connections to the 2 locations, so it is okay.
But my qn is can I do this in a single servlet ?
Any suggestions welcome
Manoj Singh
Ranch Hand

Joined: Aug 10, 2000
Posts: 41
Yes you can ! you just have to use two different Connection objects .

Sun Certified Java 2 Programmer<BR>" Only those who will risk going too far can possibly find out how far one can go "
Shreya Menon
Ranch Hand

Joined: Jul 31, 2001
Posts: 285
Thanks Manoj.
subject: Making Connections
Similar Threads
Mock questions required answers
proper way to insert a record to database using javabean -servlet or jsp?
Jtable Focus Problem
Please help identify 6 wrong answers
Check out the qtns for Part I