<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<default-config>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/mydatabase</property>
<property name="user">username</property>
<property name="password">password</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="initialPoolSize">5</property>
<property name="minPoolSize">5</property>
<property name="maxPoolSize">20</property>
<property name="maxIdleTime">180</property>
</default-config>
</c3p0-config>
import com.mchange.v2.c3p0.ComboPooledDataSource;
import java.sql.Connection;
import java.sql.SQLException;
public class Main {
private static ComboPooledDataSource dataSource;
static {
try {
} catch (Exception e) {
e.printStackTrace();
}
}
public static Connection getConnection() throws SQLException {
}
public static void main(String[] args) throws Exception {
Connection connection = getConnection();
}
}