| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 583 人关注过本帖
标题:数据库更新问题
只看楼主 加入收藏
glorysea
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-10-27
收藏
 问题点数:0 回复次数:3 
数据库更新问题

请各位大哥帮帮忙吧,写了一段对数据库的更新代码,代码如下:
<%
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
suncf1985
Rank: 2
等 级:论坛游民
威 望:1
帖 子:158
专家分:35
注 册:2007-10-11
收藏
得分:0 
你的百分号是干什么的.....

是通配符吗????

以后:独自享受着快乐、品味着孤独、体会着没有回忆的回忆....
2007-11-05 13:08
sea7
Rank: 2
等 级:新手上路
威 望:3
帖 子:291
专家分:0
注 册:2007-2-17
收藏
得分:0 
两个问题:
1.address没有定义
2. prepareStmt的包没有导入

软件是一种修养
2007-11-07 22:14
DasayHaoEr
Rank: 1
等 级:新手上路
帖 子:82
专家分:0
注 册:2007-11-6
收藏
得分:0 
楼主怎么没有回复到底是不是这样呢?
2007-11-08 16:43
快速回复:数据库更新问题
数据加载中...
 
   



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

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