type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 134 in the jsp file: /OrganizeProduct.jsp
Generated servlet error:
D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\anine\org\apache\jsp\OrganizeProduct_jsp.java:197: ';' expected
^
1 error org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.代码如下
 <% 
   String na=request.getParameter("bh");
          if(na==null)
            {na=""; }
String driverName="com.mysql.jdbc.Driver"; 
String userName="root"; //数据库用户名
String userPasswd="19851017";//密码
String dbName="anine";//数据库名
String tableName="organize";//表名
String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017; //联结字符串
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection=DriverManager.getConnection(url);
Statement statement = connection.createStatement();

   try {
   ResultSet rs=statement.executeQuery("SELECT * FROM organize WHERE Item_no = '"+na+"'")       while(rs.next())
           {   
  String Item_no1=rs.getString(1);
String Type=rs.getString(2);
String Available_color=rs.getString(3);
String Product_info1=rs.getString(4);
ResultSetMetaData rmeta = rs.getMetaData();//获得数据结果集合
int numColumns=rmeta.getColumnCount();
 %>
。。
     <%
    }
    rs.close();
statement.close();connection.close();     }
    catch(SQLException event)
     { }
%>

解决方案 »

  1.   

    try{ 后面一行没有分号啊。 出错提示里面很清楚的指出来了。
    需要提高空间,店铺等访问量的请看-- http://www.TheseTags.com
      

  2.   

    我加上;了,又出来错误了
    type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 134 in the jsp file: /OrganizeProduct.jsp
    Generated servlet error:
    D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\anine\org\apache\jsp\OrganizeProduct_jsp.java:188: cannot resolve symbol
    symbol  : variable anine 
    location: class org.apache.jsp.OrganizeProduct_jsp
    An error occurred at line: 134 in the jsp file: /OrganizeProduct.jsp
    Generated servlet error:
    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017; //脕陋陆谩脳脰路没麓庐
                                         ^
    An error occurred at line: 134 in the jsp file: /OrganizeProduct.jsp
    Generated servlet error:
    D:\jakarta-tomcat-5.0.28\work\Catalina\localhost\anine\org\apache\jsp\OrganizeProduct_jsp.java:188: cannot resolve symbol
    symbol  : variable root 
    location: class org.apache.jsp.OrganizeProduct_jsp
    An error occurred at line: 134 in the jsp file: /OrganizeProduct.jsp
    Generated servlet error:
    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017; //脕陋陆谩脳脰路没麓庐
                                                        ^
    2 errors org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
      

  3.   

    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017;
    你看看觉得这样对吗最后那个数那么写能对吗?
      

  4.   

    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017;
    掉了双引号
    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password=19851017";
      

  5.   

    建议好好打打基础。
    提示 symbol  : variable anine  等
    你的anine是变量吗?不是变量怎么能这样用?这个只是你想付的值而已。
    诸如root,19851017等也是一样的。
    需要提高空间,店铺等访问量的请看-- http://www.TheseTags.com
      

  6.   

    你上面不是定义了
    String userName="root"; //数据库用户名
    String userPasswd="19851017";//密码
    String dbName="anine";//数据库名
    String tableName="organize";//表名
    url中应该使用变量了啊,改为
    String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd;
      

  7.   

    说下,我原来是用sql的,mysql是昨天现学的。不好意思。老板要在月底之前交工,麻烦大家耐心指点
      

  8.   

    你出错的原因就是这个,你原先写的
    String url="jdbc:mysql://localhost/"+anine+"?user="+root+"&password="+19851017;
    anine和root都没有声明啊
      

  9.   

    String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd"";
    正解
      

  10.   

    晕,这回改完了,是不报错了,但是没有从数据库里读出任何东西,页面上什么都没有。
    图片在我的相册里http://photo.163.com/photos/xwqlitchi/137293931/
      

  11.   

    你在sql的地方设断点调试一下,把sql语句直接到库中执行一下看看能不能查到内容
      

  12.   

    好,我试试,bh应该过来了啊,
    大家看看
    这是上个页面的代码
    <a href="OrganizeProduct.jsp?bh=RPT60855"><img src="image312/organize/RPT60855.jpg" width="100" height="100" border="0"></a>
    这是下个页面的代码 <% 
       String na=request.getParameter("bh");
              if(na==null)
                {na=""; }
    String driverName="com.mysql.jdbc.Driver"; 
    String userName="root"; //数据库用户名
    String userPasswd="19851017";//密码
    String dbName="anine";//数据库名
    String tableName="organize";//表名
    String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd; //联结字符串
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection connection=DriverManager.getConnection(url);
    Statement statement = connection.createStatement();
       try {
       ResultSet rs=statement.executeQuery("SELECT * FROM organize WHERE Item_no = '"+na+"'");       while(rs.next())
               {   
      String Item_no1=rs.getString(1);
    String Type=rs.getString(2);
    String Available_color=rs.getString(3);
    String Product_info1=rs.getString(4);
    String Service=rs.getString(5);
    String Size=rs.getString(6);
    String Sheet=rs.getString(7);
    String Package=rs.getString(8);
    String Cover_material=rs.getString(9);
    String Cnt_size=rs.getString(10);
    String Gw=rs.getString(11);
    String Small_picture=rs.getString(12);
    String Middle_picture=rs.getString(13);
    String Larger_picture=rs.getString(14);
    String Corner_picture=rs.getString(15);
    String Edge_picture=rs.getString(16);
    ResultSetMetaData rmeta = rs.getMetaData();//获得数据结果集合
    int numColumns=rmeta.getColumnCount();
     %>
    。。
         <%
        }
        rs.close();
    statement.close();connection.close();     }
        catch(SQLException event)
         { }
    %>
      

  13.   

    你的URL里的localhost后面应该是“:”而不应该是“/”吧
      

  14.   

    String   url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd;   //联结字符串 这个引号放错了,放后一格;