[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-bugs
Subject:    Re: [JDBC] [BUGS] JDBC: 2 bugs: Getting a smallint array actually
From:       Oliver Jowett <oliver () opencloud ! com>
Date:       2010-06-30 1:10:33
Message-ID: 4C2A9989.2050302 () opencloud ! com
[Download RAW message or body]

Saneesh Apte wrote:

>     I think I found two bugs (and I hope I am not wasting everyone's time).
>     One is minor: the base type of a boolean[] is java.sql.Types.BIT 
> instead or java.sql.Types.BOOLEAN.  At the very least shouldn't these be 
> aliases for the same type?

Types.BOOLEAN does not exist before JDBC3. Client code can use either, 
but we have to pick one or the other when returning a value, so we 
return BIT.

>     And secondly the returned type from a smallint[] is an Integer[] 
> instead of a Short[].

smallint is a Types.SMALLINT which is mapped to java.lang.Integer by the 
JDBC spec. See appendix B of the spec:

> Note – The JDBC 1.0 specification defined the Java object mapping for the
> SMALLINT and TINYINT JDBC types to be Integer. The Java language did not
> include the Byte and Short data types when the JDBC 1.0 specification was
> finalized. The mapping of SMALLINT and TINYINT to Integer is maintained to
> preserve backwards compatibility.

-O

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic