SQL Server 2005 always seems to give me trouble with connection strings. When I install SQL 2005, I choose all the defaults for the developer edition. I would be just as happy using the file system as my provider, perhaps XML, but since SQL Server makes parts of my life easier, I use it. With SQL 2000, my connections strings always used "www.muellerdesigns.net." This did not work for me in 2005. I have to use serverName\instanceName.
I recently rebuilt my current development environment. In configuring all of my .NET applications, I did not pay much attention to my instance of SQL, other than noticing my server and instance names changed. When configuring my Java environment, I installed my JDBC drivers for SQL 2005, but my attempts to connect to the database were failing.
"com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect"
I spent some time trying to debug my Java, connection issues, and what I finally discovered is that by default, SQL Server 2005 Developer Edition does not open TCP/IP connections, unless you specifically enable them using the SQL Server Configuration Manager and SQL Server Surface Area Configuration tools. JDBC will not connect until TCP/IP for SQL Server is enabled. All of the articles I read about connecting to SQL Server with the JDBC driver dealt with connection strings and properties. They assumed my server was properly configured, but since I used all the defaults, it was not.
I use a tool called Active Ports to enable me to see what ports I currently have open. When I searched for port 1433, the default SQL port, I noticed it was not in use. I enabled it, restarted SQL Server, and was finally able to connect using JDBC.
In SQL 2005, (local) and www.muellerdesigns.net cannot be used interchangeably. (local) uses named pipes. www.muellerdesigns.net uses a UDP port on port 1434. Using the serverName\instanceName will use TCP/IP instead of named pipes. I actually had my sqlservr.exe listening on TCP 1539. Now I have it using TCP 1433 and JDBC is happy.
ConnectionStrings.com is a good resource for checking connections strings.