大家好,我需要用JDBC连接SQL Server 2012 Express版本。现在我用SQL Server Management Studio连接都没有问题,但是用String connectionUrl = "jdbc:sqlserver://localhost;databaseName=MyDB;integratedSecurity=true;";
Connection conn = DriverManager.getConnection(connectionUrl);报出异常
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".因为我用的是 SQL Server Express 版本,所以不知道如何配置端口。请教解决过这个问题的高手。