Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
JDBC and Relational Databases
how to retrieve values from more than two tables
Mohd Nayeemuddin
Greenhorn
Posts: 4
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 10336
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Return a result set that is created from some sort of join.
For example, assuming:
create table tableA { id integer primary key, name varchar(30) } create table tableB { id integer primary key, someValue integer, tableA_id integer constraint fk_tableA references tableA(id) }
You can write a query like this:
select * from tableA inner join tableB on tableB.tableA_id = tableD.id
which will return all records in tableA that also have a related tableB record.
JavaRanch FAQ
HowToAskQuestionsOnJavaRanch
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
retrieve data frm database
Confusion when joining two tables
Joins
hibenrate Query...
HQL doubt.
More...