Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.zaxxer.hikari.HikariDataSource;
- private static HikariDataSource ds;
- // Constructor
- try {
- ds = new HikariDataSource();
- ds.setJdbcUrl("jdbc:mysql://localhost/tweets?useSSL=false&useUnicode=true");
- ds.setUsername("root");
- ds.setPassword("root");
- ds.setMaximumPoolSize(1000);
- } catch (Exception e) {
- e.printStackTrace();
- }
- // When you need connection
- Connection conn = ds.getConnection();
- ...
Add Comment
Please, Sign In to add comment