commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Kolb <>
Subject Getting a List of Dates from Apache Commons DBUtils
Date Sat, 13 Jun 2015 11:00:26 GMT

I am trying to get a list of dates from a table.

This kind of query works well with Strings and my own POJOs, but for some
reason does not work on java.sql.Date's.

Query :

sql = "select EVENT_DATE TIME from EVENT_TABLE";

EVENT_DATE in EVENT_TABLE is a valid date field.

Java code :

ResultSetHandler<List<java.sql.Date>> h = new
QueryRunner db = new QueryRunner(dataSource,true);
List<java.sql.Date> sqlDates = db.query(sql, h,new
java.sql.Date(from.getTime()),new java.sql.Date(to.getTime()));


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message