I attempted to concatenate a string to the url parameter of the below in order to set the protocolVersion, but I'm not sure how to keep the string in the url without altering the name of the database, so I kept getting a database name error.
String protocolVersion = "&2";
String url = "jdbc:postgresql://" + host + ":" + port + "/" + database + protocolVersion;
Connection connection = null;
connection = DriverManager.getConnection(url, user, password);
I am using PostgreSQL 9.2, but I was getting lag so I want to try to see if I can optimize by using an older protocol version.
EXPLAIN
on your query to figure out the slowness. Might be easily addressable with an index or two. – Jason Scheirer Dec 28 '12 at 9:30