db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Error: Invalid cursor state - no current row.
Date Sun, 28 Oct 2007 17:19:16 GMT
> 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