Unable to compile class for JSP:谁能告诉我什么问题啊,在线等!急啊!!!!

org.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerroroccurredatline:21... org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 21 in the jsp file: /login.jsp
rs cannot be resolved
18: if(aa!=null&&aa.equals("login")){
19: String s_userid=request.getParameter("userid");
20: String s_password=request.getParameter("password");
21: rs=stmt.executeQuery("select * from userinfo where userid='"+s_userid+"' and password='"+s_password+"'");
22: if(rs.next()){
23: session.setAttribute("userid",s_userid);
24: response.sendRedirect("index.jsp");

An error occurred at line: 21 in the jsp file: /login.jsp
stmt cannot be resolved
18: if(aa!=null&&aa.equals("login")){
19: String s_userid=request.getParameter("userid");
20: String s_password=request.getParameter("password");
21: rs=stmt.executeQuery("select * from userinfo where userid='"+s_userid+"' and password='"+s_password+"'");
22: if(rs.next()){
23: session.setAttribute("userid",s_userid);
24: response.sendRedirect("index.jsp");

An error occurred at line: 22 in the jsp file: /login.jsp
rs cannot be resolved
19: String s_userid=request.getParameter("userid");
20: String s_password=request.getParameter("password");
21: rs=stmt.executeQuery("select * from userinfo where userid='"+s_userid+"' and password='"+s_password+"'");
22: if(rs.next()){
23: session.setAttribute("userid",s_userid);
24: response.sendRedirect("index.jsp");
25: }

An error occurred at line: 49 in the jsp file: /shoppingcart.jsp
cbean.productid cannot be resolved or is not a field
46: d_totalamount+=cbean.subtotal;
47: %>
48: <tr>
49: <td height="19"><a href="bookdetail.jsp?productid=<%=cbean.productid%>" target="_blank"><%=cbean.productid%></a></td>
50: <td><%=cbean.productname%></td>
51: <td><%=cbean.publish%></td>
52: <td>¥<%=cbean.unitprice%></td>
An error occurred at line: 49 in the jsp file: /shoppingcart.jsp
cbean.productid cannot be resolved or is not a field
46: d_totalamount+=cbean.subtotal;
47: %>
48: <tr>
49: <td height="19"><a href="bookdetail.jsp?productid=<%=cbean.productid%>" target="_blank"><%=cbean.productid%></a></td>
50: <td><%=cbean.productname%></td>
51: <td><%=cbean.publish%></td>
52: <td>¥<%=cbean.unitprice%></td>

An error occurred at line: 50 in the jsp file: /shoppingcart.jsp
cbean.productname cannot be resolved or is not a field
47: %>
48: <tr>
49: <td height="19"><a href="bookdetail.jsp?productid=<%=cbean.productid%>" target="_blank"><%=cbean.productid%></a></td>
50: <td><%=cbean.productname%></td>
51: <td><%=cbean.publish%></td>
52: <td>¥<%=cbean.unitprice%></td>
53: <td><input type="text" class="formtext" value="<%=cbean.ordernum%>" size="5" readonly> 
展开
 我来答
yananzx2011
2011-06-07
知道答主
回答量:6
采纳率:0%
帮助的人:0
展开全部
操作数据库的步骤:
public class TestMain {
private static final String DRIVERNAME="com.microsoft.sqlserver.jdbc.SQLServerDriver";
private static final String URL="jdbc:sqlserver://localhost:1433;DatabaseName=test1";
private static final String USERNAME="sa";
private static final String PASSWORD="123@qwe";
public static Connection getCon(){
Connection conn=null;
try {
Class.forName(DRIVERNAME);
conn=DriverManager.getConnection(URL, USERNAME, PASSWORD);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public static void main(String[] args){
Connection conn=getCon();
PreparedStatement ps=conn.prepareStatement(sql);//写你的sql语句
ResultSet rs=ps.executeQuery();
//用rs读取数据
}
威孚半导体技术
2024-08-19 广告
威孚(苏州)半导体技术有限公司是一家专注生产、研发、销售晶圆传输设备整机模块(EFEM/SORTER)及核心零部件的高科技半导体公司。公司核心团队均拥有多年半导体行业从业经验,其中技术团队成员博士、硕士学历占比80%以上,依托丰富的软件底层... 点击进入详情页
本回答由威孚半导体技术提供
oolgloo
2011-06-04 · TA获得超过2636个赞
知道小有建树答主
回答量:604
采纳率:0%
帮助的人:652万
展开全部
rs类型是什么!你不说编译器怎么知道!
加上:
ResultSet rs = ...
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式