db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: SqlException With Returning Data For First Row
Date Wed, 05 Dec 2007 21:28:09 GMT
digi_pixel wrote:
> By the way I was trying to retrieve the column using index 0. I have
> attempted to re run the application by changing the index to 1 this time,
> however a new run time error now appears:
>     org.apache.derby.client.am.SqlException: Invalid operation to read at
> current cursor position.
> Rick Hillegas-2 wrote:
>> Without seeing your code, I can only speculate about what the problem 
>> is. However, your problem may be that you are trying to retrieve the 
>> first column using the index 0. Annoyingly, the JDBC methods use 
>> 1-based, not 0-based indexing. So the first thing to verify is that you 
>> are retrieving the initial column using index 1, not 0.
>> Hope this helps,
>> -Rick
Maybe you are positioned before the first row or after the last row. 
Make sure that you issue a ResultSet.next() call before trying to 
retrieve the first row. In general, make sure that ResultSet.next() 
evaluates to true before each row that you read. When ResultSet.next() 
returns false, you are at the end of the data and you will get an 
exception if you try to read past the end.

Hope this helps,

View raw message