去掉<%@ page import="sun.jdbc.odbc.JdbcOdbcDriver.*" %>

解决方案 »

  1.   

    hehe还是不行。不过为什要把这一行去掉呢?
      

  2.   

    最好不要返回记录集类型的数据;
    你可以在bean里将数据条数计算出来,然后通过返回整型数值的方法得到数据条数。
      

  3.   

    改代码如下,经测试可行
    <%
    java.lang.String strSQL;
    int intRowCount;
    strSQL = "select count(*) as A from table1  "; 
    ResultSet rs = DBconn1.executeQuery(strSQL); 
    while (rs.next()) {
    allCol = intRowCount.getInt("A"); 
    }
    %>
      

  4.   

    错了,抱歉改代码如下,经测试可行
    <%
    java.lang.String strSQL;
    int intRowCount;
    strSQL = "select count(*) as A from table1  "; 
    ResultSet rs = DBconn1.executeQuery(strSQL); 
    while (rs.next()) {
    intRowCount= rs.getInt("A"); 
    }
    %>
      

  5.   

    <jsp:useBean id="DBconn1" class="DBconn" scope="request"/>
    <jsp:setProperty name="DBconn" property="*"/>
    上面这两句话有误:
    第二句中name="DBconn" 是不是该为"DBconn1"