public Date getDate(String parameterName) throws SQLException { return DataTypeTransformer.getDate(getObject(parameterName)); }
public Date getDate(String parameterName) throws SQLException { return DataTypeTransformer.getDate(getObject(parameterName)); }
private java.sql.Date getDate(Calendar cal, Object val) throws SQLException { Date value = DataTypeTransformer.getDate(val); if (value == null) { return null; } if (cal != null) { value = TimestampWithTimezone.createDate(value, getDefaultCalendar().getTimeZone(), cal); } return value; }
private java.sql.Date getDate(Calendar cal, Object val) throws SQLException { Date value = DataTypeTransformer.getDate(val); if (value == null) { return null; } if (cal != null) { value = TimestampWithTimezone.createDate(value, getDefaultCalendar().getTimeZone(), cal); } return value; }
/** * This method will return the value in the current row as a Date object. * This will use the timeZone info of the calendar object. * * @param The * index of the column whose value needs to be fetched. * @param Calender * object used to get the date value. * @return The value of the column as a Date object. * @throws SQLException * if a results access error occurs or transform fails. */ public Date getDate(int columnIndex, Calendar cal) throws SQLException { Date value = DataTypeTransformer.getDate(getObject(columnIndex)); if (value != null && cal != null) { value = TimestampWithTimezone.createDate(value, getDefaultCalendar().getTimeZone(), cal); } return value; }
/** * This method will return the value in the current row as a Date object. * This will use the timeZone info of the calendar object. * * @param The * index of the column whose value needs to be fetched. * @param Calender * object used to get the date value. * @return The value of the column as a Date object. * @throws SQLException * if a results access error occurs or transform fails. */ public Date getDate(int columnIndex, Calendar cal) throws SQLException { Date value = DataTypeTransformer.getDate(getObject(columnIndex)); if (value != null && cal != null) { value = TimestampWithTimezone.createDate(value, getDefaultCalendar().getTimeZone(), cal); } return value; }
@Test public void testInvalidTransformation() throws Exception { try { DataTypeTransformer.getDate(Integer.valueOf(1)); fail("exception expected"); //$NON-NLS-1$ } catch (SQLException e) { assertEquals("Unable to transform the column value 1 to a Date.", e.getMessage()); //$NON-NLS-1$ } }
break; case DataTypeManager.DefaultTypeCodes.DATE: targetObject = DataTypeTransformer.getDate(value); break; case DataTypeManager.DefaultTypeCodes.TIME:
break; case DataTypeManager.DefaultTypeCodes.DATE: targetObject = DataTypeTransformer.getDate(value); break; case DataTypeManager.DefaultTypeCodes.TIME: