日期:2014-05-18  浏览次数:20767 次

JSP insert的时候为什么会出现:Data truncation: Data truncated
我在本机执行
sql= "insert   into   buycar(ordernum,fserial,fgoods_cd,buydata,buyid,buyip,buynum,price,fname)values( ' "+spvalues[5].toString()+ " ', ' "+spvalues[0].toString()+ " ', ' "+spvalues[1].toString()+ " ', ' "+spvalues[8].toString()+ " ', ' "+spvalues[6].toString()+ " ', ' "+spvalues[7].toString()+ " ', "+spvalues[3]+ ", "+spvalues[2]+ ", ' "+spvalues[4]+ " ') ";
可以正常插入数据,但是通过局域网的机器访问就不能执行这个语句,而且出现Data   truncation:   Data   truncated

如果换成死的语句,sql= "insert   into   buycar(ordernum,fserial,fgoods_cd,buydata,buyid,buyip,buynum,price,fname)values( '100003 ', 'SDFSD ', 'DFSD ',2009-09-09, 'AAA ', '12312 ',3,333, 'ZZJ ') ";就都可以执行,这是为什么啊?

------解决方案--------------------
某个字段太长了,执行之前System.out.println达出来看看阿