I have a java application which connects to SQL Server 2000 using jtds driver. It is working fine on Windows Server 2003. The connection string I used here is as below
con = java.sql.DriverManager.getConnection( "jdbc:jtds:sqlserver://127.0.0.1:1433/DBName", info );
Now I am trying to run the same application on Windows server 2012. But the problem here is, SQL server 2000 is not listening to TCP Port 1433, but it is listening to shared memory. Hence it fails the connection.
I tried to enable TCP/IP Protocol as mentioned in workaround section in this link Enabling TCP/IP Through the Server Network Utility. SQL server didn't start listening to TCP/IP even after restarting the server.
To solve this problem, either I have to make SQL server listen to TCP/IP port or I need to change my code to connect using shared memory if Server is not listening to TCP/IP port.
I am trying to connect to server using shared memory with below connection string as mentioned in this page Creating a Valid Connection String Using Shared Memory Protocol
con = java.sql.DriverManager.getConnection( "jdbc:jtds:sqlserver://localhost\SQLEXPRESS:1433/DBName", info );
Which leads to the exception java.sql.SQLException: Unknown server host name 'localhost\SQLEXPRESS'.
I also tried the connection string:
con = java.sql.DriverManager.getConnection( "jdbc:jtds:sqlserver://localhost\SQLEXPRESS/DBName", info );
which produces the exception: java.sql.SQLException: Unknown server host name 'localhost\SQLEXPRESS'.
It would be great if I can get solution for either of the problems
Thanks in advance, Jayanth
I got the solution for one of those 2 problems - Enabling TCP/IP port on Windows server 2012 for SQL server 2000.