Advertisement
Tyluur

Untitled

Jan 5th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. DatabaseConnection connection = World.getConnectionPool().nextFree();
  2. if (connection == null)
  3. return false;
  4. try {
  5. Statement stmt = connection.createStatement();
  6. ResultSet rs = stmt.executeQuery("");
  7. if (rs.next()) {
  8. return true;
  9. }
  10. } catch (Exception e) {
  11. e.printStackTrace();
  12. } finally {
  13. if (connection != null) {
  14. connection.returnConnection();
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement