Forums Register Login

Moving Through a result Set on two tables

+Pie Number of slices to send: Send
I have a problem with setting up my result set and when I query the database, I have two tables and they are linked by a common column name so I have to designate which one I call to the but when I set my second query to the second table I get a query already open error, because I queryed the first tables so how do I combine the two queries into one but avoid the problem of the Column with the same name, (The columns needs to be the same so changing them isn't an option)

+Pie Number of slices to send: Send
I am not sure I understand exactly what you are trying to do, but why cant you have two independent statement objects for two tables.
+Pie Number of slices to send: Send
I'm not sure what you mean by having two object statments, but how would that work and if I were pulling info outta the database how would that work for the code below I just pasted below assuming that lets say 1/2 of the items I was trying to set were for a different table

+Pie Number of slices to send: Send
From JavaDocs for java.sql.Statement -


By default, only one ResultSet object per Statement object can be open at the same time. Therefore, if the reading of one ResultSet object is interleaved with the reading of another, each must have been generated by different Statement objects. All execution methods in the Statement interface implicitly close a statment's current ResultSet object if an open one exists.



What I was saying was, have two Statements for the two ResultSets you need from two different queries, and then you can do whatever you want with those

snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1243 times.
Similar Threads
What is -Xlint in compiling java program?why this is done?
Need Help Pulling Data From Oracle Table (Newby)
removing a scrollpane, yet still see it
jsf and database connection problem
Solved : JTDS MSSQL Pagination problem.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:10:42.