| Author |
servlet queries
|
jagan billa
Greenhorn
Joined: Dec 05, 2011
Posts: 11
|
|
How to use this query in servlet
*****combine two database******
database1:registration
database2:shopping_cart
online is a common table in both database
SELECT registration.online.price, shopping_cart.online.name FROM registration.online, shopping_cart.online WHERE registration.online.id = 1 AND shopping_cart.online.id = registration.online.id;
how to define two database name in this
c=DriverManager.getConnection("jdbc:mysql://localhost:3306/database name","root","root");
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
You just need one of the two databases to connect to. The database prefix inside the query will take care of the rest.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Janarthanan Rajendran
Greenhorn
Joined: Nov 07, 2011
Posts: 7
|
|
Do not use Business logic inside Servlets, it should always go through Service classes.
Regards,
Jana
|
 |
 |
|
|
subject: servlet queries
|
|
|