| Author |
How to fix this error exception error ?
|
Jahar Heard
Greenhorn
Joined: Jan 09, 2010
Posts: 20
|
|
javax.servlet.ServletException: java.sql.SQLException: Before start of result set
this is the code from where it comes . Any ideas ?
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2925
|
|
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:
|
Mohamed Sanaulla | My Blog
|
 |
Jahar Heard
Greenhorn
Joined: Jan 09, 2010
Posts: 20
|
|
Thanks!
I found my mistake . I was trying with the wile loop, but seams to be the if operator the right answer. Thanks
|
 |
Rene Larsen
Ranch Hand
Joined: Oct 12, 2001
Posts: 1179
|
|
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.
|
Regards, Rene Larsen
Dropbox Invite
|
 |
Jahar Heard
Greenhorn
Joined: Jan 09, 2010
Posts: 20
|
|
|
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 .
|
 |
 |
|
|
subject: How to fix this error exception error ?
|
|
|