Guest User

Untitled

a guest
Apr 7th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import com.zaxxer.hikari.HikariDataSource;
  2. private static HikariDataSource ds;
  3.  
  4. // Constructor
  5. try {
  6. ds = new HikariDataSource();
  7. ds.setJdbcUrl("jdbc:mysql://localhost/tweets?useSSL=false&useUnicode=true");
  8. ds.setUsername("root");
  9. ds.setPassword("root");
  10. ds.setMaximumPoolSize(1000);
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. }
  14.  
  15.  
  16. // When you need connection
  17. Connection conn = ds.getConnection();
  18. ...
Add Comment
Please, Sign In to add comment