日期:2014-05-18  浏览次数:20783 次

一个JSP小程序,不知道是哪里出错了,请大家帮帮忙~~
报错内容:
org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP

An   error   occurred   at   line:   2   in   the   jsp   file:   /addke.jsp
Generated   servlet   error:
Int   cannot   be   resolved   or   is   not   a   type

An   error   occurred   at   line:   2   in   the   jsp   file:   /addke.jsp
Generated   servlet   error:
Incompatible   operand   types   ResultSet   and   int

An   error   occurred   at   line:   2   in   the   jsp   file:   /addke.jsp
Generated   servlet   error:
rs   cannot   be   resolved

An   error   occurred   at   line:   2   in   the   jsp   file:   /addke.jsp
Generated   servlet   error:
rs   cannot   be   resolved

这是我的程序:

<%@   page   contentType= "text/html;charset=gb2312 "   import= "java.sql.* "   import= "java.lang.* "   import= "java.util.* "%>
<%
request.setCharacterEncoding( "GBK ");
String   lldept=request.getParameter( "ldept ");
String   lltype=request.getParameter( "ltype ");
String   llname=request.getParameter( "lname ");
String   llnum=request.getParameter( "lnum ");
Int   llmark=request.getParameter( "lmark ");
String   submit=request.getParameter( "submit ");

if(submit.equals( "增加 "))
{

try{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");     //注册驱动程序  
Connection   conn   =   DriverManager.getConnection( "jdbc:odbc:quincy ", "sa ", "sa ");    
Statement   stmt   =   conn.createStatement();
String   sql   =   "insert   into   lesson(lname,lmark)   values( ' "+llname+ " ', ' "+llmark+ " ') ";
ResultSet   rs=stmt.executeQuery(sql);
if(rs==1){
out.print( " <td> "   +   rs.getString( "ldept ")+ " </td> ");
                        out.print( " <td> "   +   rs.getString( "ltype ")+ " </td> ");
                          out.print( " <td> "   +   rs.getString( "lname ")+ " </td> ");
                            out.print( " <td> "   +   rs.getString( "lnum ")+ " </td> ");
                        out.print( " <td> "   +   rs.getInt( "lmark ")+ " </td> ");
out.println( " <a   href= 'manager1.html '> 返回登录页面 </a> ");
}else{}
rs.close();
stmt.close();
conn.close();
       
}
catch(