请各位大哥帮帮忙吧,写了一段对数据库的更新代码,代码如下:
<%
String user=request.getParameter("username");
Class.forName(strDBDriver).newInstance();
conn=DriverManager.getConnection(strDBURL,strDBUser,"");
address=new String(address.getBytes("iso-8859-1"),"gb2312");
prepareStmt=conn.prepareStatement("update rights set password=?, email=?,address=? where username='"+user+"'");
String passwd=request.getParameter("password");
prepareStmt.setString(1,"%"+passwd+"%");
String email=request.getParameter("email");
prepareStmt.setString(2,"%"+email+"%");
String address=request.getParameter("address");
prepareStmt.setString(3,"%"+address+"%");
prepareStmt.executeUpdate();
为何老出现这些错误:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /modi.jsp
Generated servlet error:
PrepareStatement cannot be resolved to a type
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
address cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
address cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved
An error occurred at line: 11 in the jsp file: /modi.jsp
Generated servlet error:
prepareStmt cannot be resolved