Code example for SimpleDateFormat

Methods: parse, setTimeZone

0
        if (obj == null) {
            d = null;
        } else if (obj instanceof Date) {
            d = (Date) obj;
        } else { 
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
            dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
            try { 
                d = dateFormat.parse(obj.toString());
            } 
            catch (ParseException exc) {
                throw new TypeMismatchStorageException(Date.class.getName(), obj.getClass().getName(), column);
            } 
        } 
        return d;
    } 
 
 
    @Override 
    public Short getShortObject(String columnName)
    {