Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 59597 invoked from network); 5 Apr 2009 07:07:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2009 07:07:34 -0000 Received: (qmail 26339 invoked by uid 500); 5 Apr 2009 07:07:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 26233 invoked by uid 500); 5 Apr 2009 07:07:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 26223 invoked by uid 99); 5 Apr 2009 07:07:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 07:07:33 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 07:07:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E1CB8234C003 for ; Sun, 5 Apr 2009 00:07:12 -0700 (PDT) Message-ID: <688877576.1238915232910.JavaMail.jira@brutus> Date: Sun, 5 Apr 2009 00:07:12 -0700 (PDT) From: "Viral (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (BEANUTILS-344) Method createDynaProperty of JDBCDynaClass should first look for column label instead of column name in ResultSetMetadata object.. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Method createDynaProperty of JDBCDynaClass should first look for column label instead of column name in ResultSetMetadata object.. ---------------------------------------------------------------------------------------------------------------------------------- Key: BEANUTILS-344 URL: https://issues.apache.org/jira/browse/BEANUTILS-344 Project: Commons BeanUtils Issue Type: Bug Components: DynaBean Affects Versions: 1.8.0-BETA Reporter: Viral Fix For: 1.8.0-BETA Method *createDynaProperty( ResultSetMetaData metadata, int i)* of class *JDBCDynaClass* should read *column label* instead of *column name* from ResultSetMetadata object. For example.. If query is something like *'select user_id as userId, user_name as userName....'* than *columName* variable should have the value *userId* instead of *user_id* Fix is .. *Original* {code:title=JDBCDynaClass.java|borderStyle=solid} protected DynaProperty createDynaProperty( ResultSetMetaData metadata, int i) throws SQLException { //This is reading ColumnName but not ColumnLabel which returns value 'user_id' ..not 'userId' String columnName = metadata.getColumnName(i); ... ... ... } {code} *It should be like following* {code:title=JDBCDynaClass.java|borderStyle=solid} protected DynaProperty createDynaProperty( ResultSetMetaData metadata, int i) throws SQLException { //First read ColumnLabel ..which sould be 'userId' in our case String columnName = metadata.getColumnLabel(i); // If ColumnLabel is 'null' or 'empty' read ColumnName... if(columnName == null || columnName.trim().equals("")) { columnName = metadata.getColumnName(i); } ... ... ... {code} Let me know if this is not how it suppose to be or I am missing something here. Thanks, Viral Patel -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.