Simple JDBC wrapper for Java
- Connection pooling
- No need to close connection, statement, and result set (AutoCloseable)
- Support lambda for query and update
- create a pitcher with a name, url, username, and password
Pitcher pitcher = new Pitcher("{pitcher_name}", "{url}", "{username}", "{password}");
- create a spoon and set it to the pitcher
Spoon spoon = new NormalSpoon(pitcher, 10, 3, 5, 1, 1);
pitcher.setSpoon(spoon);
pitcher.stirSpoon(); // start connection pooling thread
- get a cup(connection) from the pitcher
Cup cup = pitcher.getCup();
- query the database
cup.query("SELECT name from USER where id = 1", resultSet -> {
try {
System.out.println("Name: " + resultSet.getString("name"));
} catch (SQLException e) {
e.printStackTrace();
}});
Class names are
Tray
is a Pitcher pool.Pitcher
is a Cup pool.Spoon
is a Pitcher pool manager.Cup
is a connection.
MIT
- support json option
- support javadoc
- register to maven central
- release jar
- support pitcher log writer and login timeout