BeanProcessor method processColumn should take SQLXML in consideration
----------------------------------------------------------------------

                 Key: DBUTILS-84
                 URL: https://issues.apache.org/jira/browse/DBUTILS-84
             Project: Commons DbUtils
          Issue Type: Improvement
    Affects Versions: 1.4
         Environment: Windows 7 + IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 
Windows 7 x86-32 jvmwi3260sr9-20110216_75791 (JIT enabled, AOT enabled)
            Reporter: Tiago Cavaleiro
            Priority: Minor




I was experimenting DbUtils and discovered that if the result set contains a 
SQLXML column using the BeanProcessor the returned type will be a String and 
not a java.sql.SQLXML.

Part of the problem is related with the fact the SQL Server driver returns a 
String. 
The call to ResultSet.getObject([SQLXML index]) is returning a String instead 
of the java.sql.SQLXML, but if we call the ResultSet.getSQLXML([SQLXML index]) 
it works as expected.


The correction I've made on the DbUtils was to add the following code:

{code:title=BeanProcess.java|borderStyle=solid}
    protected Object processColumn(ResultSet rs, int index, Class<?> propType)
        throws SQLException {

        (...)
        
        } else if (propType.equals(SQLXML.class)) {
                return rs.getSQLXML(index);
            
        } else {
            return rs.getObject(index);
        }
{code}




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to