你在jsp中是否引入了dbconn所在的包?
估计你是没有引入.
或者你userBean也可以.

解决方案 »

  1.   

    引用了啊
    <%@ page import = "nona.db.dbconn" %>
    <jsp:useBean id="DbConn" class="nona.db.dbconn" scope="session"/>
    <jsp:setProperty name="DbConn" property="*"/>
    我把rs1.getString(1)去掉就没错了,估计是rs有问题
      

  2.   

    you'd better use static
    public static Connection conn;and then close conn after calling
      

  3.   

    public static Connection conn;一样不管用
      

  4.   

    把你的jsp文件改成这样试一下。
    <%  String username=request.getParameter("username");
      String pws=request.getParameter("pws");
      String sql="select * from duser where (f11='"+username+"')"+" and (f19='"+pws+"')";
      DbConn.getconnection();
      ResultSet rs1=DbConn.selectSQL(sql);
      while(rs1.next()){
        rs1.getString(1);
      }%>
      

  5.   

    public Vector runSQLQuery(String strSQL)
    {
     java.sql.ResultSet rs = null;
     java.util.Vector vResult = null;
     try
     {
        Statement stmt=conn.createStatement(  ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        rs = stmt.executeQuery(strSQL);    int columnCount = rs.getMetaData().getColumnCount();
        vResult = new Vector();    while(rs.next())
        {
    java.util.Vector vTemp = new Vector();
    for(int i = 0;i< columnCount;i++)
    {
     String sTemp = rs.getString(i+1);
     vTemp.addElement(sTemp== null ? "" : Global.transOut(sTemp.trim()));
    } vResult.addElement(vTemp);
        }    rs.close(); }
     catch(SQLException e1)
     { }
     finally
     {
     }return vResult;}
      

  6.   

    so? output the sql sentence which it runs.
    copy it and run it in database to check if it can get result
      

  7.   

    icecloud:output的sql能运行,并且能得到一条记录, lucky_yeti说的“我的conn是在jsp页上生成的,而我的selectSQL是需要java文件中的conn”有没有关系啊
      

  8.   

    icecloud:我就把.java中的public Connection conn改成了public static Connection conn不行啊
      

  9.   

    按理说应该不会,如果库没有连接那么
    这句ResultSet rs1=DbConn.selectSQL(sql);
    应该出错,
    为了验证一下,你可以把连接数据库的代码放到java文件中,
    jsp中只调用DbConn.selectSQL(sql);
    再试试看。