Subject | Reusing a Statement instance |
---|---|
Author | Andrew |
Post date | 2009-01-29T18:21Z |
Hello,
Recently I have encountered an exception when tried to reuse the same
Statement instance.
The code looks like this:
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."
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.
Best regards,
Andrew
Recently I have encountered an exception when tried to reuse the same
Statement instance.
The code looks like this:
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."
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.
Best regards,
Andrew