Re: Integer is not a subclass of Short
От | Lloyd Parkes |
---|---|
Тема | Re: Integer is not a subclass of Short |
Дата | |
Msg-id | 6D926F92-753C-4D1D-8BEE-153023D9CEEA@ecs.vuw.ac.nz обсуждение исходный текст |
Ответ на | Re: Integer is not a subclass of Short (Oliver Jowett <oliver@opencloud.com>) |
Список | 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
Вложения
В списке pgsql-jdbc по дате отправления: