Re: Integer is not a subclass of Short

From: Lloyd Parkes <Lloyd(dot)Parkes(at)ecs(dot)vuw(dot)ac(dot)nz>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Integer is not a subclass of Short
Date: 2010-07-31 22:20:48
Message-ID: 6D926F92-753C-4D1D-8BEE-153023D9CEEA@ecs.vuw.ac.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thanks Kris and Oliver. I have only referred to the Javadoc API and
not the JDBC spec because the API is online and Sun felt that the JDBC
spec is best published through their online shopping system behind
half a dozen "click here" pages.

So, let's start with the information I should have provided a while
back. I'm using Java 1.5.0 on a Mac with postgresql-8.4-701.jdbc3.jar.
I'm also using PostgreSQL server 8.3.

> That said, I think you must be using a very old driver. The last
> time I
> can see TypeInfoCache mapping int2 to "java.lang.Short" is back in the
> 8.1 driver branch. 8.2 and later should return "java.lang.Integer".

Hmm. That's interesting. I have some secret sauce in my program. I'm
using the Spring Framework to drive a whole bunch of stuff in my
program and one of the things I get it to do is to make the JDBC cruft
around the small amount of SQL I use go away. And then it turns out
that I am using two lots of secret sauce. The Spring Framework returns
a RowSet rather than a ResultSet. The RowSet is supposed to be an
extension of the ResultSet interface, but it is the RowSet that
doesn't work.

When I ran Kris' test case, it printed out "java.lang.Integer". When I
modified the program to use a com.sun.rowset.CachedRowSetImpl, it
printed out "java.lang.Short". I guess this is a bug in Oracle's JDBC
code.

Thanks for your help,
Lloyd

Attachment Content-Type Size
TestShort.java application/octet-stream 492 bytes

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message svelazquez 2010-08-02 00:27:33 PLEASE REMOVEME FROM THIS LIST
Previous Message Oliver Jowett 2010-07-30 22:28:22 Re: Idle in TX / Java process hang's in the vicinity of JDBC