db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Commented: (DERBY-695) Re-enable the TINYINT datatype
Date Wed, 09 Nov 2005 23:59:30 GMT
Rick Hillegas wrote:

>> http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
>> This mapping is reflected in the data returned by
>> DatabaseMetaData.getTypeInfo
>> On an implementation note, the link above says TINYINT is valued 0-255
>> signed or unsigned, I do not believe that is what was implemented by
>> Cloudscape, or any existing code in Derby. I seem to remember
>> Cloudscape used a Java byte which holds values -128 to 127, thus its a
>> good thing the TINYINT type was removed/disabled because it was
>> non-standard on several fronts.
> I'm afraid I don't understand. The above link says that a JDBC TINYINT
> is an 8-bit integer which fits in a byte and may be regarded as signed
> or unsigned. And you say that Cloudscape implemented this as a byte. I'm
> missing the discrepancy here. For the record, Postgres, SQL Server, and
> Sybase all treat TINYINT as an 8-bit integer.

I see this in section 8.3.4

"The JDBC type TINYINT represents an 8-bit integer value between 0 and
255 that may be signed or unsigned."

I don't see anything in that section or elsewhere about "fits in a
byte", in fact I see:

"The 8-bit Java byte type represents a signed value from -128 to 127, so
it may not always be appropriate for larger TINYINT values"

Maybe you could read the first quote as unsigned 0-255, and signed
-128-127 but it seems a strange way of saying that.

Maybe there's a better definition somewhere, that's just the first I
found, since it doesn't seem to be mentioned in JDBC 3.0 in any
meaningful way.

But I'm tired and jet-lagged ...


View raw message