PDA

Click to See Complete Forum and Search --> : JBDC Malfunctioning of SQL Query after customizing the ResultSetType ...


manova168
Apr 29th, 2003, 08:29 PM
I am developing a JDBC database system using Microsoft Access as the storage facility. All users are authenticated before accessing the system. I achieve this through the following SQL query that just simply compares the user logon to the Access database. It's working fine initially. However, when the ResultSet was switched from TYPE_FORWARD_ONLY to TYPE_SCROLL_INSENSITIVE, the executeQuery() failed to return any record. Does anyone know what could be the cause of this misbehavior, and how could I solve it ??

Thanx in advance.

***********************************************************************
...
...
String sql = "SELECT * FROM Staff WHERE username = 'mary' AND strComp(password, 'pp12344', 0) = 0";
...
...
...
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
results = stmt.executeQuery(sql);
...
...
...
System.out.println(results.next()); //keep saying "false" meaning no record found ??
...
...
...
***********************************************************************