Saltar al contenido

IBM DB2 Connection Details

Introduction

Connector Version

This documentation is based on version 23.0.9039 of the connector.

Get Started

DB2 Version Support

Compatible with DRDA gateway protocol version 5 and newer. May also connect to DB2 server deployed DRDA gateway.

Establish a Connection

Connect to DB2

Set the following properties to connect:

  • Server: The name of the server running DB2.
  • Port: The port the DB2 server is listening on.
  • Database: The name of the DB2 database.

Authenticate to DB2

The connector supports authenticating directly to the DB2 with user credentials as well as authenticating using the API key of an application integrated with DB2, such as Watson Query.

DB2 User Credentials

Set AuthScheme to USRIDPWD. Provide the following credentials:

  • User: The username of a user with access to the database.
  • Password: The password of a user with access to the database.
IAM

The connector supports authenticating to the DB2 server using the API key of an application that connects to it, such as Watson Query.

Set AuthScheme to IBMIAMAuth. Provide the following credentials:

  • User: The IBMid or service ID tied to a user of the DB2 server.
  • Password: The API key associated with the application that requires access to the DB2 database.

Supported CCSIDs

The connector is compatible with DB2 instances with the following CCSIDs. You may encounter invalid character set errors if your DB2 server uses CCSIDs other than those listed.

  • 37
  • 273
  • 277
  • 278
  • 280
  • 284
  • 285
  • 290
  • 297
  • 300
  • 301
  • 367
  • 420
  • 437
  • 500
  • 524
  • 737
  • 775
  • 806
  • 813
  • 819
  • 833
  • 834
  • 835
  • 836
  • 837
  • 838
  • 850
  • 852
  • 855
  • 856
  • 857
  • 858
  • 859
  • 860
  • 861
  • 862
  • 863
  • 864
  • 865
  • 866
  • 868
  • 869
  • 870
  • 871
  • 874
  • 875
  • 878
  • 897
  • 912
  • 913
  • 914
  • 915
  • 916
  • 918
  • 920
  • 921
  • 922
  • 923
  • 924
  • 927
  • 930
  • 932
  • 933
  • 935
  • 937
  • 939
  • 942
  • 943
  • 947
  • 948
  • 949
  • 950
  • 951
  • 954
  • 964
  • 970
  • 971
  • 1006
  • 1025
  • 1026
  • 1027
  • 1041
  • 1043
  • 1046
  • 1047
  • 1051
  • 1088
  • 1089
  • 1097
  • 1098
  • 1112
  • 1114
  • 1115
  • 1122
  • 1123
  • 1124
  • 1140
  • 1141
  • 1142
  • 1143
  • 1144
  • 1145
  • 1146
  • 1147
  • 1148
  • 1149
  • 1163
  • 1200
  • 1208
  • 1250
  • 1251
  • 1252
  • 1253
  • 1254
  • 1255
  • 1256
  • 1257
  • 1258
  • 1275
  • 1280
  • 1282
  • 1283
  • 1284
  • 1285
  • 1286
  • 1351
  • 1362
  • 1363
  • 1364
  • 1370
  • 1371
  • 1380
  • 1381
  • 1382
  • 1383
  • 1385
  • 1386
  • 1388
  • 1390
  • 1392
  • 1399
  • 5026
  • 5035

Important Notes

Configuration Files and Their Paths

  • All references to adding configuration files and their paths refer to files and locations on the Jitterbit agent where the connector is installed. These paths are to be adjusted as appropriate depending on the agent and the operating system. If multiple agents are used in an agent group, identical files will be required on each agent.

Advanced Features

This section details a selection of advanced features of the DB2 connector.

SSL Configuration

Use SSL Configuration to adjust how connector handles TLS/SSL certificate negotiations. You can choose from various certificate formats; see the SSLServerCert property under "Connection String Options" for more information.

Proxy

To configure the connector using private agent proxy settings, select the Use Proxy Settings checkbox on the connection configuration screen.

SSL Configuration

Customize the SSL Configuration

By default, the connector attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store.

To specify another certificate, see the SSLServerCert property for the available formats to do so.

Advanced Configurations Properties

The advanced configurations properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure. Click the links for further details.

Authentication

Property Description
AuthScheme The authentication mechanism that the provider will use to authenticate with DB2.
Server The name of the DB2 server.
Port The port used to connect to the server hosting the DB2 database.
Database The name of the DB2 database.
User A database user.
Password The user's password.
UseSSL This field sets whether SSL is enabled.
AlternateServers This property allows you to specify multiple servers in addition to the one configured in Server and Port . Specify both a server name and port; separate servers with a comma.

SSL

Property Description
SSLServerCert The certificate to be accepted from the server when connecting using TLS/SSL.

SSH

Property Description
SSHAuthMode The authentication method used when establishing an SSH Tunnel to the service.
SSHClientCert A certificate to be used for authenticating the SSHUser.
SSHClientCertPassword The password of the SSHClientCert key if it has one.
SSHClientCertSubject The subject of the SSH client certificate.
SSHClientCertType The type of SSHClientCert private key.
SSHServer The SSH server.
SSHPort The SSH port.
SSHUser The SSH user.
SSHPassword The SSH password.
SSHServerFingerprint The SSH server fingerprint.
UseSSH Whether to tunnel the DB2 connection over SSH. Use SSH.

Schema

Property Description
Location A path to the directory that contains the schema files defining tables, views, and stored procedures.
BrowsableSchemas This property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA, SchemaB, SchemaC.
Tables This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA, TableB, TableC.
Views Restricts the views reported to a subset of the available tables. For example, Views=ViewA, ViewB, ViewC.

Miscellaneous

Property Description
AllowPreparedStatement Prepare a query statement before its execution.
CharBitDataAsString A Boolean value used to indicate whether parameters, result data, and schema information for iDB2CharBitData and iDB2VarCharBitData objects are treated as String values or as Byte array values.
CharBitDataCcsid An Int32 value used to indicate which CCSID is used to translate iDB2CharBitData and iDB2VarCharBitData types when the CharBitDataAsString property is set to true. This property is ignored when CharBitDataAsString is set to false.
TruncateString This property specifies whether to truncate characters when INSERT or UPDATE is executed with a string that exceeds the column size.
Schema The schema which will be used by default.
IgnoreCase Whether to ignore case in identifiers.
MaxRows Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.
Other These hidden properties are used only in specific use cases.
QueryPassthrough This option passes the query to the DB2 server as is.
SwitchMode This property allows you to specify a switching mode to select a server from AlternateServers as the active server.
SwitchStrategy This property allows you to specify a switching strategy to select a server from AlternateServers as the active server.
Timeout The value in seconds until the timeout error is thrown, canceling the operation.

Authentication

This section provides a complete list of authentication properties you can configure.

Property Description
AuthScheme The authentication mechanism that the provider will use to authenticate with DB2.
Server The name of the DB2 server.
Port The port used to connect to the server hosting the DB2 database.
Database The name of the DB2 database.
User A database user.
Password The user's password.
UseSSL This field sets whether SSL is enabled.
AlternateServers This property allows you to specify multiple servers in addition to the one configured in Server and Port . Specify both a server name and port; separate servers with a comma.

AuthScheme

The authentication mechanism that the provider will use to authenticate with DB2.

Possible Values

USRIDPWD, EUSRIDPWD, IBMIAMAuth

Data Type

string

Default Value

USRIDPWD

Remarks
  • USRIDPWD: Set this to use user ID and password to authenticate.
  • EUSRIDPWD: Set this to use encrypted user ID and encrypted password to authenticate.
  • IBMIAMAuth: Set this to use user ID and password(apikey) to connect to Watson Query.

Server

The name of the DB2 server.

Data Type

string

Default Value

