Subject | Re: only one resultset at a time/statement? |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-04-18T22:50:43Z |
> It is prepared statement which is executed immediately before theIt is called implicitly inside stmt.executeQuery():
> getResultSet() which 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
public ResultSet executeQuery() throws SQLException {
...
return getResultSet();
}
You can modify your code to use execute() instead of executeQuery().
Hmmm... I do not consider it a bug, but if you say that other drivers
work correctly... Can you check what happens if you call that method
multiple times for the same result set in other drivers? Do they throw
exception when the method is called for the second time?
Thanks!
Roman