db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bit Runner..." <bitrun...@katamail.com>
Subject Re: Error: Invalid cursor state - no current row.
Date Sun, 28 Oct 2007 19:51:45 GMT
Exact: I have put setAutoCommit(false) and all it works correctly!!! :-))))

Thanks

PS: an other question: but in AutoCommit true the every instruction sql 
is executed in one isolated transaction. And therefore why it gave error 
to me? In theory it would have to give it with AutoCommit false.

Bryan Pendleton ha scritto:
>> Run my sample program i receive the error: Invalid cursor state - no 
>> current row.
>> If comment the line;
>>        ResultSet rsOpzioni = 
>> con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
>> ResultSet.CONCUR_READ_ONLY).executeQuery(sql);
>>        while (rsOpzioni.next()) {
>>           System.out.println(rsOpzioni.getString("opzUtente"));
>>        }
>>        rsOpzioni.close();
>>
>> my program work correctly!!!
>
> Perhaps your connection is in "auto-commit" mode, and the execution of
> the inner query is causing a commit, which is closing the outer query's
> result set as well?
>
> Does the behavior change if you call con.setAutoCommit(false) at the
> start of your program?
>
> thanks,
>
> bryan
>
>


Mime
View raw message