db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyre Tjeldvoll (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-2423) Embedded and client differ on ResultSetMetaData.isCurrency() value for DECIMAL and NUMERIC columns
Date Thu, 10 Oct 2013 10:29:42 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791370#comment-13791370
] 

Dyre Tjeldvoll commented on DERBY-2423:
---------------------------------------

I agree that the client is probably correct here. It is difficult to find information about
how this method is supposed to work. From googling I see that some clients use the value returned
by this method to determine if the column value should be formatted as a currency.

The JDBC Tutorial and Reference (JDBC 3.0) page 1073 mentions "...the common cases where DECIMAL
and NUMERIC are used for currency values...", but I don't think this implies that isCurrency
should always return true for these types. 

Table 50.7 JDBC Types Mapped to Database-specific SQL Types (also in the JDBC Tutorial) mentions
that Sybase and Microsoft SQL Server has a MONEY type that is mapped to java.sql.Types.DECIMAL,
and that Microsoft Access has a CURRENCY type that is mapped to java.sql.Types.NUMERIC. 

Seems reasonable to assume that the intention has been that isCurrency should return true
for DECIMAL columns converted from MONEY and for NUMERIC columns converted from CURRENCY.
By this reasoning isCurrency should always return false in Derby where there are no currency
types.

Changing this could have backward compatibility implications I guess.

> Embedded and client differ on ResultSetMetaData.isCurrency() value for DECIMAL and  NUMERIC
columns
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2423
>                 URL: https://issues.apache.org/jira/browse/DERBY-2423
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC, Network Client
>            Reporter: Kathey Marsden
>            Priority: Minor
>              Labels: derby_triage10_11
>
> Embedded returns true for ResultSetMetaData.isCurrency() for DECIMAL and NUMERIC columns.
Client returns false.   I tend to think client is right here but am not sure.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message