look like your query result set contain only one record. If this is the
case, then you need to move the cursor to the first record. Otherwise you
are right you need to put your code inside the while loop
-----Original Message-----
From: Cato, Christopher [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 9:05 AM
To: [EMAIL PROTECTED]; '[EMAIL PROTECTED]'
Subject: rs.next() problems with mm.mysql/JDBC 2
Hello. Sorry for the off-topic (cross)post.
I have a web application (servlets) which consists of 48 applications. The
application was developed with the MySQL driver mm.mysql version 1.X
Version 1.X does not implement scrollable result sets.
I have just now upgraded the driver to version 2.0.4 which supports
scrollable resultsets. In my code, there are quite a number of spots where I
directly read a one-row response like follows:
---------------------------------------------------
ResultSet rs = stmt.execute(sql);
String userId = rs.getString("userid");
String status = rs.getString("accountStatus");
----------------------------------------------------
Now, this won't work anymore because there is now a position 'before' and
'after' the result set implemented in the new mm.mysql driver.
Does anyone have any idea how I could fix this without having to rewrite all
of my applications? Or do I really have to put ALL these within
while(rs.next()){} loops?
Regards,
Christopher Cato
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail [EMAIL PROTECTED] instead.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]