Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 58094 invoked from network); 22 Dec 2010 19:20:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Dec 2010 19:20:22 -0000 Received: (qmail 7552 invoked by uid 500); 22 Dec 2010 19:20:22 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 7416 invoked by uid 500); 22 Dec 2010 19:20:22 -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: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 7408 invoked by uid 99); 22 Dec 2010 19:20:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Dec 2010 19:20:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Dec 2010 19:20:21 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBMJK1vB024840 for ; Wed, 22 Dec 2010 19:20:01 GMT Message-ID: <598756.274701293045601299.JavaMail.jira@thor> Date: Wed, 22 Dec 2010 14:20:01 -0500 (EST) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4949) Backward, confusing error message when you use the wrong ResultSet.getXXX() method in the client driver In-Reply-To: <5211834.274681293045600898.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-4949: --------------------------------- Attachment: zz.java Attaching zz.java, a program which shows this problem. You may want to edit the program to change the port number of the server. > Backward, confusing error message when you use the wrong ResultSet.getXXX() method in the client driver > ------------------------------------------------------------------------------------------------------- > > Key: DERBY-4949 > URL: https://issues.apache.org/jira/browse/DERBY-4949 > Project: Derby > Issue Type: Bug > Components: Network Client > Affects Versions: 10.8.0.0 > Reporter: Rick Hillegas > Attachments: zz.java > > > If you try to get a Time value out of an INTEGER column, the client driver gives this error. I believe that similar nonsense comes back when you try other mismatched getters on other datatypes: > "An attempt was made to get a data value of type 'java.sql.Types 4' from a data value of type 'java.sql.Time'." > The exception is a java.sql.SQLDataException with SQLState 22005. A better message would be: > "An attempt was made to get a data value of type 'java.sql.Time' from a data value of type INTEGER'." > I recommend two improvements to the utility method which generates these exceptions: > 1) Flip the order of the type names. > 2) Use the ResultSetMetaData to look up the source data type name. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.