Re: ResultSet.getObject returning PGobject

From: Kris Jurka <jurka(at)ejurka(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet.getObject returning PGobject
Date: 2005-11-18 23:50:52
Message-ID: 437E68DC.6070107@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-jdbc by date

  From Date Subject
Next Message pedro farinha 2005-11-19 00:35:17 Re: Again the JSCreator and Metadata issues
Previous Message Kris Jurka 2005-11-18 22:44:38 Re: ResultSet.getObject returning PGobject