""

Remarks

This property should be set to the name or network address of the server hosting the DB2 database.

Port

The port used to connect to the server hosting the DB2 database.

Data Type

string

Default Value

50000

Remarks

The port used to connect to the server hosting the DB2 database.

Database

The name of the DB2 database.

Data Type

string

Default Value

""

Remarks

The name of the DB2 database running on the specified Server. To connect to the database, you will also need to specify a User and Password for a user authorized to access the database.

User

A database user.

Data Type

string

Default Value

""

Remarks

The username of a user authorized to access the database.

Password

The user's password.

Data Type

string

Default Value

""

Remarks

The password provided for authentication with the database.

UseSSL

This field sets whether SSL is enabled.

Data Type

bool

Default Value

false

Remarks

This field sets whether the connector will attempt to negotiate TLS/SSL connections to the server. By default, the connector checks the server's certificate against the system's trusted certificate store. To specify another certificate, set SSLServerCert.

AlternateServers

This property allows you to specify multiple servers in addition to the one configured in Server and Port . Specify both a server name and port; separate servers with a comma.

Data Type

string

Default Value

""

Remarks

This property allows you to specify the other servers in addition to the one configured in Server and Port. You must specify all servers using AlternateServers, Server, and Port.

Specify both a server name and port in AlternateServers; separate servers with a comma. For example:

Server=localhost;Port=27017;AlternateServers=localhost:27018,localhost:27019;

SSL

This section provides a complete list of SSL properties you can configure.

Property Description
SSLServerCert The certificate to be accepted from the server when connecting using TLS/SSL.

SSLServerCert

The certificate to be accepted from the server when connecting using TLS/SSL.

Data Type

string

Default Value

""

Remarks

If using a TLS/SSL connection, this property can be used to specify the TLS/SSL certificate to be accepted from the server. Any other certificate that is not trusted by the machine is rejected.

This property can take the following forms:

Description Example
A full PEM Certificate (example shortened for brevity) -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE-----
A path to a local file containing the certificate C:\\cert.cer
The public key (example shortened for brevity) -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY-----
The MD5 Thumbprint (hex values can also be either space or colon separated) ecadbdda5a1529c58a1e9e09828d70e4
The SHA1 Thumbprint (hex values can also be either space or colon separated) 34a929226ae0819f2ec14b4a3d904f801cbb150d

If not specified, any certificate trusted by the machine is accepted.

Certificates are validated as trusted by the machine based on the System's trust store. The trust store used is the 'javax.net.ssl.trustStore' value specified for the system. If no value is specified for this property, Java's default trust store is used (for example, JAVA_HOME\lib\security\cacerts).

Use '*' to signify to accept all certificates. Note that this is not recommended due to security concerns.

SSH

This section provides a complete list of SSH properties you can configure.

Property Description
SSHAuthMode The authentication method used when establishing an SSH Tunnel to the service.
SSHClientCert A certificate to be used for authenticating the SSHUser.
SSHClientCertPassword The password of the SSHClientCert key if it has one.
SSHClientCertSubject The subject of the SSH client certificate.
SSHClientCertType The type of SSHClientCert private key.
SSHServer The SSH server.
SSHPort The SSH port.
SSHUser The SSH user.
SSHPassword The SSH password.
SSHServerFingerprint The SSH server fingerprint.
UseSSH Whether to tunnel the DB2 connection over SSH. Use SSH.

SSHAuthMode

The authentication method used when establishing an SSH Tunnel to the service.

Possible Values

None, Password, Public_Key

Data Type

string

Default Value

Password

Remarks
  • None: No authentication is performed. The current User value is ignored, and the connection is logged in as anonymous.
  • Password: The connector uses the values of User and Password to authenticate the user.
  • Public_Key: The connector uses the values of User and SSHClientCert to authenticate the user. SSHClientCert must have a private key available for this authentication method to succeed.

SSHClientCert

A certificate to be used for authenticating the SSHUser.

Data Type

string

Default Value

""

Remarks

SSHClientCert must contain a valid private key in order to use public key authentication. A public key is optional, if one is not included then the connector generates it from the private key. The connector sends the public key to the server and the connection is allowed if the user has authorized the public key.

The SSHClientCertType field specifies the type of the key store specified by SSHClientCert. If the store is password protected, specify the password in SSHClientCertPassword.

Some types of key stores are containers which may include multiple keys. By default the connector will select the first key in the store, but you can specify a specific key using SSHClientCertSubject.

SSHClientCertPassword

The password of the SSHClientCert key if it has one.

Data Type

string

Default Value

""

Remarks

This property is only used when authenticating to SFTP servers with SSHAuthMode set to PublicKey and SSHClientCert set to a private key.

SSHClientCertSubject

The subject of the SSH client certificate.

Data Type

string

Default Value

*

Remarks

When loading a certificate the subject is used to locate the certificate in the store.

If an exact match is not found, the store is searched for subjects containing the value of the property.

If a match is still not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks the first certificate in the certificate store.

The certificate subject is a comma separated list of distinguished name fields and values. For instance "CN=www.server.com, OU=test, C=US, E=example@jbexample.com". Common fields and their meanings are displayed below.

Field Meaning
CN Common Name. This is commonly a host name like www.server.com.
O Organization
OU Organizational Unit
L Locality
S State
C Country
E Email Address

If a field value contains a comma it must be quoted.

SSHClientCertType

The type of SSHClientCert private key.

Possible Values

USER, MACHINE, PFXFILE, PFXBLOB, JKSFILE, JKSBLOB, PEMKEY_FILE, PEMKEY_BLOB, PPKFILE, PPKBLOB, XMLFILE, XMLBLOB

Data Type

string

Default Value

PEMKEY_FILE

Remarks

This property can take one of the following values:

Types Description Allowed Blob Values
MACHINE/USER Not available on this platform. Blob values are not supported.
JKSFILE/JKSBLOB A Java keystore file. Must contain both a certificate and a private key. Only available in Java. base64-only
PFXFILE/PFXBLOB A PKCS12-format (.pfx) file. Must contain both a certificate and a private key. base64-only
PEMKEY_FILE/PEMKEY_BLOB A PEM-format file. Must contain an RSA, DSA, or OPENSSH private key. Can optionally contain a certificate matching the private key. base64 or plain text. Newlines may be replaced with spaces when providing the blob as text.
PPKFILE/PPKBLOB A PuTTY-format private key created using the puttygen tool. base64-only
XMLFILE/XMLBLOB An XML key in the format generated by the .NET RSA class: RSA.ToXmlString(true). base64 or plain text.

SSHServer

The SSH server.

Data Type

string

Default Value

""

Remarks

The SSH server.

SSHPort

The SSH port.

Data Type

string

Default Value

22

Remarks

The SSH port.

SSHUser

The SSH user.

Data Type

string

Default Value

""

Remarks

The SSH user.

SSHPassword

The SSH password.

Data Type

string

Default Value

""

Remarks

The SSH password.

SSHServerFingerprint

The SSH server fingerprint.

Data Type

string

Default Value

""

Remarks

The SSH server fingerprint.

UseSSH

Whether to tunnel the DB2 connection over SSH. Use SSH.

Data Type

bool

Default Value

false

Remarks

By default the connector will attempt to connect directly to DB2. When this option is enabled, the connector will instead establish an SSH connection with the SSHServer and tunnel the connection to DB2 through it.

Schema

This section provides a complete list of schema properties you can configure.

Property Description
Location A path to the directory that contains the schema files defining tables, views, and stored procedures.
BrowsableSchemas This property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA, SchemaB, SchemaC.
Tables This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA, TableB, TableC.
Views Restricts the views reported to a subset of the available tables. For example, Views=ViewA, ViewB, ViewC.

