/** * Retrieves the value of the designated column in the current row * of this <code>ResultSet</code> object as * a <code>java.sql.Date</code> in the Java programming language. * * @param pos the parameter index in the result set * @param timezone the calendar providing the timezone configuration * @param mapNull true if 1.1.1970 should be mapped to null * @return the column value; if the value is SQL <code>NULL</code>, the * value returned is <code>null</code> */ public Date getDate(int pos, Calendar timezone, boolean mapNull) { try { java.sql.Date date = timezone == null ? resources.rs.getDate(pos + columnOffset) : resources.rs.getDate(pos + columnOffset, timezone); if (date == null || (mapNull && date.equals(DateHelper.MIN_DATE))) { // mindate is translated back to null return null; } return Date.createFrozen(date.getTime()); } catch (SQLException e) { throw new PersistenceException(resources.db, e); } }
/** * Retrieves the value of the designated column in the current row * of this <code>ResultSet</code> object as * a <code>java.sql.Date</code> in the Java programming language. * * @param name the label for the column specified with the SQL AS clause. * If the SQL AS clause was not specified, then the label is the name of the column * @param timezone the calendar providing the timezone configuration * @param mapNull true if 1.1.1970 should be mapped to null * @return the column value; if the value is SQL <code>NULL</code>, the * value returned is <code>null</code> */ public Date getDate(String name, Calendar timezone, boolean mapNull) { try { java.sql.Date date = timezone == null ? resources.rs.getDate(name) : resources.rs.getDate(name, timezone); if (date == null || (mapNull && date.equals(DateHelper.MIN_DATE))) { // mindate is translated back to null return null; } return Date.createFrozen(date.getTime()); } catch (SQLException e) { throw new PersistenceException(resources.db, e); } }
/** * Retrieves the value of the designated column in the current row * of this <code>ResultSet</code> object as * a <code>java.sql.Date</code> in the Java programming language. * * @param timezone the calendar providing the timezone configuration * @param mapNull true if 1.1.1970 should be mapped to null * @return the column value; if the value is SQL <code>NULL</code>, the * value returned is <code>null</code> */ public Date getDate(Calendar timezone, boolean mapNull) { try { int pos = nextConfiguredIndex(); java.sql.Date date = timezone == null ? resources.rs.getDate(pos + columnOffset) : resources.rs.getDate(pos + columnOffset, timezone); if (date == null || (mapNull && date.equals(DateHelper.MIN_DATE))) { // mindate is translated back to null return null; } return Date.createFrozen(date.getTime()); } catch (SQLException e) { throw new PersistenceException(resources.db, e); } }