Guest User

Untitled

a guest
Mar 1st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. String url = "jdbc:postgresql://"+Definitions.getDatabaseIp().getHostAddress()+":"+Definitions.getDatabasePort()+"/"+Definitions.getDatabaseName();
  2.  
  3. Connection connection = null;
  4. CallableStatement proc = null;
  5. try {
  6. Class.forName("org.postgresql.Driver");
  7. connection = DriverManager.getConnection(url,Definitions.getUsername(),Definitions.getPassword());
  8. connection.setAutoCommit(false);
  9.  
  10. ResultSet resultset = null;
  11.  
  12. proc = connection.prepareCall(sqlQuery);
  13. proc.registerOutParameter(1, Types.OTHER);
  14. proc.setFetchSize(100);
  15. proc.execute();
  16. resultset = (ResultSet)proc.getObject(1);
  17.  
  18. String field[] = new String[11];
  19. while (resultset.next()) {
  20. Document d = new Document();
  21. if (source == Definitions.SOURCE_POSTS) {
Add Comment
Please, Sign In to add comment