Location

A path to the directory that contains the schema files defining tables, views, and stored procedures.

Data Type

string

Default Value

%APPDATA%\DB2 Data Provider\Schema

Remarks

The path to a directory which contains the schema files for the connector (.rsd files for tables and views, .rsb files for stored procedures). The folder location can be a relative path from the location of the executable. The Location property is only needed if you want to customize definitions (for example, change a column name, ignore a column, and so on) or extend the data model with new tables, views, or stored procedures.

If left unspecified, the default location is "%APPDATA%\DB2 Data Provider\Schema" with %APPDATA% being set to the user's configuration directory:

Platform %APPDATA%
Windows The value of the APPDATA environment variable
Mac ~/Library/Application Support
Linux ~/.config

BrowsableSchemas

This property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC.

Data Type

string

Default Value

""

Remarks

Listing the schemas from databases can be expensive. Providing a list of schemas in the connection string improves the performance.

Tables

This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC.

Data Type

string

Default Value

""

Remarks

Listing the tables from some databases can be expensive. Providing a list of tables in the connection string improves the performance of the connector.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the tables you want in a comma-separated list. Each table should be a valid SQL identifier with any special characters escaped using square brackets, double-quotes or backticks. For example, Tables=TableA,[TableB/WithSlash],WithCatalog.WithSchema.`TableC With Space`.

Note that when connecting to a data source with multiple schemas or catalogs, you will need to provide the fully qualified name of the table in this property, as in the last example here, to avoid ambiguity between tables that exist in multiple catalogs or schemas.

Views

Restricts the views reported to a subset of the available tables. For example, Views=ViewA,ViewB,ViewC.

Data Type

string

Default Value

""

Remarks

Listing the views from some databases can be expensive. Providing a list of views in the connection string improves the performance of the connector.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the views you want in a comma-separated list. Each view should be a valid SQL identifier with any special characters escaped using square brackets, double-quotes or backticks. For example, Views=ViewA,[ViewB/WithSlash],WithCatalog.WithSchema.`ViewC With Space`.

Note that when connecting to a data source with multiple schemas or catalogs, you will need to provide the fully qualified name of the table in this property, as in the last example here, to avoid ambiguity between tables that exist in multiple catalogs or schemas.

Miscellaneous

This section provides a complete list of miscellaneous properties you can configure.

Property Description
AllowPreparedStatement Prepare a query statement before its execution.
CharBitDataAsString A Boolean value used to indicate whether parameters, result data, and schema information for iDB2CharBitData and iDB2VarCharBitData objects are treated as String values or as Byte array values.
CharBitDataCcsid An Int32 value used to indicate which CCSID is used to translate iDB2CharBitData and iDB2VarCharBitData types when the CharBitDataAsString property is set to true. This property is ignored when CharBitDataAsString is set to false.
TruncateString This property specifies whether to truncate characters when INSERT or UPDATE is executed with a string that exceeds the column size.
Schema The schema which will be used by default.
IgnoreCase Whether to ignore case in identifiers.
MaxRows Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.
Other These hidden properties are used only in specific use cases.
QueryPassthrough This option passes the query to the DB2 server as is.
SwitchMode This property allows you to specify a switching mode to select a server from AlternateServers as the active server.
SwitchStrategy This property allows you to specify a switching strategy to select a server from AlternateServers as the active server.
Timeout The value in seconds until the timeout error is thrown, canceling the operation.

AllowPreparedStatement

Prepare a query statement before its execution.

Data Type

bool

Default Value

true

Remarks

If the AllowPreparedStatement property is set to false, statements are parsed each time they are executed. Setting this property to false can be useful if you are executing many different queries only once.

If you are executing the same query repeatedly, you will generally see better performance by leaving this property at the default, true. Preparing the query avoids recompiling the same query over and over. However, prepared statements also require the connector to keep the connection active and open while the statement is prepared.

CharBitDataAsString

