Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented

That method is implemented in the current driver version. You must be using an old PgJDBC. Upgrade. It's fully backward compatible. (You should've specified your PgJDBC version in the question).

Separately, though, relying on connection "validation" is usually a bad idea. It's just a way of trying to imperfectly hide a race condition. Simply grab the connection and use it. If there's a problem with it, your application should trap the resulting exception, check the SQLSTATE to see if it's a connection related error, and retry with a new connection.


Replace your postgresql with below entry in pom.xml. My Postgress version was postgresql-9.3.10-3.

<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>9.3-1100-jdbc41</version>
</dependency>

Craig has right. The root cause is postgresql group id changed to org.postgresql and the old group doesn't get the updates. You should refresh your dependency node i.e.:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.5</version>
</dependency>

according to the current latest version https://mvnrepository.com/artifact/org.postgresql/postgresql/