Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 81727 invoked from network); 8 Jul 2005 02:59:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Jul 2005 02:59:39 -0000 Received: (qmail 54674 invoked by uid 500); 8 Jul 2005 02:59:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54557 invoked by uid 500); 8 Jul 2005 02:59:27 -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 54515 invoked by uid 99); 8 Jul 2005 02:59:27 -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, 07 Jul 2005 19:59:15 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 778DF16 for ; Fri, 8 Jul 2005 04:59:12 +0200 (CEST) Message-ID: <1923075626.1120791552488.JavaMail.jira@ajax.apache.org> Date: Fri, 8 Jul 2005 04:59:12 +0200 (CEST) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-447) getBoolean() throws data conversion exception for DECIMAL type in J2ME/CDC/Foundation In-Reply-To: <410167760.1120771997577.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-447?page=all ] Deepa Remesh updated DERBY-447: ------------------------------- Attachment: derby-447.diff This patch implements getBoolean() method in BigIntegerDecimal, which is the class used for DECIMAL support in J2ME/CDC/Foundation. The method returns false for zero or null values and true for all other values. Here is the method implementation: // 0 or null is false, all else is true public boolean getBoolean() { String bigDecimalString = getString(); if(bigDecimalString == null) return false; BigInteger bi = new BigInteger(data2c); return bi.compareTo(java.math.BigInteger.ZERO) != 0; } I ran the test jdbcapi/resultset.java using IBM WCTME5.7 Foundation profile. Before the change the output file resultset.out had the following output for calls to getBoolean() for DECIMAL values: getBoolean(10) got exception Data Conversion SQLException getBoolean(dc) got exception Data Conversion SQLException After the change, getBoolean() for DECIMAL value does not throw data conversion exception. The output file now has: getBoolean(10): true getBoolean(dc): true To verify that the getBoolean() method returns the right value, I also tested using the following DECIMAL values (-10.1, 0, -0, 0.00, -0.00, null). Note: The test jdbcapi/resultset.java is currently excluded for J2ME/Foundation. The following line "runwithfoundation=false" in resultset_app.properties has to be commented to be able to run the test. Also, the test will not be successful because of other BigDecimal methods. So the specific lines in output has to be checked in resultset.out. I am working on a test wrapper to make the test work in J2ME/Foundation and will submit this in a separate task. Please review this patch and commit it. Thanks, Deepa > getBoolean() throws data conversion exception for DECIMAL type in J2ME/CDC/Foundation > ------------------------------------------------------------------------------------- > > Key: DERBY-447 > URL: http://issues.apache.org/jira/browse/DERBY-447 > Project: Derby > Type: Bug > Components: JDBC > Reporter: Deepa Remesh > Assignee: Deepa Remesh > Attachments: derby-447.diff > > The call to the ResultSet method getBoolean() for a DECIMAL value throws data conversion exception with J2ME/CDC/Foundation. The class BigIntegerDecimal, which is used for DECIMAL support in J2ME/CDC/Foundation, does not override the getBoolean() method from the class DataType. The getBoolean() method in DataType simply throws a data conversion exception. -- 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