JDBC Providers policy (JDBCProviders)

Use a JDBC Providers policy to configure connection details for a database. Templates are provided for several database types.

The Java Database Connectivity (JDBC) API controls connectivity to various databases. You can use a JDBC Providers policy to control database connectivity at run time. A number of templates are provided for supported databases that provide relevant default values.

JDBCProviders policies cannot be changed after they are deployed. If you want to change this type of policy, you must delete all deployed resources from the integration server. Delete the deployed resources by using the -m parameter on the mqsideploy command, for example, and then deploy the new version of the policy.

The properties of this policy are described in the following table.
Table 1. Properties of the JDBC Providers policy
Property Property name in .policyxml file Value
Name of the database databaseName This mandatory property specifies the name of the database that the data source entry enables connections to; for example, employees.

Value type: String

Type of the database databaseType This property specifies the database type, for example, DB2®, Oracle, or Sybase. The default value for this property depends on the template that you choose.

Value type: String

Version of the database databaseVersion This property specifies the version of the database; for example, 9.1. The default value for this property depends on the template that you choose.

Value type: String

JDBC driver class name type4DriverClassName This mandatory property specifies the name of the JDBC driver class name that is used to establish a connection; for example, com.ibm.db2.jcc.DB2Driver. The default value for this property depends on the template that you choose.

Value type: String

JDBC type 4 data source class name type4DatasourceClassName This mandatory property specifies the name of the JDBC type 4 data source class name that is used to establish a type 4 connection to a remote database and for coordinated transaction support. For example, com.ibm.db2.jcc.DB2XADataSource. The default value for this property depends on the template that you choose.

Value type: String

Connection URL format connectionUrlFormat This mandatory property contains a pattern that represents the connection URL definition, which is specific to a particular database type. For example, the pattern for DB2 is defined with the following fixed content:
jdbc:db2://serverName:portNumber/databaseName
:user=userID;password=password;
The default value for this property depends on the template that you choose.

Value type: String

Connection URL format attributes 1-5
connectionUrlFormatAttr1
connectionUrlFormatAttr2
connectionUrlFormatAttr3
connectionUrlFormatAttr4
connectionUrlFormatAttr5
If the specified URL format contains non-standard JDBC data source properties, such as a server identifier, specify one of these five general-purpose connection attributes to define the additional properties.

Value type: String

Database server name serverName This mandatory property specifies the name of the server; for example, host1. This property has a default value of default_Database_Server_Name.

Value type: String

Database server port number portNumber This mandatory property specifies the port number on which the database server is listening; for example, 50000. The default value for this property depends on the template that you choose.

Value type: Integer

Type 4 driver class JARs URL jarsURL This property specifies the local directory path on the system on which the integration server is running, where the JAR file that contains the type 4 driver class is located. The default value for this property depends on the template that you choose.
Note: On operating systems that support symbolic links, jarsURL can be set to a directory path that contains symbolic links to files that are held in another location provided that the operating system implementation of symbolic links is transparent to Java file processing facilities. This method is helpful in scenarios where multiple versions of the JDBC driver exist in the same directory. Creating a symbolic link to the required JDBC driver JAR file can ensure that the type 4 driver class is loaded from the required version of the JDBC driver.

Value type: String

To access classes provided by the JDBC type 4 driver inside a JavaCompute node in a message flow, you must leave jarsURL blank in the appropriate JDBCProvider policy, and ensure that you place the JDBC driver JAR files in the appropriate shared-classes folder; for further information, see Java shared classloader.

This property cannot be used when maxConnectionPoolSize is set to a value greater than 0. You must instead provide these JARs in the system class path, CLASSPATH.

Do not use this property if there are restrictions on the number of instances of the JDBC client driver that can be created in different class loaders, for example if the JDBC client driver uses a native library. In such a circumstance, ensure that the JDBC client JAR file is either in the $MQSI_WORKPATH/shared-classes directory or the system class path, CLASSPATH.

Name of the database schema databaseSchemaNames This property specifies the name of the database schema to include in SQL statements that are created by message flow nodes. This property is used only by the Mapping node, and only when it calls a graphical data map that contains a database transform.
Valid values are:
  • An empty string, which indicates that your nodes do not include a database schema name in the SQL statements that they create.
  • The name of a single database schema. Your nodes include this schema name in all SQL statements that they create.
  • One or more database table and database schema name pairs, in the form:
    tableA:schema01;tableB:schema02
    . If a table has a table:schema name pair that is defined in this way, your nodes include the corresponding database schema name in the SQL statements that they create. If a table does not have a table:schema pair that is defined, your nodes do not include a database schema name in the SQL statements that they create.
  • The name of a database schema to use as a default, followed by one or more database table and database schema name pairs, in the form:
    defaultschema;tableA:schema01;tableB:schema02
    For tables that have a table:schema pair, your nodes include the corresponding database schema name in the SQL statements that they create. If a table does not have a table:schema pair that is defined, your nodes include the default database schema name in the SQL statements that it creates.
  • The string useProvidedSchemaNames (the default) to use the schema name that is provided in the map (the schema name that is used at design time).

Value type: String

Data source description description This property describes the data source definition.

Value type: String

Maximum size of connection pool maxConnectionPoolSize This property specifies whether connection pooling is switched on for the policy. The default value is 0, which indicates that connection pooling is switched off for the integration server. Valid values are in the range 1 - 100000.

All message flows in an integration server that use the same JDBC Providers policy share the same connection pool. Multiple JDBC Providers policies that refer to the same database have their own pool of independently controlled connections to that database. The connection pool limits the number of connections for the policy for each integration server. After you set a value for this attribute, you must stop and restart the integration server for the changes to take effect.

Value type: Integer

When connection pooling is switched on, and the value of maxConnectionPoolSize is greater than 0, you cannot also use jarsURL or useDeployedJars. Instead the type 4 driver class JARs must be provided in the system class path, CLASSPATH.

Security identity (DSN) securityIdentity This property specifies a unique key to identify a DSN entry, which provides the user ID and password credentials that are required to connect to the database system.

Some cases exist where an alternative authentication method is required; for example, when a database server takes the user identity and password from an SSL certificate to obtain a secure JDBC connection. In this case, the security key must be set to jdbc::none, which disables connection logon authentication. This property has a default value of default_User@default_Server.

Value type: String

Environment parameters environmentParms This property applies to DB2 and Informix® only, and specifies a list of data source properties in the form name=value, where each pair is separated by a semicolon.

Value type: String

Supports XA coordinated transactions jdbcProviderXASupport This property indicates whether the selected JDBC provider supports XA coordinated transactions, and the database server is enabled to use the XA transaction protocol. The JDBC type 4 data source class that is specified in the JDBC type 4 data source class name property is used to establish the connection. This property has a default value of True. If this property is set to true, and the selected JDBC provider does not support XA transactions, an exception is raised.

Setting this property to False indicates that the selected JDBC provider either does not support XA coordinated transactions, or the database server is not enabled to use the XA transaction protocol. The JDBC type 4 driver class that is specified in the JDBC driver class name property is used to establish a connection. Specify a value of False if you prefer to use the JDBC driver class rather than the data source class. If you set this property to false, but the Coordinated transaction message flow property is selected, a non-XA JDBC connection is created as a locally coordinated resource. It is not created as part of the global transaction.

Value type: Boolean

Use JAR files that are deployed in a .bar file useDeployedJars This property specifies whether to use JAR files that are deployed in a BAR . It has a default value of False.

Value type: Boolean

This property cannot be used when maxConnectionPoolSize is set to a value greater than 0. You must instead provide these JARs in the system class path, CLASSPATH.