标题:数据库更新问题
取消只看楼主
glorysea
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-10-27
 问题点数:0 回复次数:0 
数据库更新问题

请各位大哥帮帮忙吧,写了一段对数据库的更新代码,代码如下:
<%
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


搜索更多相关主题的帖子: 数据库 
2007-11-05 09:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-183539-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016146 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved