View Javadoc

1   package com.diasparsoftware.jdbc;
2   
3   import java.sql.*;
4   import java.util.Date;
5   
6   
7   
8   public class JdbcMapper {
9   
10      /***
11       * A potentially safer version of ResultSet#getDate
12       * which answers a timestamp at noon on the day in
13       * question.
14       * 
15       * @param resultSet
16       * @param columnName
17       * @return
18       * @throws SQLException
19       */
20      public Date getDate(ResultSet resultSet, String columnName) throws SQLException {
21              
22          return JdbcUtil.toJavaUtilDate(
23              resultSet.getTimestamp(columnName));
24      }
25  
26  }