When Microsoft's JDBC for SQL 2k's documentation says:

Microsoft SQL Server 2000 supports multiple instances of a SQL Server database running concurrently on the same server. An instance is identified by an instance name.

To connect to a named instance using a connection URL, use the following URL format:


... it's lying. That'll just net you the ever popular...

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket

... error.

Just leave out the double backslash and instance name. The port will do you just fine. For example:

strJdbcUrl = "jdbc:microsoft:sqlserver://myServersName:2080"; // instance at port 2080

How do you find out the port for named instances? Apparently the port is taken randomly on first start (versus the standard 1433 for defaults) -- port 2080 above. To find out what port it took, you can port sniff OR, much easier, hit "Start, Programs, Microsoft SQL Server, Server Network Utility", then look at the instance you want, click "TCP/IP" (needs to be in the enabled list), and check out what port's listed. Voila.

Sheesh. When all else fails, read the directions. When the directions fail, try something you still haven't thought of, or at least start Googlin'.