HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost/test");
config.setUsername("yourusername");
config.setPassword("yourpassword");
HikariDataSource ds = new HikariDataSource(config);
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
// do some operation
// close statement and connection
stmt.close();
conn.close();
上一篇:本地和远程GUI之间的同步