Forums Register Login

How to fix this error exception error ?

+Pie Number of slices to send: Send
javax.servlet.ServletException: java.sql.SQLException: Before start of result set




this is the code from where it comes . Any ideas ?
+Pie Number of slices to send: Send
 

Vladislav Rashkov wrote:



The ResultSet obtained in the above lines of code would not be pointing to the results obtained from the query. So in order to make it point to the first set of results, you would have to call rs.next()


Alternatively, you can alter the query/code as follow:
+Pie Number of slices to send: Send
Thanks!
I found my mistake . I was trying with the wile loop, but seams to be the if operator the right answer. Thanks
+Pie Number of slices to send: Send
 

Vladislav Rashkov wrote:Thanks!
I found my mistake . I was trying with the wile loop, but seams to be the if operator the right answer. Thanks


It depends on the number of rows returned - if you use IF then you'll only get the first row, and with WHILE you'll get all rows.
+Pie Number of slices to send: Send
But with if it works, like I have that two String the name and the password, and when I input them, they are right, no problems, the connection is OK .
Legend has it that if you rub the right tiny ad, a genie comes out.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1645 times.
Similar Threads
Else loop not working
cannot find symbol
Using sessions for authentication
servlet not displaying is downloading
ResultSet can not print the first row
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:03:27.