Hello all,
*I know this may look like a repeat post at first glance, but I assure you it is not. I've read all the posts in this forum already.*
Okay, the end goal here is to use the .last() method of the java.sql.ResultSet(). I realize that in order to use this you must have a scrollable resultset, which I have already specified as you can see in the code below. A few items of interest: We're using
JDK 1.2.2 (don't ask why)
Oracle 8i
Here's the code:
Connection objConn = null;
OracleCallableStatement objStmt = null;
objConn = SNTS_CConnection.open();
objStmt = (OracleCallableStatement)objConn.prepareCall("{? = call
SCHEMA.TABLE.SPROC (?,?)}",
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
objStmt.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.CURSOR);
objStmt.setString(2, strSomething);
objStmt.setString(3, strSomethingElse);
objStmt.execute();
rs = (ResultSet)objStmt.getObject(1);
rs.next(); //having or not having this line makes no difference
if (m_rsResults.last()) //BREAKS HERE
{
//nice code
}
Now, on the line that is commented as breaking above i receive this error at runtime:
"oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
java.sql.SQLException
Invalid operation for forward only resultset : last "
It should also be noted that the SQL code in the sproc works fine if embedded directly into the
java.
As you can see, I've used the TYPE_SCROLL_INSENSITIVE (and the CONCUR_READ_ONLY for that matter) and I'm still receiving the error. Any help would be greatly appreciated!!
Thanks in advance,
bryan