当前位置: 技术问答>java相关
谁帮我看看这是什么错误?谢谢!关于useBean
来源: 互联网 发布时间:2015-10-29
本文导语: 我的数据库的用户名和密码等肯定都是对的。谢谢! Error 500--Internal Server Error From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.5.1 500 Internal Server Error The server encountered an unexpected condition which prevented it fro...
我的数据库的用户名和密码等肯定都是对的。谢谢!
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
package mybag;
import java.io.*;
import java.sql.*;
import java.text.*;
import java.lang.*;
import java.util.*;
public class testsql
{
public ResultSet qq()
{
ResultSet rs1 = null;
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn= DriverManager.getConnection("jdbc:mysql://ip/数据库名?user=root&password=123","root","123");
Statement stmt1=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs1=stmt1.executeQuery("select name from aa");
//return rs1;
}
catch (java.sql.SQLException e)
{ e.printStackTrace(); }
catch(ClassNotFoundException e)
{ e.printStackTrace(); }
catch (java.lang.InstantiationException e)
{ e.printStackTrace(); }
catch ( java.lang.IllegalAccessException e)
{ e.printStackTrace(); }
return rs1;
}
}
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
package mybag;
import java.io.*;
import java.sql.*;
import java.text.*;
import java.lang.*;
import java.util.*;
public class testsql
{
public ResultSet qq()
{
ResultSet rs1 = null;
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn= DriverManager.getConnection("jdbc:mysql://ip/数据库名?user=root&password=123","root","123");
Statement stmt1=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs1=stmt1.executeQuery("select name from aa");
//return rs1;
}
catch (java.sql.SQLException e)
{ e.printStackTrace(); }
catch(ClassNotFoundException e)
{ e.printStackTrace(); }
catch (java.lang.InstantiationException e)
{ e.printStackTrace(); }
catch ( java.lang.IllegalAccessException e)
{ e.printStackTrace(); }
return rs1;
}
}
|
看看你的web服务器报告的debug错误信息,以下信息只能说明是个内部错误,对调试一点用处都没有,要看debug信息
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
|
>>我的用户名和密码肯定都是对的
root帐号是不是只有从localhost登录mysql?
root帐号是不是只有从localhost登录mysql?
|
将root帐号的HOST字段内容改成%试试