ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Undefined Column Name Exception in Implicit Map
Date Wed, 27 Feb 2008 13:43:57 GMT
I think that this affects the aliasing of columns, which would be bad
IMHO. But the javadoc of getColumnLabel says:


"Gets the designated column's suggested title for use in printouts and


This would mean that it's perfectly valid to call getColumnName, maybe
someone with more JDBC spec knowledge can comment on this.




From: Rikki Bindra [mailto:rikki.bindra@tcs.com] 
Sent: Wednesday, February 27, 2008 12:04 PM
To: user-java@ibatis.apache.org
Subject: Undefined Column Name Exception in Implicit Map



I am using the jt400.jar as the JDBC Driver for accessing data from DB2
database on AS400. The problem is that I want to use implicit resultmap

<select id="getProductCount" resultClass="java.util.HashMap">
select * from PRODUCT

However, the problem is that while populating the HashMap, I have
noticed that the class
"com.ibatis.sqlmap.engine.mapping.result.AutoResultMap" uses method
getColumnLabel() on ResultSetMetaData
My JDBC driver returns the label of the column (containing spaces and
which is different than the column name in database). Now the code fails
reporting the exception that "Invalid Column Name" has been specified.
The problem is in the class
"com.ibatis.sqlmap.engine.mapping.result.AutoResultMap" as it should be
calling getColumnName() instead of getColumnLabel() on ResultSetMetaData
to get the names of the columns.

Please look this ASAP and confirm if changing the method call from
getColumnLabel() to getColumnName(), can affect in what manner.. I have
tried this and it works for me. However, I want to know the unknown
implications that it might have. 

Thanks & Regards,
Rikki Bindra
Tata Consultancy Services
C - 56, Phase 2
Dist. Gautam Budh Nagar
Noida - 201305,Uttar Pradesh
Mailto: rikki.bindra@tcs.com
Website: http://www.tcs.com
Experience certainty.        IT Services
                       Business Solutions

Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

View raw message