Monday, February 11, 2008 #

Running D2R server with MS SQL 2005

I was having trouble getting D2R server running on my machine. Now, I know this worked in the past with no problems, but that was a few months ago. I think my version of MS SQL 2005 Express has been updated since then, but I wasn't sure.

Anyway, I couldn't get the thing to run. I kept getting the following error message:

The connection to the named instance  has failed. Error: java.net.SocketTimeoutException: Receive timed out.

I was using the exact same configuration file as before so I was getting very frustrated.

map:database a d2rq:Database;
    d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    d2rq:jdbcDSN "jdbc:sqlserver://david-xps;instanceName=sqlexpress;databaseName=xxxx";
    d2rq:username "xxxx";
    d2rq:password "xxxx";
    .

I did a search and came across this Microsoft doc - How to connect to a named instance of SQL Server 2005 or SQL Server 2000 by using the client tools in the earlier version of SQL Server. I was running a named instance of SQLEXPRESS so I followed the directions from the doc:

  1. Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration.
  2. Click Protocols for InstanceName, and then double-click TCP/IP in the right panel.
    Note InstanceName is a placeholder for the named instance of SQL Server 2005.
  3. On the Protocol tab, notice the value of the Listen All item.
  4. Click the IP Addresses tab:
    1. If the value of Listen All is yes, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item under IPAll.
    2. If the value of Listen All is no, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item for a specific IP address
  5. Note If the value of the TCP Dynamic Ports item is not set, you must set it yourself. For more information about how to configure a server to listen on a specific TCP port, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/ms177440.aspx (http://msdn2.microsoft.com/en-us/library/ms177440.aspx)
  6. Click OK.

So, after all that, I used the TCP Dynamic Ports value and plugged it in to my connection string:

d2rq:jdbcDSN "jdbc:sqlserver://david-xps:49417;instanceName=sqlexpress;databaseName=xxxx";

And it worked like a charm!

del.icio.us Tags: , ,

posted @ Monday, February 11, 2008 8:40 PM | Feedback (0)

Copyright © David Peterson

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski