Re: Improper type conversion from smallint to short - Mailing list pgsql-jdbc

From Igor Urisman
Subject Re: Improper type conversion from smallint to short
Date
Msg-id CAJ9OwnXAj=R-5HAFRXahwFeniCQLCSzUgbMHoGxfJUAT25Hq1A@mail.gmail.com
Whole thread Raw
In response to Re: Improper type conversion from smallint to short  (Kris Jurka <books@ejurka.com>)
Responses Re: Improper type conversion from smallint to short
List pgsql-jdbc
Thanks, Kris.  Not to argue... The spec you're quoting from is pre Java 1.1, which is when Short was introduced.  (Integer was in 1.0).  Just thinking...  That same spec recommends primitive short.  Just sayin'.
-Igor.


On Thu, Mar 14, 2013 at 5:27 PM, Kris Jurka <books@ejurka.com> wrote:


On Thu, 14 Mar 2013, Igor Urisman wrote:

> Hello,It appears that ResultSet.getObject(String name) returns Integer for
> database type Types.SMALLINT (5)  I expected Short.
>

Returning Integer is correct according to the JDBC spec.  See table 8.6.3
here:

http://www.cis.upenn.edu/~bcpierce/courses/629/jdkdocs/guide/jdbc/getstart/mapping.doc.html

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Improper type conversion from smallint to short
Next
From: Kris Jurka
Date:
Subject: Re: Improper type conversion from smallint to short