mysql的Datetime错误~
我用的是mysql5.0
部分代码如下:
String IP = request.getRemoteAddr();
String TotalPrice = request.getParameter( "totalprice ");
long timeInMillis = System.currentTimeMillis();
sqlStr = "insert into orders (orderId,UserId,SubmitTime,ConsignmentTime,TotalPrice,content,IPAddress,IsPayoff,IsSales) values ( ' ";
orderId= " "+timeInMillis; //以系统时间产生位移的订单编号
sqlStr = sqlStr + orderId + " ', ' ";
sqlStr = sqlStr + userid + " ',now(),now()+7, ' ";
sqlStr = sqlStr + TotalPrice + " ', ' ";
sqlStr = sqlStr + dataFormat.toSql(Content) + " ', ' ";
sqlStr = sqlStr + IP + " ',1,1) ";
运行时tomcat窗口提示:
General error:Incorrect datetime value: '20070530231156.000000 'for column 'ConsignmentTime 'at row 1
请问这个问题怎么解决~~~
------解决方案--------------------ADDDATE(now(),7)