public static void main(String[] args) throws SQLException {
DataSource dataSource = DataSourceBuilder.create()
.url("jdbc:mysql://localhost:3306/test")
.username("root")
.password("root")
.driverClassName("com.mysql.cj.jdbc.Driver")
.build();
PreparedStatement pst = dataSource.getConnection().prepareStatement("select * from tt");
ResultSet resultSet = pst.executeQuery();
while (resultSet.next()) {
System.err.println(Joiner.on("--").join(resultSet.getInt(1), resultSet.getString(2)));
}
}