jsp 连接sqlserver2000数据库问题
我的连接数据库程序:
public boolean connect(){
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bookstor";
String user="sa";
String password="";
con=DriverManager.getConnection(url,user,password);
stmt=con.createStatement();
}catch(Exception ee){System.out.println("connect db error:"+ee.getMessage());
return false;
}
return true;
}
程序在运行时老连接不上数据库,调试结果为:
ee: java.lang.Exception = {java.sql.SQLException@1977}"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."
SQLState: java.lang.String = {java.lang.String@1981}"08001"
vendorCode: int = 0
next: java.sql.SQLException = {java.sql.SQLException@1982}"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection refused: connect"
detailMessage: java.lang.String = {java.lang.String@1983}"[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."
cause: java.lang.Throwable = {java.sql.SQLException@1977}"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."
stackTrace: java.lang.StackTraceElement[] = null
请问这个是什么方面的错误(本人刚学jsp)