简体   繁体   中英

JDBC Statement/PreparedStatement per connection

I was wondering how many statements or preparedstatements can be opened per connection at the same time. I don't really understand how would it work if multiple statements get executed and multiple resultssets are retrieved. Links of resources with details would be helpful.

Thanks

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM