JDBC 线程安全 数据库连接池
jdbc 是线程安全的,但是, 推荐一个线程用一个链接 JDBC is thread safe: It is quite OK to pass the various JDBC objects between threads. For example, you can create the connection in one thread; another thread can use this connection to create a PreparedStatement and a third thread can process the result set. The single major restriction is that you cannot have more than one ResultSet open on a single PreparedStatement at any time . See Does Oracle DB support multiple (parallel) operations per connection? 你不能在一个statment上面存在超过一个打开的resultset(不打开的可以有多个)。 Note that a database commit occurs on a Connection, and so all