最近比较闲,就爱摆弄一些玩意,前时间对ruby on rails比较感兴趣,就想继续看看,但是系统坏了好几次,前段时间配好的eclipse+rdt+sqlserver的环境也就得重新diy了;
        按照 Setting up a Rails Development Environment on Windows Using Eclipse上的步骤,一步一步走的挺顺利的,可是到How To Connect to a SQL Server 2000 Named Instance with JDBC  找到解决方案了:

 To find the SQL Server instance port number, follow these steps:

1. On the Microsoft SQL Server 2000 server, start the SQL Server Network Utility.
2. Click the General tab, and then click the instance you want from the Instances drop-down menu.
3. Click TCP/IP, and then click Properties. Note that the port number for this instance appears in the Properties dialog box.

As soon as you have this value, you can use it in your connection URL when you connect to SQL Server through JDBC. The following is an example of a typical connection URL:

jdbc:microsoft:sqlserver://yourServerName:1433;user=yourUser;password=yourPwd

      也就是说不是用jdbc:microsoft:sqlserver://serverName$InstanceName:Port这个主观臆造的URL来连接,而是使用上面的串,其中yourServerName是服务器名,1433应该替换成你命名实例的端口号,在这个url中根本体现不出命名实例名,比如我的连接url:jdbc:microsoft:sqlserver://oy-m:2046(我新安装的命名实例为ruby,端口号为2046),就这么简单……

相关文章: