Need Code to create Connection Pool in java

后端 未结 10 1666
轻奢々
轻奢々 2020-11-30 20:50

Need code to create the connection pool in java? How does we make sure that connection pool doesn\'t return the same object which is already in use? How happens if client cl

10条回答
  •  温柔的废话
    2020-11-30 21:18

    Use one of the existing, e.g. Apache DBCP

    The connections returned by the pool are often proxies which "ignore" the call to close() from the application. When the connections are returned to the pool, they can be reused. Pools also close and reopen automatically if necessary.

提交回复
热议问题