getColumnClassName() and getObject() types differ for smallint

From: "Karl von Randow" <karl(at)xk72(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: getColumnClassName() and getObject() types differ for smallint
Date: 2005-09-22 22:34:50
Message-ID: 20050922223443.WBPU5449.mta4-rme.xtra.co.nz@Orac
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi all,

I have encountered what I believe is a bug in the Postgres JDBC drivers 8.0
build 312 and 8.1dev build 401 in regards to the class returned for smallint
columns using getObject() compared to the class indicated by the
getColumnClassName() method.

For my smallint column:
ResultSetMetaData.getColumnClassName() returns java.lang.Short
ResultSet.getObject().getClass().getName() returns java.lang.Integer

I have tested and confirmed this behaviour in driver 8.0 312 and 8.1dev 401
against my PostgreSQL 7.3.2 installation using Java 1.5.0_04-b05 on Linux. I
have not had an opportunity to test against a different version of
PostgreSQL.

The problem does not exist in the 7.4 build 216 driver; it returns
java.lang.Short for both.

Kind regards,
Karl

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-09-22 22:54:10 Re: getColumnClassName() and getObject() types differ for
Previous Message dircha 2005-09-22 22:06:49 Re: ResultSet#xxxTimestamp for DATE column unexpected behavior