pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedgetColumnClassName() and getObject() types differ for smallint
3+ messages / 3 participants
[nested] [flat]
* getColumnClassName() and getObject() types differ for smallint
@ 2005-09-22 22:34 Karl von Randow <karl@xk72.com>
0 siblings, 1 reply; 3+ messages in thread
From: Karl von Randow @ 2005-09-22 22:34 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: getColumnClassName() and getObject() types differ for
@ 2005-09-22 22:54 Oliver Jowett <oliver@opencloud.com>
parent: Karl von Randow <karl@xk72.com>
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Jowett @ 2005-09-22 22:54 UTC (permalink / raw)
To: Karl von Randow <karl@xk72.com>; +Cc: pgsql-jdbc
Karl von Randow wrote:
> For my smallint column:
> ResultSetMetaData.getColumnClassName() returns java.lang.Short
That sounds like a bug.
> ResultSet.getObject().getClass().getName() returns java.lang.Integer
This is the correct result per the JDBC spec.
-O
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: getColumnClassName() and getObject() types differ for
@ 2005-09-29 23:05 Kris Jurka <books@ejurka.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 3+ messages in thread
From: Kris Jurka @ 2005-09-29 23:05 UTC (permalink / raw)
To: pgsql-jdbc
Oliver Jowett wrote:
> Karl von Randow wrote:
>
>>For my smallint column:
>>ResultSetMetaData.getColumnClassName() returns java.lang.Short
>
> That sounds like a bug.
>
Fixed in 8.0 and 8.1 cvs.
Kris Jurka
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-09-29 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 22:34 getColumnClassName() and getObject() types differ for smallint Karl von Randow <karl@xk72.com>
2005-09-22 22:54 ` Re: getColumnClassName() and getObject() types differ for Oliver Jowett <oliver@opencloud.com>
2005-09-29 23:05 ` Re: getColumnClassName() and getObject() types differ for Kris Jurka <books@ejurka.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox