/** * Returns the value of the specified column as a java.sql.Timestamp using a * specified time zone. * * @param columnIndex (1,2,...) * @param calendar the calendar * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public Timestamp getTimestamp(int columnIndex, Calendar calendar) throws SQLException { try { if (isDebugEnabled()) { debugCode("getTimestamp(" + columnIndex + ", calendar)"); } Value value = get(columnIndex); return DateTimeUtils.convertTimestamp(value, calendar); } catch (Exception e) { throw logAndConvert(e); } }
/** * Returns the value of the specified column as a java.sql.Timestamp. * * @param columnLabel the column label * @param calendar the calendar * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public Timestamp getTimestamp(String columnLabel, Calendar calendar) throws SQLException { try { if (isDebugEnabled()) { debugCode("getTimestamp(" + StringUtils.quoteJavaString(columnLabel) + ", calendar)"); } Value value = get(columnLabel); return DateTimeUtils.convertTimestamp(value, calendar); } catch (Exception e) { throw logAndConvert(e); } }
/** * Sets the timestamp using a specified time zone. The value will be * converted to the local time zone. * * @param parameterIndex the parameter index (1, 2, ...) * @param x the value * @param calendar the calendar * @throws SQLException if this object is closed */ @Override public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar calendar) throws SQLException { try { if (isDebugEnabled()) { debugCode("setTimestamp(" + parameterIndex + ", " + quoteTimestamp(x) + ", calendar);"); } if (x == null) { setParameter(parameterIndex, ValueNull.INSTANCE); } else { setParameter(parameterIndex, DateTimeUtils.convertTimestamp(x, calendar)); } } catch (Exception e) { throw logAndConvert(e); } }