Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql problem

 
k mull
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
eg.
ORDER NUMBER 43567 has:
PART NUMBER QB-101, QTY 4
PART NUMBER QB-102, QTY 1

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
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think here is your answer:

http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html

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 !
 
Thomas Manthey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should be Resultset instead of Recordset, since this is clearly not MS-territory...
[ December 16, 2004: Message edited by: Thomas Manthey ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic