Programmer Guide : solidDB® ODBC API : Connecting to a data source : Network name and connect string syntax
  
Network name and connect string syntax
The solidDB® network name syntax depends on the connectivity type: basic connectivity or transparent connectivity (TC Info). Both connectivity types can be used with network-based connections or local shared memory access (SMA) connections.
Basic connectivity
Basic connectivity is the most commonly used connectivity type where the connect string defines the connection between the application and the solidDB® server.
Transparent connectivity (TC Info)
Transparent connectivity (TC Info) is used in High Availability (HA) configurations for specifying a (single) connection between the application and the solidDB® HotStandby servers.
Both basic connectivity and transparent connectivity can be used in shared memory access (SMA) setups.
Network name syntax
The syntax of the network name is the following:
<network_name>::=<basic_connectivity>|<transparent_connectivity>
where
<basic_connectivity>::=[<encryption attribute>]
    <network_connect_string> | <sma_connect_string>
<encryption attribute>::=USE_ENCRYPTION=YES|NO
<network_connect string>::=protocol_name
    [options] [server_name]
    [port_number]
<sma_connect_string>::=sma protocol_name port_number | pipe_name
For example:
USE_ENCRYPTION=YES tcp localhost 1315
sma tcp 2315
For more information about SMA connections, see “Establishing local connections for SMA” in the solidDB® Shared Memory Access and Linked Library Access User Guide.
<transparent_connectivity>::= {[<failure_transparency_level_attribute>] [<preferred_access_attribute>] [<encryption_attribute>] <connect_target_list>} | <cluster_info>
For details on the attributes, see “Syntax of the Transparent Connectivity Info -ODBC” in the solidDB® High Availability User Guide
For example:
TF=SESSION USE_ENCRYPTION=YES SERVERS=tcp 2315 tcp 1315
solidDB® connect string (<network_connect_string>)
The most commonly used network-based solidDB® connect string consists of a communication protocol, a possible set of special options, an optional host computer name and a server name.
By this combination, the client specifies the server it will establish a connection to. The communication protocol and the server name must match the ones that the server is using in its network listening name. In addition, most protocols need a specified host computer name if the client and server are running on different machines. All components of the client’s network name are case insensitive.
The format of a connect string is the following:
protocol_name [options] [host_computer_name] server_name
where
options can be any combination of the following:
Option
Description
Protocol
-4
Specifies that client connects using IPv4 protocol only.
TCP/IP
-6
Specifies that client connects using IPv6 protocol only.
In Windows environments, this option is mandatory if IPv6 protocol is used.
TCP/IP
-isource_address
Specifies an explicit connecting socket source address for cases where the system default source IP address binding does not meet application needs.
source_address can be an IP address or a host name.
TCP/IP
-z
Enables data compression for the connection
Important:
Data compression is not available for HotStandby connections (HotStandby.Connect) and NetBackup connections (ADMIN COMMAND 'netbackup').
Data compression for netcopy connections cannot be enabled with the -z option. Instead, use the HotStandby.NetcopyRpcCompress=yes parameter setting.
All
-c milliseconds
Specifies the login timeout (the default is operating-system-specific). A login request fails after the specified time has elapsed.
TCP/IP
-r milliseconds
Specifies the connection (or read) timeout. A network request fails when no response is received during the time specified. The value 0 (default) sets the timeout to infinite (operating system default timeout applies).
TCP/IP
-ofilename
Turns on the Network trace facility and defines the name of the trace output file
See Network trace facility in the solidDB® Administrator Guide for details.
All
-plevel
Pings the server at the given level (0-5).
Clients can always use the solidDB® Ping facility at level 1 (0 is no operation/default). Levels 2, 3, 4 or 5 may only be used if the server is set to use the Ping facility at least at the same level.
See Ping facility in the solidDB® Administrator Guide for details.
All
-t
Turns on the Network trace facility
See Network trace facility in the solidDB® Administrator Guide for details.
All
host_computer_name is needed with TCP/IP and Named Pipes protocols, if the client and server are running on different machines.
server_name depends on the communication protocol:
– In TCP/IP protocol, server_name is a service port number, such as 2315.
– In other protocols, server_name is a name, such as soliddb or chicago_office.
For details on the syntax in different communication protocols, see Communication protocols in the solidDB® Administrator Guide.
Notes
The protocol_name and the server_name must match the ones that the server is using in its network listening name.
If given at the connection time, the connect string must be enclosed in double quotation marks.
All components of the connect string are case insensitive.
The same format of the connect string applies to the Com.Connect parameter as well as to the connect string used by solidDB® tools or ODBC applications.
Examples
[Com]
Connect=tcp -z -c1000 1315
[Com]
Connect=nmpipe host22 SOLID
solsql "tcp localhost 1315"
solsql "tcp 192.168.255.1 1315"
rc = SQLConnect(hdbc, "upipe SOLID", (SWORD)SQL_NTS, "dba", 3, "dba", 3);
rc = SQLDriverConnect(hdbc,
       (SQLHWND)NULL,
       (SQLCHAR*)"DSN=tcp localhost 1964;UID=dba;PWD=dba",
       38,
       out_string,
       255,
       &out_length,
       SQL_DRIVER_NOPROMPT);
See also
Connecting to a data source