Skip to content

Commit

Permalink
fixed eric's bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Oct 4, 2007
1 parent 42fdd59 commit cb7a625
Showing 1 changed file with 6 additions and 5 deletions.
@@ -1,9 +1,10 @@
package org.jumpmind.symmetric.load;

import java.sql.Date;
import java.sql.Timestamp;
import java.sql.Types;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -121,19 +122,19 @@ private Object[] filterValues(Column[] metaData, String[] values) {
&& column.isRequired() && column.isOfTextType()) {
objectValue = REQUIRED_FIELD_NULL_SUBSTITUTE;
} else if (value != null && type == Types.DATE) {
objectValue = getDate(value, DATE_PATTERNS);
objectValue = new Date(getTime(value, DATE_PATTERNS));
} else if (value != null && type == Types.TIMESTAMP) {
objectValue = getDate(value, TIMESTAMP_PATTERNS);
objectValue = new Timestamp(getTime(value, TIMESTAMP_PATTERNS));
}
list.add(objectValue);
}
}
return list.toArray();
}

private Date getDate(String value, String[] pattern) {
private long getTime(String value, String[] pattern) {
try {
return DateUtils.parseDate(value, pattern);
return DateUtils.parseDate(value, pattern).getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit cb7a625

Please sign in to comment.