01: package com.ibatis.sqlmap.engine.type;
02:
03: import com.ibatis.sqlmap.client.SqlMapException;
04:
05: import java.text.ParseException;
06: import java.text.SimpleDateFormat;
07: import java.util.Date;
08:
09: public class SimpleDateFormatter {
10: public static Date format(String format, String datetime) {
11: try {
12: return new SimpleDateFormat(format).parse(datetime);
13: } catch (ParseException e) {
14: throw new SqlMapException(
15: "Error parsing default null value date. Format must be '"
16: + format + "'. Cause: " + e);
17: }
18: }
19:
20: }
|