title: Connecting to SQL Server Named Instance from Windows 64bit
body: <p>I have both java and .net applications running on an app server using Microsoft Windows Server 2003, Enterprise Edition.  These are being migrated to another app server Windows 2008 64-bit machine.</p>
  <p>All applications connect to the same SQL Server 2005 database, on a named instance.</p>
  <p>So far I have tried to move the applications exactly as they are, with no changes in the configuration files, from the old box to the new box.</p>
  <p>On the new app server, neither the java nor the .net applications connect to the database (named instance).</p>
  <blockquote>
  <p>JDBC error message: &quot;The connection to the named instance has failed. Error: java.net.SocketTimeoutException: Receive timed out.&quot;</p>
  <p>The .net error message: &quot;A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.&quot;</p>
  </blockquote>
  <p>If I change the DB config to one that is <em>not</em> on a named instance it works on the new app server.</p>
  <p>The database is setup correctly, because we were able to connect on the old app server.  I can ping the database server from the new app server.</p>
  <p>Is there any reason this won't work on the new app server?</p>
  <blockquote>
  <p>java connection string: &quot;jdbc:microsoft:sqlserver://[dbservername];SelectMethod=Cursor;instanceName=[dbinstance]&quot;</p>
  <p>.net connection string: &quot;Server=[dbservername]\[dbinstance];Database=Risk_DB;Uid=[user];Pwd=[pwd];&quot;</p>
  </blockquote>
  <p><strong>UPDATE</strong>
  Per suggestions in the answers, I got the instance port number.  I also installed SQL Server Management Studio so I can eliminate my apps as the problem points.  From Management Studio, if I use [servername][instancename], I get the message &quot;a network-related or instance-specific error while establishing a connection to SQL Server...&quot;  But it works when i use [servername],[port].  Not sure if there's anyway to work around this?</p>
  <p><strong>UPDATE #2</strong> Escalated the issue to the infrastructure/server/network team. They disabled windows firewall on the new app server.  Presto, now I can connect to [dbservername]\[dbinstance] in Management Studio, and all apps are working using existing configuration files.</p>