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

请问大家这是什么问题,求救啊,看在我是做毕业设计的份上,请高手帮忙啊!!!
login.config.jsp

<%@   page   contentType= "text/html;   charset=GBK "   import= "java.sql.* "%>
<jsp:useBean   id= "conndb "   scope= "page "   class= "dbconn.conndb ">
</jsp:useBean>
<html>
<head>
<title>
login.config
</title>
</head>
<body   bgcolor= "#ffffff ">
    <%  
try{
ResultSet   rs=conn.executeQuery( "select   *   from   user_info   where   Username= ' "+Username+ " ' ");
if(rs.next()){
String   Password=request.getParameter( "Password ");
if(Password.equals(rs.getString( "password "))){
session.setAttribute( "UserName ",Username);
response.sendRedirect( "index.jsp ");
}else{
out.println( " <script   language= 'javascript '> alert( '您输入的用户名或密码错误,请与管理员联系! ');window.location.href= 'index.jsp '; </script> ");
}
}else{
out.println( " <script   language= 'javascript '> alert( '您输入的用户名或密码错误,或您的帐户已经被冻结,请与管理员联系! ');window.location.href= 'index.jsp '; </script> ");
}
}catch(Exception   e){
out.println( " <script   language= 'javascript '> alert( '您的操作有误! ');window.location.href= 'index.jsp '; </script> ");
}
%>
</body>

</html>


javabean

package   dbconn;
import   java.sql.*;
import   sun.jdbc.odbc.JdbcOdbcDriver;
public   class   conndb   {
        Connection   conn   =   null;
        Statement   stmt   =   null;
        ResultSet   rs   =   null;
        public   conndb()   {
                try   {
                        Class.forName( "sun:jdbc:odbc:JdbcOdbcDriver ");
                }   catch   (java.lang.ClassNotFoundException   e)   {
                        System.err.print(e.getMessage());
                }
        }
public   ResultSet   executeQuery(String   sql){
        try   {
                conn   =   DriverManager.getConnection( "jdbc:odbc:mydb ",   "sa ",   "sa ");
                stmt   =   conn.createStatement();
                rs   =   stmt.executeQuery(sql);

        }   catch   (SQLException   ex)   {
                System.err.print(ex.getM