SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
java.util.Date date = sdf.parse("2004-07-24 09:45:52.189");
java.sql.Timestamp timestamp = new java.sql.Timestamp(date.getTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
try{
String samplingTime = data.getSAMPLINGTIME();
java.util.Date date = sdf.parse(samplingTime);
java.sql.Timestamp timestamp = new java.sql.Timestamp(date.getTime());
pstmt.setTimestamp(2, timestamp);
}catch(Exception ex){
log.error(ex.getMessage());
}
SimpleDateFormt 에서 parse 사용사 try문 안에 적어줘야됩니다~~