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

From Kevin Grittner
Subject Re: Improper type conversion from smallint to short
Date
Msg-id 1363352163.48241.YahooMailNeo@web162903.mail.bf1.yahoo.com
Whole thread Raw
In response to Improper type conversion from smallint to short  (Igor Urisman <igor.urisman@gmail.com>)
Responses Re: Improper type conversion from smallint to short  (Igor Urisman <igor.urisman@gmail.com>)
List pgsql-jdbc
Igor Urisman <igor.urisman@gmail.com> wrote:

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

I count on drivers complying with the published specification.  The
most recent version I was able to find near the top of a quick web
search was this (the Final Release of the JDBC 4.0 Specification):

http://download.oracle.com/otn-pub/jcp/jdbc-4.0-fr-eval-oth-JSpec/jdbc-4_0-fr-spec.zip

Take a look at the "Data Type Conversion Tables" in appendix B.  In
particular, table B-3 specifies which Java object class should be
returned by the getObject methods for each JDBC type.  To do as you
request would break the applications of everyone who trusts the
specification published through the Java Community Process.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-jdbc by date:

Previous
From: Kevin Wooten
Date:
Subject: Re: A new JDBC driver...
Next
From: Dave Cramer
Date:
Subject: Re: [pgjdbc] XADataSource support for resource sharing & interleaving. (#47)