resin运行时调用连接池报错!在线等!急急急!!!!!
String str_insert = "INSERT INTO ballot_manager (Name_ballot,Address,option1,value1,option2,value2,option3,"+
"value3,option4,value4,option5,value5,option6,value6,option7,value7,option8,value8,option9,"+"value9,option10,value10,Introduce) VALUE('"+ballotName+"','"+ballotUrl+"','"+option1+"','"+Count1+"','"+option2+"','"+Count2+"','"+option3+"','"+Count3+"','"+option4+"','"+Count4+"','"+option5+"','"+Count5+"','"+option6+"','"+Count6+"','"+option7+"','"+Count7+"','"+option8+"','"+Count8+"','"+option9+"','"+Count9+"','"+option10+"','"+Count10+"','"+introduce+"')";
DbTrans DBSQL;
DBSQL = new DbTrans();
DBSQL.executeUpdate(str_insert);//调用连接池
str_insert语句输出没有问题!!!
运行上面程序段时报错如下:
java.sql.SQLException: Syntax error or access violation, message from
server: "You have an error in your SQL syntax. Check the manual that corresponds
to your MySQL server version for the right syntax to use near 'VALUE('','','','0','','0','','0','','0','','0','','0','','0',''"
at _votee._ballot._ballot_0add__jsp._jspService(/votee/ballot/ballot_add.jsp:71)
第71行就是执行DBSQL.executeUpdate(str_insert);的时候!不知什么原因???高手帮忙!!!!
我的环境配置如下:帮忙看看是不是环境的问题!!!
我用的resin,j2sdk,mysql,windows 2000server
CLASSPASH:E:\j2sdk\lib\dt.jar;E:\j2sdk\lib\tools.jar;E:\resin\lib;E:\resin\lib\log4j-1.2.8.jar
JAVAHOME:E:\j2sdk
path:E:\j2sdk\bin
mysql的驱动放在:E:\resin\lib\jdbc-mysql.jar
在线等急急急!!!!
问题点数:100、回复次数:5Top
1 楼Alicechina(Alice)回复于 2003-09-04 10:25:52 得分 5
试一下把str_insert删掉,DBSQL.executeUpdate();Top
2 楼sunnyshine(光光)回复于 2003-09-04 17:14:53 得分 0
高手们帮忙啊!!!Top
3 楼wdmsyf(BrokenStone)回复于 2003-09-04 20:13:45 得分 45
VALUE 改成 VALUES 试试Top
4 楼sunnyshine(光光)回复于 2003-09-04 20:39:02 得分 0
java.sql.SQLException: Invalid argument value, message from server: "Duplicate
entry '' for key 1"
at _votee._ballot._ballot_0add__jsp._jspService(/votee/ballot/ballot_add.jsp:71)
现在报错如上:
71行,仍然是DBSQL.executeUpdate(str_insert);
顺便问一下,那位有好的连接池可用啊!!!Top
5 楼wordinchina()回复于 2003-09-04 21:39:09 得分 50
)";中的"是不是多余的?Top



