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:
- Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration.
- 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. - On the Protocol tab, notice the value of the Listen All item.
- Click the IP Addresses tab:
- 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.
- 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
- 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)
- 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:
D2R,
D2RQ,
SQL2005