Accepts a host name or IP address and optional port number that tells the client where to find the database server.
Host={ hostname | ip-address }[ :port-number ] ...
Anywhere. The Host connection parameter is recommended for connections to a network server, and indicates the use of TCP/IP.
hostname The name of the computer where the database server is running. The list of host values is a comma-separated list and it can optionally include a port number (separated by a colon). You can use localhost to identify the current computer.
ip-address This string must be specified in the form of an IP address and it can optionally include a port number (separated by a colon). The list of IP addresses is a comma-separated list.
For IPv6 addresses that include a port number, you must enclose the address in either square brackets or parentheses. For
example, Host=[fd77:ab34:2238::3894]:8933
, where 8933 is the port number.
port-number The port number used by the database server. The default port number is 2638.
None
The Host connection parameter specifies one or more hostnames (or IP addresses) and optional port numbers that tell the client where a database server is running.
The Host connection parameter identifies one or more computer systems running database servers. A database server is not started automatically when the Host connection parameter is specified.
If a computer system is running more than one database server and a port is not specified, the ServerName connection parameter should be used to identify which server to connect to. It is recommended that you always use the ServerName parameter, particularly for embedded applications.
Option | Description | ||
---|---|---|---|
Specify server and port |
A connection is made only to a server listening on the specified port and with the specified server name. |
||
Specify server, but not port |
A connection is made to the server with the specified server name. |
||
Specify neither server nor port |
A connection is attempted to a server listening on port 2638. |
When multiple addresses are specified, the addresses are attempted in the following order:
The specified addresses are checked against the database server address cache (sasrv.ini). If a match is found, then this address in the database server cache is attempted first.
The addresses are attempted in the order that they are specified in.
When you use the Host parameter, no UDP packets are sent if enough information is given to uniquely identify the server (a host name and a port number). If neither a port number nor database server name is given, the port number is assumed to be 2638 and the client does not perform a broadcast. However, if the client has a host name and database server name but no port number, it sends a UDP packet to port 2638 on the specified host to find the port number. See Locating SQL Anywhere database servers using the Host connection parameter.
You cannot specify the LocalOnly protocol option with the HOST protocol option or the Host connection parameter.
The Host connection parameter disables the use of shared memory. If you wish to use the Host connection parameter with a personal server, you must start the server with the TCP/IP option.
It is recommended that you only use the CommLinks (LINKS) connection parameter if you need to specify TCP/IP protocol options other than HOST or ServerPort (PORT).
You cannot specify both CommLinks and Host in the connection string.
If you know that a database server named SalesDB is running on a computer called Elora on the default port number, then you can use the following connection string to connect to the database server:
UID=DBA;PWD=sql;Server=SalesDB;Host=Elora:2638 |
If you do not know the port number that the database server is running on, use the following connection string to connect to the SalesDB database server running on the computer named Elora:
UID=DBA;PWD=sql;Server=SalesDB;Host=Elora |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |