Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import mirco.db.*;
- public class Example {
- public static void main(String[] args) throws SQLException, InterruptedException {
- ConnectionsPool pool = new ConnectionsPool(new PoolSettings("jdbc:mysql://server/db"));
- Database db = null;
- try {
- db = pool.take();
- ResultSet res = null;
- try {
- res = db.query("select name from table users where age >= ?", 21);
- while (res.next()) {
- System.out.println(res.getString("name"));
- }
- } finally {
- db.cleanup(res);
- }
- } finally {
- pool.release(db);
- }
- pool.disconnect();
- }
- }
Add Comment
Please, Sign In to add comment