org.apache.jasper.JasperException: javax.servlet.ServletException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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 '' at line 1
PreparedStatement st=conn.prepareStatement("insert into products (pname,pfl,pb,pdes,price)values('"+pname+"','"+pfl+"','"+pb+"','"+pdes+"',"+price+")");
int i=st.executeUpdate(); //老是说这句有错误!!!
PreparedStatement st=conn.prepareStatement("insert into products (pname,pfl,pb,pdes,price)values('"+pname+"','"+pfl+"','"+pb+"','"+pdes+"',"+price+")");
int i=st.executeUpdate(); //老是说这句有错误!!!
qq 1543150073 互相学习
PreparedStatement st=conn.prepareStatement(s);
int i=st.executeUpdate();这个代码有问题的 实在不好意思~~~
对不起发错了 上面代码是正确的String s="update products set 'pname="+pname+"','pfl="+pfl+"','pb="+pb+"','pdes="+pdes+"',price="+price+" where id="+id;
PreparedStatement st=conn.prepareStatement(s);
int i=st.executeUpdate();