Re: ResultSet.getObject returning PGobject - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: ResultSet.getObject returning PGobject
Date
Msg-id 437E68DC.6070107@ejurka.com
Whole thread Raw
In response to ResultSet.getObject returning PGobject  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-jdbc
Kevin Grittner wrote:
> Ah, that may be a good clue.
>
> We are not selecting any columns which are not directly mappable
> to a Java type -- at least not intentionally.  There is a problem with
> a JDBC escape sequence which is not implemented by PostgreSQL
> which is throwing some exceptions, which we are still cleaning up.
> Perhaps the syntax is occassionally being interpreted in some way
> which is causing this.  I'll suspend this issue until we get the other
> cleaned up and see if we still have this problem.

What escape sequence is that?  We could look at implementing it.

> This is happening on a SELECT where the result set consists entirely
> of simple references to columns from a single table.  The columns are
> all char, varchar, numeric, or int -- so they should all map to Java
> types.  It is happening on a small percentage of SELECTs with no
> apparent difference beyond the values used in otherwise identical
> WHERE clauses.
>

I see no reason why the WHERE clause would alter the type of a result
column.  Checking:

Object o = rs.getObject(col);
if (o instanceof PGobject) {
    System.err.println(((PGobject)o).getType());
    System.err.println(((PGobject)o).getValue());
}

or similar would tell you what the returned type was.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: ResultSet.getObject returning PGobject
Next
From: pedro farinha
Date:
Subject: Re: Again the JSCreator and Metadata issues