日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

使用JDBC连接SQL Server 2000 命名实例(Named Instance)

發(fā)布時(shí)間:2025/7/14 数据库 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用JDBC连接SQL Server 2000 命名实例(Named Instance) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

????????最近比較閑,就愛擺弄一些玩意,前時(shí)間對(duì)ruby on rails比較感興趣,就想繼續(xù)看看,但是系統(tǒng)壞了好幾次,前段時(shí)間配好的eclipse+rdt+sqlserver的環(huán)境也就得重新diy了;
????????按照 Setting up a Rails Development Environment on Windows Using Eclipse上的步驟,一步一步走的挺順利的,可是到Install the DBEdit Eclipse plugin的時(shí)候,想恢復(fù)以前的直接連接自己比較熟悉的SQL Server 2000,可是死活也無法連上,老是報(bào)[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.錯(cuò)誤,起初以為是沒有打sp3包,就干脆重新安裝了個(gè)msde sp4的命名實(shí)例,可是懵了,怎么連命名實(shí)例啊,想起總是用net start mssql$InstanceName 啟動(dòng)命名實(shí)例服務(wù),突發(fā)其想以為可用jdbc:microsoft:sqlserver://serverName$InstanceName:Port來連接還是報(bào)[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.錯(cuò)誤,說明猜想不對(duì),google了一下找了n多資料一直沒有解決,最后在msdn上發(fā)現(xiàn)有這么篇文章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這個(gè)主觀臆造的URL來連接,而是使用上面的串,其中yourServerName是服務(wù)器名,1433應(yīng)該替換成你命名實(shí)例的端口號(hào),在這個(gè)url中根本體現(xiàn)不出命名實(shí)例名,比如我的連接url:jdbc:microsoft:sqlserver://oy-m:2046(我新安裝的命名實(shí)例為ruby,端口號(hào)為2046),就這么簡(jiǎn)單……

轉(zhuǎn)載于:https://www.cnblogs.com/Hedonister/archive/2006/09/11/501387.html

總結(jié)

以上是生活随笔為你收集整理的使用JDBC连接SQL Server 2000 命名实例(Named Instance)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。