SQL Server connection strings


1.  jdbc:sqlserver://192.168.10.220\northstar;databaseName=Northstar
The server\instance name syntax used in the server option is the same for all SQL Server connection strings.
northstar is a instance name. each instance match a port of TCP

2.  jdbc:sqlserver://192.168.10.220:1433;databaseName=Northstar
(Provider=SQLOLEDB.1;Password=*;Persist Security Info=True;User ID=sa;Initial Catalog=Northstar;Data Source=192.168.10.220,1433)

1433 is the default port for SQL Server, can be dynamically assigned, such as 1863, 1875...

netstat -aon | findstr 1433

* A .udl file can be used to set connection string at client side. Creating and Configuring Universal Data Link (.udl) Files
* svrnetcn.exe at server side sets port.
* netstat command displays protocol statistics and current TCP/IP network connections. (netstat -an)

Ref: https://www.connectionstrings.com/sql-server/

 http://support2.microsoft.com/?id=832017
This article contains several references to the default dynamic port range. In Windows Server 2008 and later versions, and in Windows Vista and later versions, the default dynamic port range changed to the following range:
  • Start port: 49152
  • End port: 65535
Windows 2000, Windows XP, and Windows Server 2003 use the following dynamic port range:

  • Start port: 1025
  • End port: 5000

What this means for you:
  • If your computer network environment uses only Windows Server 2012, Windows Server 2008 R2, Windows Server 2008, Windows 8, Windows 7, or Windows Vista, you must enable connectivity over the high port range of 49152 through 65535.
  • If your computer network environment uses Windows Server 2012, Windows Server 2008 R2, Windows Server 2008, Windows 8, Windows 7, or Windows Vista together with versions of Windows earlier than Windows Server 2008 and Windows Vista, you must enable connectivity over both the following port ranges:
    • High port range 49152 through 65535
    • Low port range 1025 through 5000
  • If your computer network environment uses only versions of Windows earlier than Windows Server 2008 and Windows Vista, you must enable connectivity over the low port range of 1025 through 5000.
For more information about the default dynamic port range in Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, and Windows Vista, click the followng article number to go to the article in the Microsoft Knowledge Base:
929851 The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008

评论

此博客中的热门博文

XML, XSL, HTML

Input in element.eleme.io

Data URI是由RFC 2397 ACE