It's not a secret anymore!*
The moose likes JDBC and the fly likes how to retrieve values from more than two tables 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 "how to retrieve values from more than two tables" Watch "how to retrieve values from more than two tables" New topic
Author

how to retrieve values from more than two tables

Mohd Nayeemuddin
Greenhorn

Joined: Apr 25, 2007
Posts: 4
hai,
how to retrieve values into the ResultSet object from more than two tables by establishing a relation. Please solve my query with an example.


Thank Q.

Regards...
Nayeem
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Return a result set that is created from some sort of join.

For example, assuming:


You can write a query like this:

which will return all records in tableA that also have a related tableB record.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to retrieve values from more than two tables
 
Similar Threads
retrieve data frm database
hibenrate Query...
HQL doubt.
Confusion when joining two tables
Joins