gpt4 book ai didi

mysql - 我的SQL语句错了吗?

转载 作者:行者123 更新时间:2023-11-29 05:15:27 26 4
gpt4 key购买 nike

<分区>

    theStatement = theConnection.prepareStatement("INSERT INTO `delldb`.`campaigns`"
+ " (`CAMPAIGN_NAME`, `CAMPAIGN_CREATOR`, `CAMPAIGN_TOTALCOST`, `CAMPAIGN_DESC`, `CAMPAIGN_STARTTIME`," // 5
+ " `CAMPAIGN_ENDTIME`, `CAMPAIGN_DATE`, `CAMPAIGN_VENUEADDRESS`, `CAMPAIGN_EST_ATTENDEES`, " // 4 (9)
+ "`CAMPAIGN_MDF_REQUEST`, `CAMPAIGN_REIMBURSEMENT`, " // 2 (11)
+ "`CAMPAIGN_PARTICIPANTS`, `CAMPAIGN_EST_OPPORTUNITIES`, `CAMPAIGN_TECH_PARTNERS`, `CAMPAIGN_EST_REVENUE`, " // 4 (15)
+ "`CAMPAIGN_SOFTWARE_COMPONENT`, `CAMPAIGN_PRODUCTS_DISCUSS`, `CAMPAIGN_TARGET_AUDIENCE`, " // 3 (18)
+ " `CAMPAIGN_SUBMISSIONDATE`, `CAMPAIGN_VENUE_NAME`, `CAMPAIGN_PROGRAMTYPE`, `CAMPAIGN_CONTACT_NAME`, " // 4 (22)
+ " `CAMPAIGN_COMPANY_NAME`, `CAMPAIGN_COMPANY_ADRESS`, `CAMPAIGN_CONTACT_MAIL`, `CAMPAIGN_CONTACT_PHONE`, `CAMPAIGN_SUBMISSION_DATE` " // 5 (27)

+ " VALUES "

+ " (?, ?, ?, ?, ?, ?, ?, ?," // 8
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, " // 9 (17)
+ "?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "); // 10 (27)

theStatement.setString(1, request.getParameter("name"));
theStatement.setString(2, "2");//request.getParameter("CreatorID"));
theStatement.setString(3, request.getParameter("projectedcost"));
theStatement.setString(4, "my description");//request.getParameter("desc"));
theStatement.setString(5, request.getParameter("starttime"));
theStatement.setString(6, request.getParameter("endtime"));
theStatement.setString(7, request.getParameter("programdate"));
theStatement.setString(8, request.getParameter("venueaddress"));
theStatement.setString(9, request.getParameter("estatt"));
theStatement.setString(10, request.getParameter("mdfrequest"));
theStatement.setString(11, request.getParameter("reimbursementmethod"));
theStatement.setString(12, request.getParameter("partners"));
theStatement.setString(13, request.getParameter("opportunities"));
theStatement.setString(14, request.getParameter("partnercontribution"));
theStatement.setString(15, request.getParameter("estimatedrevenue"));
theStatement.setString(16, request.getParameter("softwarecomponent"));
theStatement.setString(17, checkboxproductstodiscuss);
theStatement.setString(18, checkboxtypeprogram);
theStatement.setString(19, request.getParameter("submissiondate"));
theStatement.setString(20, request.getParameter("venuename"));
theStatement.setString(21, checkboxtargetaudience);
theStatement.setString(22, request.getParameter("contactname"));
theStatement.setString(23, request.getParameter("company"));
theStatement.setString(24, request.getParameter("companyadress"));
theStatement.setString(25, request.getParameter("contactemail"));
theStatement.setString(26, request.getParameter("contactphone"));
theStatement.setString(27, request.getParameter("submissiondate"));

我真的找不到问题吗?这条SQL语句有什么问题?帮助将不胜感激。 (它在这种方式之前确实有效)我似乎无法找出错误。

我收到这个错误

javax.servlet.ServletException:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that orresponds to your MySQL server version for the right syntax to use near 'VALUES ('a', '2', '123', 'my description', '12', '13', '2005-11-11', 'ee', '121' at line 1

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com