C3p0-config.xml
<?XML version= "1.0" encoding= "UTF-8"?><C3p0-config> <Named-configname= "Jdbc/mysqlname"> < Propertyname= "User">Username</ Property> < Propertyname= "Password">Password</ Property> < Propertyname= "Driverclass">Com.mysql.jdbc.Driver</ Property> < Propertyname= "Jdbcurl">jdbc:mysql://Address: Port/database name? characterencoding=utf-8</ Property> < Propertyname= "Initialpoolsize">3</ Property> < Propertyname= "MaxIdleTime">30</ Property> < Propertyname= "Maxpoolsize">6</ Property> < Propertyname= "Minpoolsize">2</ Property> </Named-config> <Named-configname= "Jdbc/oraclename"> < Propertyname= "User">Username</ Property> < Propertyname= "Password">Password</ Property> < Propertyname= "Driverclass">Oracle.jdbc.driver.OracleDriver</ Property> < Propertyname= "Jdbcurl">jdbc:oracle:thin:@ Address: Port: ORCL</ Property> <!--when initializing, get three connections, and the value should be between Minpoolsize and Maxpoolsize. - < Propertyname= "Initialpoolsize">3</ Property> <!--maximum idle time, unused in 30 seconds, the connection is discarded. If 0, it will never be discarded. - < Propertyname= "MaxIdleTime">30</ Property> <!--the maximum number of connections that are kept in the connection pool. - < Propertyname= "Maxpoolsize">6</ Property> <!--minimum number of connections retained in the connection pool - < Propertyname= "Minpoolsize">2</ Property> </Named-config></C3p0-config>
C3P0 Connection Pool Basic configuration MySQL and Oracle