Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 31280 invoked from network); 26 Aug 2005 07:02:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Aug 2005 07:02:50 -0000 Received: (qmail 72334 invoked by uid 500); 26 Aug 2005 00:05:13 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 72297 invoked by uid 500); 26 Aug 2005 00:05:12 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 72284 invoked by uid 99); 26 Aug 2005 00:05:12 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2005 17:05:11 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 417B412D for ; Fri, 26 Aug 2005 02:05:10 +0200 (CEST) Message-ID: <719064639.1125014710267.JavaMail.jira@ajax.apache.org> Date: Fri, 26 Aug 2005 02:05:10 +0200 (CEST) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-470) Exception when using LOCALIZEDDISPLAY with JSR169 In-Reply-To: <1612729620.1122317738370.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-470?page=comments#action_12320077 ] Deepa Remesh commented on DERBY-470: ------------------------------------ I think this patch can be applied to 10.1 branch also. I am opening a sub-task to update documentation. > Exception when using LOCALIZEDDISPLAY with JSR169 > ------------------------------------------------- > > Key: DERBY-470 > URL: http://issues.apache.org/jira/browse/DERBY-470 > Project: Derby > Type: Bug > Components: Localization > Environment: IBM's J2ME/CDC/Foundation Profile and JSR169 > Reporter: Deepa Remesh > Assignee: Deepa Remesh > Attachments: derby-470.diff, derby-470.status > > As I did not get any response to my mail, I am opening a JIRA issue for this. > When I run the test i18n/I18NImportExport.java with JSR169 using IBM's J2ME/CDC/Foundation Profile, I get the following exception: > "JAVA ERROR: java.lang.NoSuchMethodError: java/sql/ResultSet.getBigDecimal(II)Ljava/math/BigDecimal;" > In the test, LOCALIZEDDISPLAY is on and the table has a DECIMAL column. This causes the exception. On looking at the code, following is done to format DECIMAL types in LocalizedResource: > if (type == Types.NUMERIC || type == Types.DECIMAL) { > return getNumberAsString(rs.getBigDecimal(columnNumber, rsm.getScale(columnNumber))); > } > where getNumberAsString method does the following: > public String getNumberAsString(Object o){ > if (enableLocalized){ > return formatNumber.format(o, new StringBuffer(), new FieldPosition(0)).toString(); > } > else { > return o.toString(); > } > } > As a solution, I am planning to do the following: > 1. Check for BigDecimal class in the JVM by doing a Class.forName > 2. Call getNumberAsString for NUMERIC and DECIMAL types only if BigDecimal class is available. Otherwise, return rs.getString. > This solution would mean that NUMERIC and DECIMAL types will not be localized in these JVM environments. Please let me know if any comments on this. > Thanks, > Deepa -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira