I'm trying write a test for a method that returns a java.sql.Connection to connect to a PostgreSQL.
My test is very straightforward:
@Test
public void connectionFactoryShouldReturnOpenConnection() throws Exception {
Connection conn = ConnectionFactory.getConnection();
assertTrue(conn.isValid(2));
}
The isValid call fails, though:
org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.java:753)
at org.postgresql.jdbc4.AbstractJdbc4Connection.isValid(AbstractJdbc4Connection.java:109)
at org.postgresql.jdbc4.Jdbc4Connection.isValid(Jdbc4Connection.java:21)
What's going on? Surely there is a PostgreSQL JDBC driver that implements the methods of Java 1.6 such as isValid()?
Here the details on the driver I'm using:
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.0-801.jdbc4</version>