if ((type == null) || (type.equalsIgnoreCase(TIMESTAMP_TYPE))) {
if (!(value instanceof java.sql.Timestamp)) {
value = new java.sql.Timestamp(value.getTime());
}
} else if (type.equalsIgnoreCase(TIME_TYPE)) {
if (!(value instanceof java.sql.Time)) {
value = new java.sql.Time(value.getTime());
}
} else if (type.equalsIgnoreCase(DATE_TYPE)) {
if (!(value instanceof java.sql.Date)) {
value = new java.sql.Date(value.getTime());
}
} else {
throw new JspException(
Resources.getMessage("SQL_DATE_PARAM_INVALID_TYPE", type));
}