Last active
October 1, 2015 16:24
-
-
Save thomasnield/112a9e0cb8041943d4f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void hikariTest() { | |
try { | |
HikariConfig config = new HikariConfig(); | |
config.setJdbcUrl("jdbc:sqlite://C:/mydatabases/mydb.db"); | |
config.setUsername("bart"); | |
config.setPassword("51mp50n"); | |
config.setMinimumIdle(1); | |
config.setMaximumPoolSize(5); | |
HikariDataSource ds = new HikariDataSource(config); | |
Connection conn = ds.getConnection(); | |
Statement stmt = conn.createStatement(); | |
ResultSet rs = stmt.executeQuery("SELECT count(*) as ct from MY_TABLE"); | |
while (rs.next()) { | |
System.out.println(rs.getInt("ct")); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment