Re: JDBC gripe list - Mailing list pgsql-jdbc

From Basil Bourque
Subject Re: JDBC gripe list
Date
Msg-id 09BBB87C-E865-4E87-82EE-0C1F739D2BB0@me.com
Whole thread Raw
In response to Re: JDBC gripe list  ("MauMau" <maumau307@gmail.com>)
Responses Re: JDBC gripe list  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Another gripe: "InValid" method

"IsValid" method in JDBC spec is not functional (simply throws an exception).
http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html#isValid(int)

This means users have to write their own routine to test if the connection is still successfully running. Example, run
aquery like "SELECT 1 = 1;" where you ignore the results -- you just look to see if errors occurred. 

Spec:
-----
Returns true if the connection has not been closed and is still valid. The driver shall submit a query on the
connectionor use some other mechanism that positively verifies the connection is still valid when this method is
called.
-----

Current code in "AbstractJdbc4Connection.java" of "postgresql-jdbc-9.0-801.src":
-----
    public boolean isValid(int timeout) throws SQLException
    {
        checkClosed();
        throw org.postgresql.Driver.notImplemented(this.getClass(), "isValid(int)");
    }
-----

--Basil Bourque



pgsql-jdbc by date:

Previous
From: "David Patricola"
Date:
Subject: SSL connection failure
Next
From: Dave Cramer
Date:
Subject: Re: SSL connection failure