Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String url = "jdbc:postgresql://"+Definitions.getDatabaseIp().getHostAddress()+":"+Definitions.getDatabasePort()+"/"+Definitions.getDatabaseName();
- Connection connection = null;
- CallableStatement proc = null;
- try {
- Class.forName("org.postgresql.Driver");
- connection = DriverManager.getConnection(url,Definitions.getUsername(),Definitions.getPassword());
- connection.setAutoCommit(false);
- ResultSet resultset = null;
- proc = connection.prepareCall(sqlQuery);
- proc.registerOutParameter(1, Types.OTHER);
- proc.setFetchSize(100);
- proc.execute();
- resultset = (ResultSet)proc.getObject(1);
- String field[] = new String[11];
- while (resultset.next()) {
- Document d = new Document();
- if (source == Definitions.SOURCE_POSTS) {
Add Comment
Please, Sign In to add comment