Subject Re: [Firebird-Java] Reusing a Statement instance
Author Roman Rokytskyy
> Statement stmt = connection.CreateStatement();
> ResultSet rs = stmt.executeQuery("select * from config");
> if (rs.next()) {
> //....
> }
> stmt.close();
> rs = stmt.executeQuery(sql); // <--- This line causes
> "org.firebirdsql.jdbc.FBSQLException: This statement is already closed."

You just closed it one line before. :) I suspect you wanted to close the
result set, so the previous line whould be

if (rs.next()) {
//....
}
rs.close();
rs = stmt.executeQuery(sql); // <--- This line causes


> My application is for Java 1.4.2. The driver version is 2.1.6 for
> jdk1.4. The application uses pooled pure-java connection.
> I have googled for the similar problems and found this:
> http://faqs.javabeat.net/jdbc/jdbc-interview-questions-faqs-1.php
>
> Please clarify the situation.

If you mean the question 29, then everything is correct. JDBC driver for
Firebird respects the specification, so you can also not close the
result set - it will be closed before other statement is executed.

Roman