The Artima Developer Community
Sponsored Link

Java Answers Forum
JDBC Malfunctioning of SQL Query after customizing the ResultSetType ...

1 reply on 1 page. Most recent reply: Apr 29, 2003 10:06 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
M Johnson

Posts: 4
Nickname: manova
Registered: Apr, 2003

JDBC Malfunctioning of SQL Query after customizing the ResultSetType ... Posted: Apr 28, 2003 8:13 PM
Reply to this message Reply
Advertisement
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 ??
...
...
...
**************************************************************** *******


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: JDBC Malfunctioning of SQL Query after customizing the ResultSetType ... Posted: Apr 29, 2003 10:06 AM
Reply to this message Reply
typically you iterate through the resultset with a while loop.


while(resultSet.next()){
//process next row of data
}

Flat View: This topic has 1 reply on 1 page
Topic: Java Problem On my Website Previous Topic   Next Topic Topic: how do i redirect to a diff url from the applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use