删掉这行:
Timestamp stamp = DateConventer.strWithtimeToTimestamp("2009-02-07 12:10:30");
改成
String stamp = "2009-02-07 12:10:30";
然后把:
String executeSql = "insert into TB_Tickets (TicketID,TicketName," +
"StadiumID,Price,Descn,BeginTime) values("+"seq_mp.nextval"+",?,?,?,?,"
+stamp+")";
改成:
String executeSql = "insert into TB_Tickets (TicketID,TicketName,"
+ "StadiumID,Price,Descn,BeginTime) values(" + "seq_mp.nextval"
+ ",?,?,?,?,to_date('" + stamp + "','yyyy-mm-dd hh24:mi:ss'))";
就可以了,试试看
按照你补充为题所说的,那你就需要使用PreparedStatement进行数据加载:
imestamp stamp = DateConventer.strWithtimeToTimestamp("2009-02-07 12:10:30");
String executeSql =".....";
PreparedStatement.setTimestamp(parameterIndex,Timestamp)
使用java.util.Date类