Friday, March 30, 2012

Microsoft SQL Server 2005 JDBC Driver

I'm getting the following exception when attempting to connect to SQL Server 2005 using Microsoft's new JDBC driver:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

The help docs suggest checking connectivity using telnet. So attempting to connect via telnet to 127.0.0.1:1433 generates:

Could not open connection to the host, on port 23: Connect failed.

So I try to start telnet:

net start telnet

I get the following error message:

The service cannot be started either because it is disabled or because it has no enables devices associated with it.

Can anyone help?

Thanks

It seems that the TCP protocols is not enabled on your SQL Server.

You may need to enable TCP and *restart* SQL Server.

An article on how to do it for SQL Express is at http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx. The steps are similar for any other edition of SQL Server 2005.

|||

Thanks Peter; TCP/IP was enabled,I must have broken something else during my experimentation with Telnet. I reinstalled the OS and it worked OK.

Duncan

sql

No comments:

Post a Comment