db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Baklarz <bakl...@ca.ibm.com>
Subject Re: [jira] Commented: (DERBY-194) getPrecision() on TIME and TIMESTAMP is zero
Date Mon, 04 Apr 2005 19:39:57 GMT
Thanks for the info. I also noticed a few other pieces of information
missing in the ResultSetMetaData interface. getCatalogName() and
getSchemaName() always return blank even if I explicitly set the schema.
And I also noticed (as the thread pointed out) that some of the lengths
appear odd. The binary column (CHAR FOR BIT DATA) always show a display
width of 2 x column width. I guess they must be thinking that you would
display these bytes in an XX format.



George Baklarz | Senior Manager, Worldwide DB2 Sales Support | (+1)
905-413-2798 |  T/L 969-2798 | baklarz@ca.ibm.com

             "A B (JIRA)"                                                  
             che.org>                                                   To 
                                       George Baklarz/Toronto/IBM@IBMCA    
             04/04/2005 12:11                                           cc 
                                       [jira] Commented: (DERBY-194)       
                                       getPrecision() on TIME and          
                                       TIMESTAMP is zero                   

http://issues.apache.org/jira/browse/DERBY-194?page=comments#action_62077 ]

A B commented on DERBY-194:

I (Army) have been looking at a couple of database metadata issues in Derby
(as a follow-up to DERBY-107), and this is one that I too have noticed.

Fix is to change the "setTypeIdSpecificInstanceVariables()" method in
org/apache/derby/iapi/types/TypeId.java to set the "maxMaxWidth" variable
to be the correct value (namely, 8 for TIME (hh:mm:ss) and 26 for TIMESTAMP
(yyyy-mm-dd hh:mm:ss.ffffff)).

Unless someone wants to create a specific patch for this, I'll submit this
fix as part of another patch that I'm writing--one that will make Derby
metadata return the correct value for the BUFFER_LENGTH field for  builtin
(including datetime) types.  See the thread here for more on the

> getPrecision() on TIME and TIMESTAMP is zero
> --------------------------------------------
>          Key: DERBY-194
>          URL: http://issues.apache.org/jira/browse/DERBY-194
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions:
>  Environment: Windows XP SP1 Professional
>     Reporter: George Baklarz
>     Priority: Minor

> Sun JDBC defines getPrecision() to return either the maximum length or
maximum number of digits of the column, or zero for failure (such as the
precision is unknown).
> http://docs.sun.com/source/816-6105-10/apicola.htm#211083
> The DATE field returns 10 characters on a getPrecision() call so why
doesn't TIME and TIMESTAMP give a precision length equal to the display
length? Just seems inconsistent that DATE would return a precision (as well
as all other data types) and not TIME nor TIMESTAMP.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message