Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

doubt about master details relation and JDBC manner about retrieving details record

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
Imagine that we have a master details relation between two tables
(using foreign Key) , now when we select some records from master table ,does JDBC retrive each record childs automatically ?
can it be configured to do this ?


Thank you
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is more of SQL question than a JDBC question...

But the answer is no it is not automatic but your database will do what you ask (SQL) it to do. It sounds like you want a simple JOIN.

Here is a resource for you to look at http://en.wikipedia.org/wiki/Join_%28SQL%29
[ December 18, 2005: Message edited by: Maximilian Stocker ]
 
author & internet detective
Posts: 40213
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that SQL and database questions are ok here too.
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:
Note that SQL and database questions are ok here too.



Okay. I understand that.

I still think though that if someone has a basic SQL question/misunderstanding they are probably better served elsewhere.. where for example they could find a tutorial on SQL in general. No?

I did add a new question to the FAQ http://faq.javaranch.com/view?JdbcUsageQuestions


Q. I have a SQL (the language) question where should I ask it?

There are a vast number of SQL references, primers and tutorials available on the internet. It is recommended that you use Google to find an appropriate syntax guide for your database because databases do tend to have their own specific SQL dialects and what works on one system may not work on another.

For general SQL guidance the Wikipedia SQL reference is useful and may be found at http://en.wikipedia.org/wiki/SQL In the main article there are links to the various statements for a generic look at the purpose and syntax of these statements.



Was this wrong? Personally I don't think so. I mean if one wants to ask a SQL question go right ahead. But if the answer can be found elsewhere without waiting for someone to answer that makes sense to me.

I dunno.
 
Jeanne Boyarsky
author & internet detective
Posts: 40213
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maximilian,
I agree that people should feel comfortable using web sources rather than sit around and wait for an answer. But that's equally true for JDBC and Java questions. For SQL questions that aree conducive to a human being, this forum (JDBC) is the place to be. It even says so in the forum description: "Database access, JDBC/ODBC, could even brush on some SQL"

Common questions are "how can I make this query faster" or "how do I do ______ in SQL." More greenhorn like questions such as "I don't understand when to use a join" are welcome too.

I changed that passage in the wiki to read "Where can I get more information on SQL (the language)?" as I think that better reflects the intent of this forum.

If you want to discuss this topic anymore, I recommend starting a thread in the JavaRanch forum. That way we don't get too off topic from the master details relation

Jeanne
JDBC Forum Bartender
 
This tiny ad is wafer thin:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic