+

Search Tips   |   Advanced Search

JDBC configuration scripts

The scripting library provides script procedures to manage Java Database Connectivity (JDBC) configurations in the environment.

AdminJDBC script procedures are located in...

Do not edit the script procedures in the script library. To avoid overwriting the library, put custom scripts in...


Scope argument

A cell is optional on node, server, and cluster scopes. A node is required on the server scope. We can delimit the type using a comma (,) or a colon (:). Use first case for the type (cell=, node=, server=, or cluster=).


createDataSource

This script creates a new data source in the configuration. The script returns the configuration ID of the new data source. To run the script, specify the node name, server name, JDBC provider, and data source name arguments. We can optionally specify attributes.

Attributes Description Example
authDataAlias Alias used for database authentication at run time. ['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.
category Category used to classify or group the resource. ['category', 'myCategory']
connectionPool JDBC connection pooling properties for the parent JDBC connection factory instance.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["connectionPool",[["agedTimeout","100"], ["connectionTimeout","1000"], ["freePoolDistributionTableSize",10], ["maxConnections","12"],["minConnections","5"], ["numberOfFreePoolPartitions","3"], ["numberOfSharedPoolPartitions","6"], ["numberOfUnsharedPoolPartitions","3"], ["properties",[["description","My description"], ["name","myName"],["required","false"],["type","String"], ["validationExpression",""],["value","myValue"]]], ["purgePolicy","EntirePool"],["reapTime","10000"], ["struckThreshold","3"],["struckTime","10"], ["struckTimerTime","10"],["surgeCreationInterval","10"], ["surgeThreshold","10"],["testConnection","true"], ["testConnectionInterval","10"], ["unusedTimeout","10000"]]]
datasourceHelperClassname DataStoreHelper implementation class that extends the capabilities of the implementation class of the JDBC driver. The extended capabilities allow the JDBC drive to perform functions specific to the data. com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper ...
description Description of the data source. ['description', 'My description']
jndiName JNDI name for this data source. ['jndiName', 'myJndiName']
logMissingTransactionContext Specifies whether missing transaction context logging is enabled. ['logMissingTransactionContext', 'false']
manageCachedHandles Specifies whether this data source is used for container-managed persistence of enterprise beans. Default is true. ['manageCachedHandles', 'false']
mapping When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["mapping",[["authDataAlias","authDataAliasValue"], ["mappingConfigAlias","mappingConfigAliasValue"]]]
preTestConfig Pretest connection configuration settings.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["preTestConfig",[["preTestConnection", "true"], "retryInterval", "12343"],"retryLimit", "4"]]]
properties Specifies either a typed property type or a descriptive property type.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["properties",[["description","My description"], ["name", "myName"],"required","false"], ["type","String"],["validationExpression",""], "value','myValue"]]]
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[name databaseName][type string][value mys]] [name driverType][type integer][value 4]] [name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
relationalResourceAdapter Relational resource adapter that the data source uses. The available Java 2 Connector (J2C) resource adapter ID of J2CResourceAdapterID can be identified with the AdminConfig.list ('J2CResourceAdapter') command. [relationalResourceAdapter "WebSphere Relational Resource Adapter(cells/pongo/nodes/pongo/servers/server1| resources.xml#builtin_rra)"]
statementCacheSize Number of statements that the product can cache for each connection. The product optimizes the processing of prepared statements and callable statements by caching statements that are not used in an active connection. Both statement types improve the performance of transactions between an application and a datastore. Caching the statements makes them more readily available. ['statementCacheSize', 5]
xaRecoveryAuthAlias Database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication. ['-xaRecoveryAuthAlias', 'myCellManager01/a1']

Attributes Description Example
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Using IBM JCC Driver']


Syntax

providerType optional attribute

Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)


Example

Required attributes only:

Optional attributes in a string format:

Include optional attributes in a list format:


createDataSourceUsingTemplate

This script uses a template to create a new data source in the configuration. The script returns the configuration ID of the new data source.

To run the script, specify the node name, server name, JDBC provider, template ID, and data source name arguments. We can optionally specify attributes:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
jdbcProvider Name of the JDBC provider of interest.
templateID Configuration ID of the template to use to create the data source.
dsName Name to assign to the new data source.
attributes

Optionally specify additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description Example
authDataAlias Alias used for database authentication at run time. ['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.
category Category used to classify or group the resource. ['category', 'myCategory']
connectionPool JDBC connection pooling properties for the parent JDBC connection factory instance.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["connectionPool",[["agedTimeout","100"], ["connectionTimeout","1000"], ["freePoolDistributionTableSize",10], ["maxConnections","12"],["minConnections","5"], ["numberOfFreePoolPartitions","3"], ["numberOfSharedPoolPartitions","6"], ["numberOfUnsharedPoolPartitions","3"], ["properties",[["description","My description"], ["name","myName"],["required","false"],["type","String"], ["validationExpression",""],["value","myValue"]]], ["purgePolicy","EntirePool"],["reapTime","10000"], ["struckThreshold","3"],["struckTime","10"], ["struckTimerTime","10"],["surgeCreationInterval","10"], ["surgeThreshold","10"],["testConnection","true"], ["testConnectionInterval","10"], ["unusedTimeout","10000"]]]
datasourceHelperClassname DataStoreHelper implementation class that extends the capabilities of the implementation class of the JDBC driver. The extended capabilities allow the JDBC drive to perform functions specific to the data. com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper
...
description Description of the data source. ['description', 'My description']
jndiName JNDI name for this data source. ['jndiName', 'myJndiName']
logMissingTransactionContext Specifies whether missing transaction context logging is enabled. ['logMissingTransactionContext', 'false']
manageCachedHandles Specifies whether this data source is used for container-managed persistence of enterprise beans. Default is true. ['manageCachedHandles', 'false']
mapping Mapping of the configuration login to a specified authentication alias name. When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["mapping",[["authDataAlias","authDataAliasValue"], ["mappingConfigAlias","mappingConfigAliasValue"]]]
preTestConfig Pretest connection configuration settings.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["preTestConfig",[["preTestConnection", "true"], "retryInterval", "12343"],"retryLimit", "4"]]]
properties Specifies either a typed property type or a descriptive property type.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["properties",[["description","My description"], ["name", "myName"],"required","false"], ["type","String"],["validationExpression",""], "value','myValue"]]]
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[name databaseName][type string][value mys]] [name driverType][type integer][value 4]] [name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
relationalResourceAdapter Relational resource adapter that the data source uses. The available Java 2 Connector (J2C) resource adapter ID of J2CResourceAdapterID can be identified with the AdminConfig.list('J2CResourceAdapter') command. [relationalResourceAdapter "WebSphere Relational Resource Adapter(cells/pongo/nodes/pongo/servers/server1| resources.xml#builtin_rra)"]
statementCacheSize Number of statements that the product can cache for each connection. The product optimizes the processing of prepared statements and callable statements by caching statements that are not used in an active connection. Both statement types improve the performance of transactions between an application and a datastore. Caching the statements makes them more readily available. ['statementCacheSize', 5]
xaRecoveryAuthAlias Database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication. ['-xaRecoveryAuthAlias', 'myCellManager01/a1']

Attributes Description Example
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Using IBM JCC Driver']


Syntax

providerType optional attribute

Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)


Example

Required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createDataSourceAtScope

Create a New data source in the configuration at the scope specified. The script returns the configuration ID of the new data source. The script procedure uses the createDatasource administrative command to create a new data source. The createDataSource script creates a new data source using the AdminConfig create command.

To run the script, specify the scope, JDBC provider, data source name, database name arguments, and a description. We can optionally specify attributes.

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
JDBCName Name of the JDBC provider of interest.
datasourceName Name to assign to the new data source.
jndiName JNDI name for this data source.
dataStoreHelperClassName DataStoreHelper implementation class that extends the capabilities of the selected JDBC driver implementation class to perform data-specific functions.
dbName (URL for the Oracle database) Name to assign the database for the JDBC provider. For a JDBC provider that uses the Oracle database, the argument specifies the URL of the database from which the datasource obtains connections. Examples are jdbc:oracle:thin:@localhost:1521:sample for a thin driver and jdbc:oracle:oci8:@sample for a thick driver.

description Description of the data source.
otherAttributes Additional attributes in a particular format:

List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
ue2"
resoureAttributes Attributes in a particular format:

List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
failonerror Administrative utilities that process an error condition.

Attributes Description
category Classify or group the resource.
componentManagedAuthenticationAlias Alias used for database authentication at runtime.
containerManagedPersistence When true container managed persistence is enabled
description Description of the data source.
xaRecoveryAuthAlias Database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication.

Attributes Description
driverType Data source type. The data source type is valid only for JDBC providers that have a database type of DB2.
portNumber Port number of the database server. The port number is valid only for JDBC providers that have a database type of DB2, Informix, Sybase, or SQLServer.
serverName Host name of the database server or IP address. The server name is valid only for JDBC providers that have a database type of DB2, Informix, Sybase, or SQLServer.
ifxIFHOST Connection wait time for obtaining a lock on the database. By default, the Informix database returns an error when it cannot acquire a lock, rather than wait for the current owner of the lock to release it. To modify the behavior, set the property to the number of seconds to wait for a lock. The default is 2 seconds. Any negative value translates into an unlimited wait time. This attribute is valid only for JDBC providers that have a database type of Informix.
informixLockModeWait Physical machine name of the server hosting the Informix instance. We can enter a host name or IP address. We can also enter an Internet Protocol v6 (IPv6) if the host database supports it. This attribute is valid only for JDBC providers that have a database type of Informix.


Syntax


Example

Required attributes only:

Examples scripts for the DB2 database type:

Include optional attributes in a string format:

Include optional attributes in a list format:

Examples scripts for the Derby database:

Optional attributes in a string format:

Include optional attributes in a list format:


Example scripts for Informix database:

Include optional attributes in a string format:

Include optional attributes in a list format:


Example scripts for Oracle database:

Optional attributes in a string format:

Optional attributes in a list format:

Example scripts for SQLServer database:

Optional attributes in a string format:

Include optional attributes in a list format:


Example scripts for Sybase database:

Optional attributes in a string format:

Include optional attributes in a list format:


createDataSourceUsingTemplateAtScope

Use a template to create a new data source in the configuration at the scope specified. The script returns the configuration ID of the new data source. To run the script, specify the scope, JDBC provider, template ID, and data source name arguments. We can optionally specify attributes.

Attributes Description Example
authDataAlias Alias used for database authentication at run time. ['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.
category Category used to classify or group the resource. ['category', 'myCategory']
connectionPool JDBC connection pooling properties for the parent JDBC connection factory instance.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["connectionPool",[["agedTimeout","100"], ["connectionTimeout","1000"], ["freePoolDistributionTableSize",10], ["maxConnections","12"],["minConnections","5"], ["numberOfFreePoolPartitions","3"], ["numberOfSharedPoolPartitions","6"], ["numberOfUnsharedPoolPartitions","3"], ["properties",[["description","My description"], ["name","myName"],["required","false"],["type","String"], ["validationExpression",""],["value","myValue"]]], ["purgePolicy","EntirePool"],["reapTime","10000"], ["struckThreshold","3"],["struckTime","10"], ["struckTimerTime","10"],["surgeCreationInterval","10"], ["surgeThreshold","10"],["testConnection","true"], ["testConnectionInterval","10"], ["unusedTimeout","10000"]]]
datasourceHelperClassname DataStoreHelper implementation class that extends the capabilities of the implementation class of the JDBC driver. The extended capabilities allow the JDBC drive to perform functions specific to the data. com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper
...
description Description of the data source. ['description', 'My description']
jndiName JNDI name for this data source. ['jndiName', 'myJndiName']
logMissingTransactionContext Specifies whether missing transaction context logging is enabled. ['logMissingTransactionContext', 'false']
manageCachedHandles Specifies whether this data source is used for container-managed persistence of enterprise beans. Default is true. ['manageCachedHandles', 'false']
mapping Mapping of the configuration login to a specified authentication alias name.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["mapping",[["authDataAlias","authDataAliasValue"], ["mappingConfigAlias","mappingConfigAliasValue"]]]
preTestConfig Pretest connection configuration settings.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["preTestConfig",[["preTestConnection", "true"], "retryInterval", "12343"],"retryLimit", "4"]]]
properties Specifies either a typed property type or a descriptive property type.

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

["properties",[["description","My description"], ["name", "myName"],"required","false"], ["type","String"],["validationExpression",""], "value','myValue"]]]
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[name databaseName][type string][value mys]] [name driverType][type integer][value 4]] [name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
relationalResourceAdapter Relational resource adapter that the data source uses. The available Java 2 Connector (J2C) resource adapter ID of J2CResourceAdapterID can be identified with the AdminConfig.list('J2CResourceAdapter') command. [relationalResourceAdapter "WebSphere Relational Resource Adapter(cells/pongo/nodes/pongo/servers/server1| resources.xml#builtin_rra)"]
statementCacheSize Number of statements that the product can cache for each connection. The product optimizes the processing of prepared statements and callable statements by caching statements that are not used in an active connection. Both statement types improve the performance of transactions between an application and a datastore. Caching the statements makes them more readily available. ['statementCacheSize', 5]
xaRecoveryAuthAlias Database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication. ['-xaRecoveryAuthAlias', 'myCellManager01/a1']

Attributes Description Example
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Using IBM JCC Driver']


Syntax

providerType optional attribute

Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)


Example

Required attributes only:

Optional attributes in a string format:

Optional attributes in a list format:


createJDBCProvider

Create a New JDBC provider in the environment. The script returns the configuration ID of the new JDBC provider. To run the script, specify the node name, server name, JDBC provider, and implementation class arguments. We can optionally specify attributes.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
jdbcProvider Name to assign to the new JDBC provider.
implementationClass Name of the implementation class to use.
attributes Optionally specify additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description Example
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
    ['-classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar; ${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar; ${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar']
description Description of the resource adapter. ['description', 'My description']
isolatedClassLoader If true, specify that the resource provider is loaded in its own class loader.

A provider cannot be isolatedClassLoader when a native library path is specified.

['isolatedClassLoader', 'false']
nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). ['-nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}']

Attributes Description Example
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[[name databaseName][type string][value mys]] [[name driverType][type integer][value 4]] [[name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If true, data sources for the provider produce connections that applications use in two-phase commit, global transactions. If set to false, the data sources produce connections that applications use in single-phase commit, local transactions. true false


Syntax

Implementation class optional attribute

Syntax

Find the implementationClassName attribute by specifying the JDBC provider template ID for JDBCProvID:

    AdminConfig.showAttribute(JDBCProvID,'implementationClassName')

    implementationClassName attribute example usage:

      print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")

    Result:

      com.ibm.db2.jcc.DB2XADataSource

    Some possible implementation class names:

    • com.ibm.db2.jcc.DB2ConnectionPoolDataSource
    • com.ibm.db2.jcc.DB2XADataSource
    • com.ibm.db2.jdbc.app.UDBConnectionPoolDataSource
    • com.ibm.db2.jdbc.app.UDBXADataSource
    • com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
    • com.ibm.as400.access.AS400JDBCXADataSource
    • org.apache.derby.jdbc.ClientConnectionPoolDataSource
    • org.apache.derby.jdbc.ClientXADataSource
    • org.apache.derby.jdbc.ClientConnectionPoolDataSource40
    • org.apache.derby.jdbc.ClientXADataSource40
    • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40
    • org.apache.derby.jdbc.EmbeddedXADataSource40
    • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource
    • org.apache.derby.jdbc.EmbeddedXADataSource
    • com.informix.jdbcx.IfxConnectionPoolDataSource
    • com.informix.jdbcx.IfxXADataSource oracle.jdbc.pool.OracleConnectionPoolDataSource
    • oracle.jdbc.xa.client.OracleXADataSource
    • com.sybase.jdbc3.jdbc.SybConnectionPoolDataSource
    • com.sybase.jdbc3.jdbc.SybXADataSource
    • com.sybase.jdbc4.jdbc.SybConnectionPoolDataSource
    • com.sybase.jdbc4.jdbc.SybXADataSource
    • com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource
    • com.microsoft.sqlserver.jdbc.SQLServerXADataSource
    • com.ddtek.jdbcx.sqlserver.SQLServerDataSource

providerType optional attribute


Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)


Example

Required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createJDBCProviderUsingTemplate

Use a template to create a new JDBC provider in the environment. The script returns the configuration ID of the new JDBC provider. To run the script, specify the node name, server name, template ID, JDBC provider name, and implementation class arguments. We can optionally specify attributes:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
templateID Configuration ID of the template to use to create the JDBC provider.
jdbcProvider Name to assign to the new JDBC provider.
implementationClass Name of the implementation class to use.
attributes Optionally specify additional attributes in a particular format:

List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"

Attributes Description Example
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths. ['-classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar; ${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar; ${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar']
description Description of the resource adapter. ['description', 'My description']
isolatedClassLoader If true, specify that the resource provider is loaded in its own class loader.

A provider cannot be isolatedClassLoader when a native library path is specified.

['isolatedClassLoader', 'false']
nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). ['-nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}']

Attributes Description Example
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[[name databaseName][type string][value mys]] [[name driverType][type integer][value 4]] [[name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If true, data sources for the provider produce connections that applications use in two-phase commit, global transactions. If set to false, the data sources produce connections that applications use in single-phase commit, local transactions. true false


Syntax

Implementation class optional attribute

Syntax

Find the implementationClassName attribute by specifying the JDBC provider template ID for JDBCProvID:

    AdminConfig.showAttribute(JDBCProvID,'implementationClassName')

implementationClassName attribute example usage:

    print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")

Result:

    com.ibm.db2.jcc.DB2XADataSource

Some possible implementation class names:

  • com.ibm.db2.jcc.DB2ConnectionPoolDataSource
  • com.ibm.db2.jcc.DB2XADataSource
  • com.ibm.db2.jdbc.app.UDBConnectionPoolDataSource
  • com.ibm.db2.jdbc.app.UDBXADataSource
  • com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
  • com.ibm.as400.access.AS400JDBCXADataSource
  • org.apache.derby.jdbc.ClientConnectionPoolDataSource
  • org.apache.derby.jdbc.ClientXADataSource
  • org.apache.derby.jdbc.ClientConnectionPoolDataSource40
  • org.apache.derby.jdbc.ClientXADataSource40
  • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40
  • org.apache.derby.jdbc.EmbeddedXADataSource40
  • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource
  • org.apache.derby.jdbc.EmbeddedXADataSource
  • com.informix.jdbcx.IfxConnectionPoolDataSource
  • com.informix.jdbcx.IfxXADataSource oracle.jdbc.pool.OracleConnectionPoolDataSource
  • oracle.jdbc.xa.client.OracleXADataSource
  • com.sybase.jdbc3.jdbc.SybConnectionPoolDataSource
  • com.sybase.jdbc3.jdbc.SybXADataSource
  • com.sybase.jdbc4.jdbc.SybConnectionPoolDataSource
  • com.sybase.jdbc4.jdbc.SybXADataSource
  • com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource
  • com.microsoft.sqlserver.jdbc.SQLServerXADataSource
  • com.ddtek.jdbcx.sqlserver.SQLServerDataSource

providerType optional attribute


Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)


Example

Required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createJDBCProviderAtScope

Create a New JDBC provider in the environment at the scope specified. The script returns the configuration ID of the new JDBC provider. The script procedure uses the createJDBCProvider administrative command to create a new JDBC provider. The createJDBCProvider script procedure creates a new JDBC provider using the AdminConfig create command.

To run the script, specify the scope, JDBC provider, database type, provider type, and implementation types arguments. We can optionally specify attributes:

Attributes Description Example
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths. ['-classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar; ${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar; ${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar']
description Description of the resource adapter. ['description', 'My description']
isolatedClassLoader If true, specify that the resource provider is loaded in its own class loader. A provider cannot be isolatedClassLoader when a native library path is specified. ['isolatedClassLoader', 'false']
nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). ['-nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}']

Attributes Description
implementationClassName The implementation class to use for a given JDBC provider template.

providerType optional attribute


Syntax

Find the JDBC provider type name. Only JDBC provider template IDs that contain the templates/system|jdbc-resource-provider-templates.xml substring have valid JDBC Provider type names. The JDBC provider type name and its substring form the JDBC provider template ID.

Example partial result showing the JDBC provider template ID for the JDBC provider type name of Derby JDBC Provider (XA):

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)

Some JDBC provider template IDs:

    Derby JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)
    DB2 Legacy CLI-based Type 2 JDBC Driver (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_4)
    DB2 UDB for iSeries (Native - V5R1 and earlier) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2400_5)"
    DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)

implementationClassName attribute


Syntax

Find the implementationClassName attribute by specifying the JDBC provider template ID for JDBCProvID:

    AdminConfig.showAttribute(JDBCProvID,'implementationClassName')

implementationClassName attribute example usage:

    print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")

Result:

    com.ibm.db2.jcc.DB2XADataSource
Some possible implementation class names:

  • com.ibm.db2.jcc.DB2ConnectionPoolDataSource
  • com.ibm.db2.jcc.DB2XADataSource
  • com.ibm.db2.jdbc.app.UDBConnectionPoolDataSource
  • com.ibm.db2.jdbc.app.UDBXADataSource
  • com.ibm.as400.access.AS400JDBCConnectionPoolDataSource
  • com.ibm.as400.access.AS400JDBCXADataSource
  • org.apache.derby.jdbc.ClientConnectionPoolDataSource
  • org.apache.derby.jdbc.ClientXADataSource
  • org.apache.derby.jdbc.ClientConnectionPoolDataSource40
  • org.apache.derby.jdbc.ClientXADataSource40
  • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40
  • org.apache.derby.jdbc.EmbeddedXADataSource40
  • org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource
  • org.apache.derby.jdbc.EmbeddedXADataSource
  • com.informix.jdbcx.IfxConnectionPoolDataSource
  • com.informix.jdbcx.IfxXADataSource oracle.jdbc.pool.OracleConnectionPoolDataSource
  • oracle.jdbc.xa.client.OracleXADataSource
  • com.sybase.jdbc3.jdbc.SybConnectionPoolDataSource
  • com.sybase.jdbc3.jdbc.SybXADataSource
  • com.sybase.jdbc4.jdbc.SybConnectionPoolDataSource
  • com.sybase.jdbc4.jdbc.SybXADataSource
  • com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource
  • com.microsoft.sqlserver.jdbc.SQLServerXADataSource
  • com.ddtek.jdbcx.sqlserver.SQLServerDataSource

createJDBCProviderAtScope script


Syntax


Example

Required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createJDBCProviderUsingTemplateAtScope

Create a new JDBC provider in the environment at the scope specified. The script returns the configuration ID of the new JDBC provider. To run the script, specify the scope, template ID, JDBC provider name, and implementation class arguments. We can optionally specify attributes:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
templateID Configuration ID of the template to use to create the JDBC provider.
jdbcProvider Name to assign to the new JDBC provider.
implementationClassName Name of the implementation class to use.
attributes Optionally specify additional attributes in a particular format:

    List format
    [["attr1", "value1"], ["attr2", "value2"]]
    String format
    "attr1=value1, attr2=value2"

Attributes Description Example
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths. ['-classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar; ${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar; ${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar']
description Description of the resource adapter. ['description', 'My description']
isolatedClassLoader If true, specify that the resource provider is loaded in its own class loader. A provider cannot be isolatedClassLoader when a native library path is specified. ['isolatedClassLoader', 'false']
nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). ['-nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}']

Attributes Description Example
propertySet Optionally specify resource properties in the following format:

[propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When using this attribute in a script, use the list format. The string format does not work because this attribute is a configuration object type.

[propertySet [[resourceProperties [[[name databaseName][type string][value mys]] [[name driverType][type integer][value 4]] [[name serverName][type string][value localhost]] [[name portNumber][type integer][value 50000]] ]]]]
providerType The JDBC provider type that this JDBC provider uses. ['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If true, data sources for the provider produce connections that applications use in two-phase commit, global transactions. If set to false, the data sources produce connections that applications use in single-phase commit, local transactions. true|false

createJDBCProviderUsingTemplateAtScope script


Syntax


Example

Required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


See also

  1. Use the script library to automate the application serving environment
  2. Automating data access resource configuration
  3. JDBC query scripts
  4. JMS query scripts
  5. JMS configuration scripts
  6. J2C configuration scripts
  7. J2C query scripts