<%
String driverName="com.mysql.jdbc.Driver";
String userName="root";
String userPassword="123";
String dbName="test";
String url1="jdbc:mysql://localhost:3306/"+dbName;
String url2="?user="+userName+"&password="+userPassword;
String url3="&useUnicodetrue&characterEncoding=utf-8";
String url=url1+url2+url3;
Class.forName(driverName);
Connection conn=DriverManager.getConnection(url);
request.setCharacterEncoding("utf-8");
String sql="delete from taozi.student where age>=?";
PreparedStatement pstmt=conn.prepareStatement(sql);
pstmt.setInt(1,21);
int n=pstmt.executeUpdate(sql);
if(n>=1){%>success!<%}
else{%>failes!<%}
if(pstmt!=null){pstmt.close();}
if(conn!=null){conn.close();}
%>
就是修改的时候一直显示 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