求助:No suitable driver问题
源代码如下
{Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydata_data";
username="sa";
password="sa";
con=DriverManager.getConnection(url,username,password);
}
运行抛出异常
java.sql.SQLException: No suitable driver
Error Trace in getConnection() : [Microsoft][SQLServer 2000 Driver for JDBC]Errr establishing socket.
Error: No active Connection
以下代码编译正常通过
public class TestSqlserverDriver
{
com.microsoft.jdbc.sqlserver.SQLServerDriver driver=new com.microsoft.jdbc.sqlserver.SQLServerDriver();
}