Subject | Re: only one resultset at a time/statement? |
---|---|
Author | burghard_w_v_britzke |
Post date | 2004-04-18T17:26Z |
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy" <rrokytskyy@a...> wrote:
raises the exception. so it is not called twice for that executeQuery(). the code is in a large
db-framework (http://www.jdataset.de), which works with many jdbc-drivers with that
code. and it work mainly with the jaybird-jdbc-driver.
PreparedStatement stmt = = con.prepareStatement("SELECT ID FROM TABLE...");
...
stmt.executeQuery();
ResultSet rs = stmt.getResultSet(); // here, the exception is raised
> > when trying to get the resultset for my prepared statement, I get theIt is prepared statement which is executed immediately before the getResultSet() which
> > following exception:
> >
> > org.firebirdsql.jdbc.FBSQLException: Only one resultset at a
> > time/statement.
> > at org.firebirdsql.jdbc.AbstractStatement.getResultSet(
> > AbstractStatement.java:531)
> >
> > what happened?
>
> See documentation to java.sql.Statement.getResultSet():
>
> public ResultSet getResultSet()
> throws SQLException
>
> Retrieves the current result as a ResultSet object. This method should
> be called only once per result.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Returns:
> the current result as a ResultSet object or null if the result is
> an update count or there are no more results
> Throws:
> SQLException - if a database access error occurs
> See Also:
> execute(java.lang.String)
raises the exception. so it is not called twice for that executeQuery(). the code is in a large
db-framework (http://www.jdataset.de), which works with many jdbc-drivers with that
code. and it work mainly with the jaybird-jdbc-driver.
PreparedStatement stmt = = con.prepareStatement("SELECT ID FROM TABLE...");
...
stmt.executeQuery();
ResultSet rs = stmt.getResultSet(); // here, the exception is raised