The following is just the code snippet, if you need it, you can adjust it yourself :) The driver provided by other database vendors will also have a similar function, and the ideas are also consistent, and the API documentation can be referred to the driver itself.
Import oracle.jdbc.pool. *;
OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource (); ocpds.setURL (this.db_url); // JDBC URL for Oracle ocpds.setUser (this.db_user); // username ocpds.setPassword (this.db_pass); // password connPool = new OracleConnectionCacheImpl (ocpds); // Set the maximum number of connections connPool.setMinLimit (this.min); connPool.setMaxLimit (this.max); // set the scheme connPool.setCacheScheme (OracleConnectionCacheImpl.DYNAMIC_SCHEME); Connection conn = connPool .getConnection ();