private static final String Url = "jdbc:mysql://localhost:3306/javatest?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8";
private static final String Username = "javatest";
private static final String Password = "javatest";
private static ComboPooledDataSource ds;
static {
try {
ds = new ComboPooledDataSource();
ds.setDriverClass("com.mysql.cj.jdbc.Driver");
ds.setUser(Username);
ds.setPassword(Password);
ds.setJdbcUrl(Url);
ds.setInitialPoolSize(5);
ds.setMaxPoolSize(20);
ds.setMinPoolSize(5);
Connection conn = ds.getConnection();