this error occurs when you try and do a ResultSet.getObject() or similar on
a ResultSet that has either

a) returned false from ResultSet.next()
or
b) has not had ResultSet.next() called at least once yet. The ResultSet
starts one row before valid data.

As far as the 500 error, you should catch the SQLException on the page, not
just let it propagate it's way up. This way, you can catch the error and
continue on with your processing.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 11:26 AM
To: Tomcat Users List
Subject: UltraDev 4 & Tomcat on AS/400: Cursor Position Not Valid


I am having some problems with my web application using IBM's new HTTP 
Server with ASFTomcat.
I have written an application in UltraDev to search at DB for records 
corresponding to a registration number.

It works like greased lightning when there is actually a record in the 
recordset, but the application pukes
and gives me an error when I tried to query for a numbe that does not 
exist, and gives me a "Error 500:
cursor position invalid."

I know that this is a problem with the record set:  Here is the code:

<%@page contentType="text/html; charset=iso-8859-1" language="java" 
import="java.sql.*"%>
<%@ include file="Connections/connAS400.jsp" %>
<%
String rsBoaties__MMColParam = "%";
if (request.getParameter("BoatNumber")  !=null) {rsBoaties__MMColParam = 
(String)request.getParameter("BoatNumber") ;}
%>
<%
Driver DriverrsBoaties = 
(Driver)Class.forName(MM_connAS400_DRIVER).newInstance();
Connection ConnrsBoaties = 
DriverManager.getConnection(MM_connAS400_STRING,MM_connAS400_USERNAME,MM_con
nAS400_PASSWORD);
PreparedStatement StatementrsBoaties = 
ConnrsBoaties.prepareStatement("SELECT REGNUM, CITY  FROM BOATLIB.BTFPAA 
WHERE REGNUM LIKE UPPER('%" + rsBoaties__MMColParam + "%')");
ResultSet rsBoaties = StatementrsBoaties.executeQuery();
boolean rsBoaties_isEmpty = !rsBoaties.next();
boolean rsBoaties_hasData = !rsBoaties_isEmpty;
Object rsBoaties_data;
int rsBoaties_numRows = 0;
%>

Any ideas?  It would be greatly appreciated.  I am stumped.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to