Home > Archive > PostgreSQL JDBC > September 2005 > getColumnClassName() and getObject() types differ for smallint









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author getColumnClassName() and getObject() types differ for smallint
Karl von Randow

2005-09-22, 8:24 pm

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


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com