jsp文件如下:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="gridBean" scope="session" class="thirdtry.GetUserPwd"/>
<html>
<head>    <meta http-equiv="Content-type" content="text/html;charset=gb2312">
<title>登录</title>
<%out.println("good"); %>
</head>
<body bgcolor="#006699" topmargin="0">
<% out.println("the access result is:" + gridBean.listinfo() + "<br>");%>
</body>
</html>
GetUserPwd.java是:
package thirdtry;

import java.io.PrintStream;
import java.sql.*;

public class GetUserPwd
{   
    String DBDriver;
    String ConnStr;
    String MyUser;
    String MyPassword;
    Connection conn;
    
    static String MYSQL_SITE = "202.112.14.125";
    static String MYSQL_DB_NAME = "cgrid";
    static String MYSQL_USER = "cgrid";
    static String MYSQL_PSWD = "cgrid";
    
    
    public GetUserPwd()
    {
        DBDriver = "org.gjt.mm.mysql.Driver";
        ConnStr = "jdbc:mysql://" + MYSQL_SITE + "/" + MYSQL_DB_NAME;
        MyUser = MYSQL_USER;
        MyPassword = MYSQL_PSWD;
        conn = null;
    
    }

    public int listinfo()
    {
        try
        {
            Connection connection = this.getConn();
            Statement statement = connection.createStatement(1004, 1007);
            String s = "select user,password from users ";
            ResultSet resultset = statement.executeQuery(s);
            resultset.last();
            int i = resultset.getRow();
            if(i > 0)
                System.out.println("user quantity is greater than 0");
            connection.close();
        }
        catch(SQLException sqlexception)
        {
            System.out.println(sqlexception);
            return -1;
        }
        return 0;
    }

    public Connection getConn()
    {
        try
        {
            Class.forName(DBDriver);
        }
        catch(ClassNotFoundException classnotfoundexception)
        {
            System.out.println("Unable to load Driver Class");
            return null;
        }
        try
        {
            conn = DriverManager.getConnection(ConnStr, MyUser, MyPassword);
        }
        catch(SQLException sqlexception)
        {
            System.out.println("SQL Exception: " + sqlexception.getMessage());
            sqlexception.printStackTrace(System.out);
        }
        return conn;
    }

}
显示是老是出错,请大家看看是怎么回事?谢谢!!