This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes sql problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sql problem" Watch "sql problem" New topic

sql problem

k mull

Joined: Dec 15, 2004
Posts: 5

above is the code i'm using to select items from two tables

in the line item table there are 3 fiels - ORDER_NUMBER,PART_NUMBER + QTY!
for every order number there is a part number and quantity so i want to print out all the items associated with a certain order number
ORDER NUMBER 43567 has:

but when i want to print out these two part numbers it only prints out the first one. I've tried different things but i cant get more than one item to be printed out..Can anyone help?
Thomas Manthey

Joined: Dec 16, 2004
Posts: 12
I think here is your answer:

when you open your recordset r for the inner loop, you loose your recordset rs in the outer loop. The solution is having a second statement-object.

Always remember: The API is your very best friend !

inside every large program there is a small program struggling to get out...
Thomas Manthey

Joined: Dec 16, 2004
Posts: 12
Should be Resultset instead of Recordset, since this is clearly not MS-territory...
[ December 16, 2004: Message edited by: Thomas Manthey ]
I agree. Here's the link:
subject: sql problem
Similar Threads
Problem displaying report using JSP
How to Export web page(jsp page) to excel using jsp or servlets
small question for a e-store problem
JSP returning old data, database was changed correctly!
Problem in updating the fields to database