日期:2014-05-17  浏览次数:20650 次

无法显示,您要访问的网页有问题,无法显示 如果去掉IE“工具”里面的“高级”的“显示HTTP友好错误信息”出现出现Access denied for user 'user=root'@'localh
我是在做一个小网站的时候 用的myeclise开发环境 数据库用的mysql5.0 语言是jsp
登陆页面代码:
<html>
<head>
<title>管理员登陆页面</title>
</head>
  <body>
<form action="adminlogin.jsp" method="post">
<table width="400" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
  <td>
用户名:
<input name="ID" type="text" class="b" size="20">
</td>
</tr>
<tr>
<td>
密&nbsp;&nbsp;码:
<input name="password" type="password" class="b" size="20">
</td>
</tr>  
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="submit" value="确定">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="reset" value="重置">
</td>
</tr>
</table>
</form>
</body>
</html>
数据库连接的代码:
package aaa;
import java.sql.*;
public class DBOperate_admin
{
Statement st;
Connection con;
ResultSet rs;
public void connection() throws Exception
{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/biyeDB","user=root","password=198783");
st=con.createStatement();
}
public ResultSet AdminloginOp(String ID,String password) throws Exception//登录
{
connection();
rs=st.executeQuery("select * from t_admin where adminID='"+ID+"' and password='"+password+"'");
return rs;
}

public void closeCon() throws Exception
{
con.close();
}
}
处理的页面代码是:
<%@ page import="java.sql.*" contentType="text/html;charset=GBK"
errorPage="err.jsp"%>
<jsp:useBean id="a_login" scope="page" class="aaa.DBOperate_admin" />
<%
request.setCharacterEncoding("GBK");
String ID = request.getParameter("ID");
String password = request.getParameter("password");

ResultSet rs = a_login.AdminloginOp(ID, password);
if (rs.next()) {
//session.setAttribute("admin",ID);
session.setAttribute("admin", rs.getString("adminID"));
//session.setAttribute("userID",userID);
a_login.closeCon();
response.sendRedirect("index.jsp");
} else {
a_login.closeCon();
out
.print("<Script Language=Javascript>window.alert('您输入的信息有误!');location.href='login.htm';</Script>");
//response.sendRedirect("index.jsp");
}
%>
在没去掉“显示HTTP友好错误信息”的勾时无法显示,您要访问的网页有问题,无法显示 如果去掉IE“工具”里面的“高级”的“显示HTTP友好错误信息”的勾出现出现Access denied for user 'user=root'@''localhost' (using password: YES)
但是我的其他页面的用户注册和登录都能正常运行啊?
求各位大虾帮个忙啊!小弟很急啊~~~~~~~谢谢各位了

------解决方案--------------------
..弄出来了?