Usage Notes
The connection string pointer specifies the address of the connection string for the session.
Language | Variable Name |
---|---|
COBOL: | DBCAREA-CONNECT-PTR |
C: DBCAREA.H | connect_ptr |
Routine | Action Taken |
---|---|
DBCHINI: | writes |
DBCHCL: | reads (CON) |
Used by | Action Taken |
---|---|
application program | writes |
Before calling DBCHCL for the connect function, the application may build a connection string and provide its address in the Connection String Pointer. A connection string has the following format:
“attribute1=value1;attribute2=value2;…;attributeN=valueN”
The following rules govern the format of a valid connection string:
- The connection string consists of an alphanumeric string of attribute=value pairs, separated by a semicolon delimiter character.
- The connection string supports the same session character sets and encodings as the logon string.
- Attribute names are case insensitive. Attribute values are case sensitive.
- If an attribute occurs more than once in the connection string, the last instance takes precedence.
- The quote character is the double quote (“) character.
- Leading and trailing spaces in the attribute name are trimmed.
- Leading and trailing spaces of an unquoted value are trimmed. Leading and trailing spaces outside of a quoted value are trimmed.
- If the value contains spaces as part of the value, the value must be enclosed in quotes.
- Embedded double quote characters (for example, not the first or last character in the value) are allowed and do not require enclosing the value in quotes. For example:
attribute value: abc”def connection string: attribute=abc”def
- If a value contains a double quote as the first or last character in the value, the value must be enclosed in double quotes, and the embedded double quote must be escaped by doubling it. For example:
attribute value: “abcdef connection string: attribute=”””abcdef”
The connection string supports the following attributes:
Attribute | Description |
---|---|
sslmode | TLS security mode. Default is allow. For more information, refer to How to Secure Connections using TLS. Valid values: disable, allow, prefer, require, verify-ca, verify-full |
sslca | The full path to a file in PEM format containing a list of trusted SSL CA certificates. For more information, refer to How to Secure Connections using TLS. Valid values: An operating system file path |
sslcapath | The full path to a directory containing trusted SSL CA certificates in PEM format. For more information, refer to How to Secure Connections using TLS Valid values: An operating system directory path |
tdmstport | The non-TLS port number. Default is 1025. Valid values: A valid integer port number |
tdmsttlsport | The TLS port number. Default is 443. Valid values: A valid integer port number |
httpsport | Same as tdmsttlsport |
sslprotocol | The TLS protocol version. Default is “TLS1_2”. For more information on sslprotocol, refer to How to Secure Connections using TLS. Valid values: TLS1_2 |
Connection string examples:
sslmode=require sslmode=prefer;tdmstport=10250;tdmsttlsport=4430 sslmode=verify-full;sslca=/home/user/”My Certificates”