I am using apache dbutils. I have an object with a java.util.Date attribute in it. When I execute the following code, it fails for the sql
select name, startDate from myTable
try {
QueryRunner run ;
run = new QueryRunner();
ResultSetHandler h = new BeanListHandler(clazz);
ArrayList<T> result ;
result = (ArrayList) run.query(connection, sql, h);
return result;
} catch (SQLException ex) {
Logger.getLogger(AbstractDataMapper.class.getName()).log(Level.SEVERE, null, ex);
throw new AppException("Sql fetch failed for: " + sql,ex);
}
}
I looked at the code and found out that BeanProcessor, processColumn is going through all the properties with the exception of Date. For Date, it is calling rs.getObject(index). This, acc to my debugger returns string and causes the set to fail. Any ideas?
Change driver? I am using jtds 1.2.5. Is it supposed to return Date for getObject method?