try

ResultSet rs12 = stmt.executeQuery("SELECT * FROM SSA201M WHERE PSUPC = '" +
c1upc + "' AND PSPLNT = '" + c1plnt + "'");
if(rs12.next()) {
  // The record was a record that meets the select criteria
} else {
  // The record NO record that meets the select criteria
}

Remember, in SQL a row can't be null, only a field.
    (*Chris*)

----- Original Message -----
From: Jeetandra Mahtani <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 22, 1999 2:36 PM
Subject: Checking for null state


> Hello,
> I have a sql statement in my code as follows:
> ResultSet rs12 = stmt.executeQuery("SELECT * FROM
> SSA201M WHERE PSUPC = '" + c1upc + "' AND PSPLNT = '"
> + c1plnt + "'");
> if(rs12 == null)....
>
> results in:
> a SQL Exception:
> com.ibm.as400.access.AS400JDBCException: Cursor state
> not valid
>
> I am trying to check whether a record was found or not.
> Any ideas?
>
>
>
>
>
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to