Subject | Re: [Firebird-Java] Reusing a Statement instance |
---|---|
Author | Roman Rokytskyy |
Post date | 2009-01-29T19:18:29Z |
> Statement stmt = connection.CreateStatement();You just closed it one line before. :) I suspect you wanted to close the
> 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."
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 forIf you mean the question 29, then everything is correct. JDBC driver 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.
Firebird respects the specification, so you can also not close the
result set - it will be closed before other statement is executed.
Roman