error when using mysql connector-j
I have an error in log after when trying to update the database:
java.sql.SQLException: Streaming result开发者_StackOverflow set null is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
I dont understand how a null ResultSet can be active. it looks like the connection is in a wiered state.
Weird? No. It looks like you aren't closing your JDBC resources.
You should close Connection, Statement, and ResultSet in a finally block in the scope of the method that created them.
update the database...result sets are open and in use on a given connection
You cannot reuse a PreparedStatement that's a SELECT at one point and an UPDATE at another without closing in between.
精彩评论