A Boolean value used to indicate whether parameters, result data, and schema information for iDB2CharBitData and iDB2VarCharBitData objects are treated as String values or as Byte array values.

Data Type

bool

Default Value

false

Remarks

Setting this property to true allows the application to retrieve the data as translated character strings instead of as an array of bytes. The default value is false.

CharBitDataCcsid

An Int32 value used to indicate which CCSID is used to translate iDB2CharBitData and iDB2VarCharBitData types when the CharBitDataAsString property is set to true. This property is ignored when CharBitDataAsString is set to false.

Data Type

int

Default Value

-1

Remarks

The default value is -1, and indicates that the host server job CCSID is used for translation. The link to the DB2 CCSID list is: https://www.ibm.com/docs/en/db2/11.5?topic=miexdc-ccsids-encoding-names The link to the DB2 iSeries/AS400 CCSID list is: https://www.ibm.com/docs/en/i/7.5?topic=information-ccsid-values-defined-i

TruncateString

This property specifies whether to truncate characters when INSERT or UPDATE is executed with a string that exceeds the column size.

Data Type

bool

Default Value

false

Remarks

By default it is False, which means if a string value exceeds the columns size, driver throws an exception.

Schema

The schema which will be used by default.

Data Type

string

Default Value

""

Remarks

By setting this property, you will be able to execute SQL commands without having to specify the schema name.

IgnoreCase

Whether to ignore case in identifiers.

Data Type

bool

Default Value

false

Remarks

When IgnoreCase is set to false (default), SQL identifiers are sent to DB2 in the same case as they appear in the query. For example, SELECT * FROM Table is sent as SELECT * FROM "Table".

When IgnoreCase is set to true, SQL identifiers are converted to uppercase before being sent to DB2. For example, SELECT * FROM Table is sent as SELECT * FROM "TABLE".

This property only takes effect when QueryPassThrough is set to false.

MaxRows

Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.

Data Type

int

Default Value

-1

Remarks

Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.

Other

These hidden properties are used only in specific use cases.

Data Type

string

Default Value

""

Remarks

The properties listed below are available for specific use cases. Normal driver use cases and functionality should not require these properties.

Specify multiple properties in a semicolon-separated list.

Integration and Formatting
Property Description
DefaultColumnSize Sets the default length of string fields when the data source does not provide column length in the metadata. The default value is 2000.
ConvertDateTimeToGMT Determines whether to convert date-time values to GMT, instead of the local time of the machine.
RecordToFile=filename Records the underlying socket data transfer to the specified file.

QueryPassthrough

This option passes the query to the DB2 server as is.

Data Type

bool

Default Value

false

Remarks

When this is set, queries are passed through directly to DB2.

SwitchMode

This property allows you to specify a switching mode to select a server from AlternateServers as the active server.

Possible Values

None, Failover, LoadBalance

Data Type

string

Default Value

Failover

Remarks

There are three switching modes available: None: Always use the default server. Failover: When the active server cannot be accessed, another server in AlternateServers will be used as the active server. LoadBalance: This option includes the feature of "Failover". In addition, the active server will also be changed after a transcation is committed.

Specify SwitchMode:

SwitchMode=Failover;

SwitchStrategy

This property allows you to specify a switching strategy to select a server from AlternateServers as the active server.

Possible Values

Sequence, Random, BestResponse

Data Type

string

Default Value

sequence

Remarks

There are three switching strategies available: Sequence: Always use the next server in AlternateServers as the active server. Random: Use a random server in AlternateServers as the active server. BestResponse: Always use the server with the shortest response time.

Specify SwitchStrategy:

SwitchStrategy=Random;

Timeout

The value in seconds until the timeout error is thrown, canceling the operation.

Data Type

int

Default Value

60

Remarks

If Timeout = 0, operations do not time out. The operations run until they complete successfully or until they encounter an error condition.

If Timeout expires and the operation is not yet complete, the connector throws an exception.