JDBC 學習

JDBC Statement/PreparedStatement per connection html

Multiple statements can be created and used on the same connection, but only one resultset at once can be created and used on the same statement. If you create/open another one by the same statement, then any previously opened resultset will be implicitly closed, leading to "ResultSet closed" exceptions on any attempt to access it. java

   As far as I know only one ResultSet can be created per statement, not per connection. This is supported by the description of Statement: 'By default, only one ResultSet object per Statement object can be open at the same time. Therefore, if the reading of one ResultSet object is interleaved with the reading of another, each must have been generated by different Statement objects.' –  Mark Rotteveel Dec 14 '11 at 15:11  sql

相關文章
相關標籤/搜索