开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