JDBC configuration scripts

The scripting library provides many script procedures to manage Java™ Database Connectivity (JDBC) configurations in your environment. See the usage information for scripts that configure JDBC settings. You can run each script individually or combine many procedures to create custom automation scripts for your environment.

Each AdminJDBC script procedure is located in the app_server_root/scriptLibraries/resources/JDBC/V70 directory.

Beginning with Version 7, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the server scope. You can write your own custom scripts to configure resources at the cell, node, or cluster level.
Avoid trouble: Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the app_server_root/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.
Fast path: Beginning with Fix Pack 5, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the cell, node, server, or cluster scope. Resource providers include mail providers, URL providers, and resource environment providers. You do not have to write custom scripts to configure resources at a particular scope.
Attention: The example usage scripts and the script syntax are split on multiple lines for printing purposes.

Format for the scope argument

The scope format applies to the scripts in the script library that have the scope argument.

A cell is optional on node, server, and cluster scopes. A node is required on the server scope.

You can delimit the type by using a comma (,) or a colon (:). You can use lowercase for the type (cell=, node=, server=, or cluster=.)

The examples in the following table are split on multiple lines for publishing purposes.

Table 1. Examples of the containment path, configuration ID, and type for a particular scope . The scope can be Cell, Node, Server, or Cluster.
Scope Containment path Configuration ID Type
Cell /Cell:myCell/
myCell(cells/myCell|
cell.xml#Cell_1)
Cell=myCell or cell=myCell
Node /Cell:myCell/Node:myNode/ or /Node:myNode/
myNode(cells/myCell
/nodes/myNode|
node.xml#Node_1)
Cell=myCell,
Node=myNode
or
Cell=myCell:
Node=myNode
or
cell=myCell,
node=myNode
Server
/Cell:myCell/Node:
myNode/
Server:myServer/
or
/Node:myNode/Server:
myServer/
myServer(cells
/myCell/
nodes/myNode/
servers/myServer|
server.xml#Server_1)
Cell=myCell,
Node=myNode,
Server=myServer
or
Node=myNode:
Server=myServer
or
cell=myCell,
Node=myNode,
Server=myServer
Cluster
/Cell:myCell/
ServerCluster:
myCluster/
or
/ServerCluster:
myCluster/
myCluster(cells
/myCell/clusters/
myCluster|
cluster.xml
#ServerCluster_1)
Cell=myCell,
Cluster=myCluster
or
Cell=myCell:
Cluster=myCluster
or
cell=myCell,
Cluster=myCluster

createDataSource

This script creates a new data source in your 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 2. createDataSource script . Required and optional arguments.
Argument Description
nodeName Specifies the name of the node of interest.
serverName Specifies the name of the server of interest.
jdbcProvider Specifies the name of the JDBC provider of interest.
dsName Specifies the name to assign to the new data source.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 3. Optional attributes . Several scripts have these attributes.
Attributes Description Example
authDataAlias Specifies the alias used for database authentication at run time.
['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Specifies the authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.  
category Specifies the category that can be used to classify or group the resource.
['category', 'myCategory']
connectionPool Specifies the JDBC connection pooling properties for the parent JDBC connection factory instance.

When you use 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 Specifies the name of the 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 that are specific to the data.
com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper
...
description Specifies a description of the data source.
['description', 'My description']
jndiName Specifies the Java Naming and Directory Interface (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. The default value is true.
['manageCachedHandles', 'false']
mapping Specifies the mapping of the configuration login to a specified authentication alias name.

When you use 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 Specifies the pretest connection configuration settings.

When you use 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 you use 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 specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the 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 Specifies the 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 Specifies the 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']
Table 4. Optional attributes, continued . The providerType attribute is also available for the script.
Attributes Description Example
providerType Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Using IBM JCC Driver']

Syntax

providerType optional attribute

Syntax

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)
AdminJDBC.createDataSource(nodeName, serverName, 
 jdbcProvider, dsName, attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createDataSource("myNode", "myServer", "myJDBCProvider", 
 "myDataSource")
The following example script includes optional attributes in a string format:
AdminJDBC.createDataSource("IBM-F4A849C57A0Node01", "server1", "My JDBC Name2", "MyJDBCDS", 
"authDataAlias=cellManager01/myAuthDataAlias, authMechanismPreference=BASIC_PASSWORD, category=myCategory, 
datasourceHelperClassname=com.ibm.websphere.rsadapter.DB2DataStoreHelper, 
description='My description', diagnoseConnectionUsage=true, jndiName=myJndiName, 
logMissingTransactionContext=false, manageCachedHandles=false, providerType='DB2 Using IBM JCC Driver', 
xaRecoveryAuthAlias=myCellManager01/xa1")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSource("IBM-F4A849C57A0Node01", "server1", "My JDBC Name2", "MyJDBCDS", 
[['authDataAlias', 'cellManager01/myAuthDataAlias'], ['authMechanismPreference', 'BASIC_PASSWORD'], 
['category', 'myCategory'], ['connectionPool', [['agedTimeout', 100], 
['connectionTimeout', 1000], ['freePoolDistributionTableSize', 10], ['maxConnections', 12], ['minConnections', 5], 
['numberOfFreePoolPartitions', 3], ['numberOfSharedPoolPartitions', 6], ['numberOfUnsharedPoolPartitions', 3], 
['properties', [[['name', 'name1a'], ['value', 'value1a']], [['name', 'name1b'], ['value', 'value1b']]]], 
['purgePolicy', 'EntirePool'], ['reapTime', 10000], ['stuckThreshold', 3], ['stuckTime', 10], ['stuckTimerTime', 10], 
['surgeThreshold', 10], ['testConnection', 'true']]], ['datasourceHelperClassname', 
'com.ibm.websphere.rsadapter.DB2DataStoreHelper'], 
['description', 'My description'], ['diagnoseConnectionUsage', 'true'], ['jndiName', 'myJndiName'], 
['logMissingTransactionContext', 'false'], 
['manageCachedHandles', 'false'], ['mapping', [['authDataAlias', 'anAlias'], ['mappingConfigAlias', 'anotherTest']]], 
['preTestConfig', [['preTestConnection', 'true'], ['retryInterval', 12343], ['retryLimit', 4]]], ['properties', 
[[['name', 'name1'], ['value', 'value1']], [['name', 'name2'], ['value', 'value2']]]], ['propertySet', 
[['resourceProperties', [[['name', 'databaseName'], ['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], 
['type', 'integer'], ['value', 4]], [['name', 'serverName'], ['type', 'String'], ['value', 'localhost']], 
[['name', 'portNumber'], ['type', 'integer'], ['value', 50000]]]]]], ['providerType', 'DB2 Using IBM JCC Driver'], 
['relationalResourceAdapter', 'SIB JMS Resource Adapter
(cells/IBM-F4A849C57A0Cell01/nodes/IBM-F4A849C57A0Node01/servers/server1|resources.xml#J2CResourceAdapter_1232911649746)'], 
['statementCacheSize', 5], ['xaRecoveryAuthAlias', 'myCellManager01/xa1']])

createDataSourceUsingTemplate

This script uses a template to create a new data source in your 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 5. createDataSourceUsingTemplate script . Required and optional arguments.
Argument Description
nodeName Specifies the name of the node of interest.
serverName Specifies the name of the server of interest.
jdbcProvider Specifies the name of the JDBC provider of interest.
templateID Specifies the configuration ID of the template to use to create the data source.
dsName Specifies the name to assign to the new data source.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 6. Optional attributes . Several scripts have these attributes.
Attributes Description Example
authDataAlias Specifies the alias used for database authentication at run time.
['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Specifies the authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.  
category Specifies the category that can be used to classify or group the resource.
['category', 'myCategory']
connectionPool Specifies the JDBC connection pooling properties for the parent JDBC connection factory instance.

When you use 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 Specifies the name of the 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 that are specific to the data.
com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper
...
description Specifies a description of the data source.
['description', 'My description']
jndiName Specifies the Java Naming and Directory Interface (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. The default value is true.
['manageCachedHandles', 'false']
mapping Specifies the mapping of the configuration login to a specified authentication alias name.

When you use 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 Specifies the pretest connection configuration settings.

When you use 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 you use 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 specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the 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 Specifies the 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 Specifies the 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']
Table 7. Optional attributes, continued . Several scripts have this attribute.
Attributes Description Example
providerType Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Using IBM JCC Driver']

Syntax

providerType optional attribute

Syntax

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)
AdminJDBC.createDataSourceUsingTemplate(nodeName, 
 serverName, jdbcProvider, templateID, dsName, 
 attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createDataSourceUsingTemplate("myNode", "myServer", 
 "myJDBCProvider", "Derby JDBC Driver 
 DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_derby_1)", "myDataSource")
The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceUsingTemplate("IBM-F4A849C57A0Node01", "server1", "My JDBC Name2", 
"DB2 Universal JDBC Driver DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_DB2_UNI_1)", 
"MyJDBCDS", "authDataAlias=cellManager01/myAuthDataAlias, authMechanismPreference=BASIC_PASSWORD, category=myCategory, 
datasourceHelperClassname=com.ibm.websphere.rsadapter.DB2DataStoreHelper, description='My description', 
diagnoseConnectionUsage=true, jndiName=myJndiName, logMissingTransactionContext=false, manageCachedHandles=false, 
providerType='DB2 Using IBM JCC Driver', xaRecoveryAuthAlias=myCellManager01/xa1")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceUsingTemplate("IBM-F4A849C57A0Node01", "server1", "My JDBC Name2", 
"DB2 Universal JDBC Driver DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_DB2_UNI_1)", 
"MyJDBCDS", [['authDataAlias', 'cellManager01/myAuthDataAlias'], ['authMechanismPreference', 'BASIC_PASSWORD'], 
['category', 'myCategory'], ['connectionPool', [['agedTimeout', 100], ['connectionTimeout', 1000], 
['freePoolDistributionTableSize', 10], 
['maxConnections', 12], 
['minConnections', 5], ['numberOfFreePoolPartitions', 3], ['numberOfSharedPoolPartitions', 6], 
['numberOfUnsharedPoolPartitions', 3], 
['properties', [[['name', 'name1a'], ['value', 'value1a']], [['name', 'name1b'], ['value', 'value1b']]]], 
['purgePolicy', 'EntirePool'], ['reapTime', 10000], ['stuckThreshold', 3], ['stuckTime', 10], ['stuckTimerTime', 10], 
['surgeThreshold', 10], ['testConnection', 'true']]], ['datasourceHelperClassname', 
'com.ibm.websphere.rsadapter.DB2DataStoreHelper'], 
['description', 'My description'], ['diagnoseConnectionUsage', 'true'], ['jndiName', 'myJndiName'], 
['logMissingTransactionContext', 'false'], 
['manageCachedHandles', 'false'], ['mapping', [['authDataAlias', 'anAlias'], ['mappingConfigAlias', 'anotherTest']]], 
['preTestConfig', [['preTestConnection', 'true'], ['retryInterval', 12343], ['retryLimit', 4]]],
 ['properties', [[['name', 'name1'], 
['value', 'value1']], [['name', 'name2'], ['value', 'value2']]]], ['propertySet', [['resourceProperties', 
[[['name', 'databaseName'], ['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], 
['type', 'integer'], ['value', 4]], 
[['name', 'serverName'], ['type', 'String'], ['value', 'localhost']], [['name', 'portNumber'], ['type', 'integer'], 
['value', 50000]]]]]], ['providerType', 'DB2 Using IBM JCC Driver'], 
['relationalResourceAdapter', 
'SIB JMS Resource Adapter(cells/IBM-F4A849C57A0Cell01/clusters/c1|resources.xml#J2CResourceAdapter_1232911649746)'], 
['statementCacheSize', 5], ['xaRecoveryAuthAlias', 'myCellManager01/xa1']])

createDataSourceAtScope

This script creates a new data source in your configuration at the scope that you specify. 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, and database name arguments. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 8. createDataSourceAtScope script . Required and optional arguments.
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
JDBCName Specifies the name of the JDBC provider of interest.
datasourceName Specifies the name to assign to the new data source.
jndiName Specifies the Java Naming and Directory Interface (JNDI) name for this data source.
dataStoreHelperClassName Specifies the name of the 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) Specifies the 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.

otherAttributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
resoureAttributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
failonerror Specifies the administrative utilities that process an error condition.
Table 9. Optional attributes . Several scripts have these attributes.
Attributes Description
category Specifies the category that can be used to classify or group the resource.
componentManagedAuthenticationAlias Specifies the alias used for database authentication at runtime.
containerManagedPersistence Specifies that container managed persistence is enabled when set to true.
description Specifies a description of the data source.
xaRecoveryAuthAlias Specifies the database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication.
Table 10. Resource attributes . Several scripts have these attributes.
Attributes Description
driverType Specifies the data source type. The data source type is valid only for JDBC providers that have a database type of DB2.
portNumber Specifies the 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 Specifies the 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 Specifies the 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 Specifies the physical machine name of the server hosting the Informix instance. You can enter a host name or IP address. You can also enter an Internet Protocol Version 6 (IPv6) if the host database supports it. This attribute is valid only for JDBC providers that have a database type of Informix.

Syntax

AdminJDBC.createDataSourceAtScope(scope,
 jdbcProvider, dsName, databaseName, attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createDataSourceAtScope("myScope",  "myJDBCProvider", 
 "myDataSource", "myDatabase")

Examples scripts for the DB2® database type:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"MyTestJDBCProviderName", "newds2", "newds2/jndi", "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper", "db1", 
" category=myCategory, componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, containerManagedPersistence=true, 
description='My description', xaRecoveryAuthAlias=CellManager01/xaAliase", "serverName=localhost, 
driverType=4,portNumber=50000")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"MyTestJDBCProviderName", "newds2", "newds2/jndi", "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper", 
"db1", [['category', 'myCategory'], ['componentManagedAuthenticationAlias',
'CellManager01/AuthDataAliase'], ['containerManagedPersistence', 'true'], ['description', 'My description'], 
['xaRecoveryAuthAlias', 'CellManager01/xaAliase']] , [['serverName', 'localhost'], 
['driverType', 4], ['portNumber', 50000]])

Examples scripts for the Derby database:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Derby JDBC Provider", "Derby DataSource", "newds2/jndi", "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper", 
"db1",  " category=myCategory, componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, 
containerManagedPersistence=true, description=My description, xaRecoveryAuthAlias=CellManager01/xaAliase")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Derby JDBC Provider", "Derby DataSource", "newds2/jndi", "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper", 
"db1",  [['category', 'myCategory'], ['componentManagedAuthenticationAlias', 'CellManager01/AuthDataAliase'], 
['containerManagedPersistence', 'true'], ['description', 'My description'], ['xaRecoveryAuthAlias', 
'CellManager01/xaAliase']])

Examples scripts for the Informix database:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01", "Informix JDBC Driver Test", "My DataSource", 
"My JNDIName", "com.ibm.websphere.rsadapter.InformixDataStoreHelper", "MyDB", " category=myCategory, 
componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, containerManagedPersistence=true, 
description='My description', 
xaRecoveryAuthAlias=CellManager01/xaAliase", "serverName=ol_myserver, portNumber=50000, ifxIFXHOST=localhost, 
informixLockModeWait=2") 

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01", "Informix JDBC Driver Test", "My DataSource", 
"My JNDIName", "com.ibm.websphere.rsadapter.InformixDataStoreHelper", "MyDB", [['category', 'myCategory'], 
['componentManagedAuthenticationAlias', 'CellManager01/AuthDataAliase'], ['containerManagedPersistence', 'true'], 
['description', 'My description'], ['xaRecoveryAuthAlias', 'CellManager01/xaAliase']] , [['serverName', 'ol_myserver'], 
['portNumber', 1526], ['ifxIFXHOST', 'localhost'], ['informixLockModeWait', 2]])

Examples scripts for the Oracle database:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Oracle JDBC Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.OracleDataStoreHelper", 
"http://myURL.com",  "category=myCategory, componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, 
containerManagedPersistence=true, description='My description', xaRecoveryAuthAlias=CellManager01/xaAliase")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Oracle JDBC Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.OracleDataStoreHelper", 
"http://myURL.com",  
[['category', 'myCategory'], ['componentManagedAuthenticationAlias', 'CellManager01/AuthDataAliase'], 
['containerManagedPersistence', 'true'], ['description', 'My description'], ['xaRecoveryAuthAlias',
 'CellManager01/xaAliase']])

Examples scripts for the SQLServer database:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Microsoft SQL Server JDBC Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.SQLserverDataStoreHelper", 
"myDBName", " category=myCategory, componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, 
containerManagedPersistence=true, description='My description', xaRecoveryAuthAlias=CellManager01/xaAliase", 
"serverName=localhost, portNumber=1433")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Microsoft SQL Server JDBC Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.SQLserverDataStoreHelper", 
"myDBName", [['category', 'myCategory'], ['componentManagedAuthenticationAlias', 'CellManager01/AuthDataAliase'], 
['containerManagedPersistence', 'true'], ['description', 'My description'], ['xaRecoveryAuthAlias', 'CellManager01/xaAliase']] , 
[['serverName', 'localhost'], ['portNumber', 1433]])

Examples scripts for the Sybase database:

The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Sybase JDBC 3 Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.SybaseserverDataStoreHelper", 
"myDBName", " category=myCategory, componentManagedAuthenticationAlias=CellManager01/AuthDataAliase, 
containerManagedPersistence=true, description='My description', xaRecoveryAuthAlias=CellManager01/xaAliase", 
"serverName=localhost, portNumber=1433")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceAtScope("Cell=IBM-F4A849C57A0Cell01,Node=IBM-F4A849C57A0Node01,Server=server1", 
"Sybase JDBC 3 Driver", "My DataSource", "My JNDIName", "com.ibm.websphere.rsadapter.SybaseserverDataStoreHelper", 
"myDBName", [['category', 'myCategory'], ['componentManagedAuthenticationAlias', 'CellManager01/AuthDataAliase'], 
['containerManagedPersistence', 'true'], ['description', 'My description'], ['xaRecoveryAuthAlias', 'CellManager01/xaAliase']] , 
[['serverName', 'localhost'], ['portNumber', 2638]])

createDataSourceUsingTemplateAtScope

This script uses a template to create a new data source in your configuration at the scope that you specify. 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 11. createDataSourceUsingTemplateAtScope script . Required and optional arguments.
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
jdbcProvider Specifies the name of the JDBC provider of interest.
templateID Specifies the configuration ID of the template to use to create the data source.
dsName Specifies the name to assign to the new data source.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 12. Optional attributes . Several scripts have these attributes.
Attributes Description Example
authDataAlias Specifies the alias used for database authentication at run time.
['authDataAlias', 'myAuthDataAlias']
authMechanismPreference Specifies the authentication mechanism. Valid values are BASIC_PASSWORD for basic authentication and KERBEROS for Kerberos authentication.  
category Specifies the category that can be used to classify or group the resource.
['category', 'myCategory']
connectionPool Specifies the JDBC connection pooling properties for the parent JDBC connection factory instance.

When you use 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 Specifies the name of the 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 that are specific to the data.
com.ibm.websphere.rsadapter.DB2DataStoreHelper
com.ibm.websphere.rsadapter.DerbyDataStoreHelper
...
description Specifies a description of the data source.
['description', 'My description']
jndiName Specifies the Java Naming and Directory Interface (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. The default value is true.
['manageCachedHandles', 'false']
mapping Specifies the mapping of the configuration login to a specified authentication alias name.

When you use 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 Specifies the pretest connection configuration settings.

When you use 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 you use 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 specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the 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 Specifies the 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 Specifies the 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']
Table 13. Optional attributes, continued . Several scripts have this attribute.
Attributes Description Example
providerType Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Using IBM JCC Driver']

Syntax

providerType optional attribute

Syntax

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)
AdminJDBC.createDataSourceUsingTemplateAtScope(nodeName, 
 serverName, jdbcProvider, templateID, dsName, 
 attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createDataSourceUsingTemplateAtScope("myNode", "myServer", 
 "myJDBCProvider", "Derby JDBC Driver 
 DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_derby_1)", "myDataSource")
The following example script includes optional attributes in a string format:
AdminJDBC.createDataSourceUsingTemplateAtScope("/Cell:IBM-F4A849C57A0Cell01/Node:IBM-F4A849C57A0Node01/Server:server1", 
"My JDBC Name2", 
"DB2 Universal JDBC Driver DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_DB2_UNI_1)", 
"MyJDBCDS", "authDataAlias=cellManager01/myAuthDataAlias, authMechanismPreference=BASIC_PASSWORD, category=myCategory, 
datasourceHelperClassname=com.ibm.websphere.rsadapter.DB2DataStoreHelper, description='My description', 
diagnoseConnectionUsage=true, jndiName=myJndiName, logMissingTransactionContext=false, manageCachedHandles=false, 
providerType='DB2 Using IBM JCC Driver', xaRecoveryAuthAlias=myCellManager01/xa1")

The following example script includes optional attributes in a list format:

AdminJDBC.createDataSourceUsingTemplateAtScope("/Cell:IBM-F4A849C57A0Cell01/Node:IBM-F4A849C57A0Node01/Server:server1", 
"My JDBC Name2", 
"DB2 Universal JDBC Driver DataSource(templates/system|jdbc-resource-provider-templates.xml#DataSource_DB2_UNI_1)", 
"MyJDBCDS", [['authDataAlias', 'cellManager01/myAuthDataAlias'], ['authMechanismPreference', 'BASIC_PASSWORD'], 
['category', 'myCategory'], ['connectionPool', [['agedTimeout', 100], ['connectionTimeout', 1000], 
['freePoolDistributionTableSize', 10], 
['maxConnections', 12], ['minConnections', 5], ['numberOfFreePoolPartitions', 3], ['numberOfSharedPoolPartitions', 6], 
['numberOfUnsharedPoolPartitions', 3], ['properties', [[['name', 'name1a'], ['value', 'value1a']], [['name', 'name1b'], 
['value', 'value1b']]]], ['purgePolicy', 'EntirePool'], ['reapTime', 10000], ['stuckThreshold', 3], ['stuckTime', 10], 
['stuckTimerTime', 10], ['surgeThreshold', 10], ['testConnection', 'true']]], 
['datasourceHelperClassname', 'com.ibm.websphere.rsadapter.DB2DataStoreHelper'], 
['description', 'My description'], ['diagnoseConnectionUsage', 'true'], ['jndiName', 'myJndiName'], 
['logMissingTransactionContext', 'false'], 
['manageCachedHandles', 'false'], ['mapping', [['authDataAlias', 'anAlias'], ['mappingConfigAlias', 'anotherTest']]], 
['preTestConfig', [['preTestConnection', 'true'], ['retryInterval', 12343], ['retryLimit', 4]]], 
['properties', [[['name', 'name1'], 
['value', 'value1']], [['name', 'name2'], ['value', 'value2']]]], ['propertySet', [['resourceProperties', 
[[['name', 'databaseName'], 
['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], ['type', 'integer'], ['value', 4]], [['name', 'serverName'], 
['type', 'String'], ['value', 'localhost']], [['name', 'portNumber'], ['type', 'integer'], ['value', 50000]]]]]],
['providerType', 'DB2 Using IBM JCC Driver'], 
['relationalResourceAdapter', 
'SIB JMS Resource Adapter(cells/IBM-F4A849C57A0Cell01/clusters/c1|resources.xml#J2CResourceAdapter_1232911649746)'], 
['statementCacheSize', 5], ['xaRecoveryAuthAlias', 'myCellManager01/xa1']] )

createJDBCProvider

This script creates a new JDBC provider in your 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 14. createJDBCProvider script . Required and optional arguments.
Argument Description
nodeName Specifies the name of the node of interest.
serverName Specifies the name of the server of interest.
jdbcProvider Specifies the name to assign to the new JDBC provider.
implementationClass Specifies the name of the implementation class to use.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 15. Optional attributes . Several scripts have these attributes.
Attributes Description Example
classpath Specifies a list of paths or Java archive (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 Specifies a description of the resource adapter.
['description', 'My description']
isolatedClassLoader If set to true, specifies that the resource provider is loaded in its own class loader.
Attention: 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}']
Table 16. Optional attributes, continued . Several scripts have these attributes.
Attributes Description Example
propertySet Optionally specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If set to 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

Use the following command syntax to 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

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)
AdminJDBC.createJDBCProvider(nodeName, serverName, 
 jdbcProvider, implementationClass, attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createJDBCProvider("myNode", "myServer", "myJDBCProvider", 
 "myImplementationClass")
The following example script includes optional attributes in a string format:
AdminJDBC.createJDBCProvider("IBM-F4A849C57A0Node01", "server1", "My JDBC Name", 
"com.ibm.db2.jcc.DB2ConnectionPoolDataSource", 
" classpath=${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;
${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar, 
description='My description', isolatedClassLoader=false, nativepath=${DB2_JCC_DRIVER_NATIVEPATH},  
providerType='DB2 Univesal JDBC Driver Provider', xa=true ") 

The following example script includes optional attributes in a list format:

AdminJDBC.createJDBCProvider("IBM-F4A849C57A0Node01", "server1", "My JDBC Name", 
"com.ibm.db2.jcc.DB2ConnectionPoolDataSource", 
[['classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;
${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar'], 
['description', 'My description'], ['isolatedClassLoader', 'false'], ['nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}'], 
['providerType', 'DB2 Univesal JDBC Driver Provider'], ['xa', 'true'], ['propertySet', [['resourceProperties', 
[[['name', 'databaseName'], ['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], ['type', 'integer'], 
['value', 4]], [['name', 'serverName'], ['type', 'String'], ['value', 'localhost']], [['name', 'portNumber'], 
['type', 'Integer'], ['value', 50000]]]]]]])

createJDBCProviderUsingTemplate

This script uses a template to create a new JDBC provider in your 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 17. createJDBCProviderUsingTemplate script . Required and optional arguments.
Argument Description
nodeName Specifies the name of the node of interest.
serverName Specifies the name of the server of interest.
templateID Specifies the configuration ID of the template to use to create the JDBC provider.
jdbcProvider Specifies the name to assign to the new JDBC provider.
implementationClass Specifies the name of the implementation class to use.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 18. Optional attributes . Several scripts have these attributes.
Attributes Description Example
classpath Specifies a list of paths or Java archive (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 Specifies a description of the resource adapter.
['description', 'My description']
isolatedClassLoader If set to true, specifies that the resource provider is loaded in its own class loader.
Attention: 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}']
Table 19. Optional attributes, continued . Several scripts have these attributes.
Attributes Description Example
propertySet Optionally specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If set to 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

Use the following command syntax to 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

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)
AdminJDBC.createJDBCProviderUsingTemplate(nodeName, 
 serverName, templateID, jdbcProvider, 
 implementationClass, attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createJDBCProviderUsingTemplate("myNode", "myServer", "Derby JDBC 
 Provider(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#JDBCProvider_1124467079638)", 
 "myJDBCProvider", "myImplementationClass") 
The following example script includes optional attributes in a string format:
AdminJDBC.createJDBCProviderUsingTemplate("IBM-F4A849C57A0Node01", "server1", 
"DB2 Universal JDBC Driver Provider(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_1)", 
"My JDBC Name", "com.ibm.db2.jcc.DB2ConnectionPoolDataSource",  
"classpath= ${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar, 
description='My description', isolatedClassLoader=false, nativepath=${DB2_JCC_DRIVER_NATIVEPATH},  
providerType='DB2 Univesal JDBC Driver Provider', xa=true ") 

The following example script includes optional attributes in a list format:

AdminJDBC.createJDBCProviderUsingTemplate("IBM-F4A849C57A0Node01", "server1", 
"DB2 Universal JDBC Driver Provider(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_1)",
 My JDBC Name", 
"com.ibm.db2.jcc.DB2ConnectionPoolDataSource",  
[['classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar'], 
['description', 'My description'], ['isolatedClassLoader', 'false'], ['nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}'], 
['providerType', 'DB2 Univesal JDBC Driver Provider'], ['xa', 'true'], ['propertySet', [['resourceProperties', 
[[['name', 'databaseName'], ['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], ['type', 'integer'], 
['value', 4]], [['name', 'serverName'], ['type', 'String'], ['value', 'localhost']], [['name', 'portNumber'], 
['type', 'Integer'], ['value', 50000]]]]]]])

createJDBCProviderAtScope

This script creates a new JDBC provider in your environment at the scope that you specify. 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 by using the AdminConfig create command.

To run the script, specify the scope, JDBC provider, database type, provider type, and implementation types arguments. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 20. createJDBCProviderAtScope script . Required and optional arguments.
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
databaseType Specifies the database type that this JDBC provider uses. Valid values include DB2, Derby, Informix, Oracle, Sybase, SQL Server, and user-defined values.
providerType Specifies the JDBC provider type that this JDBC provider uses.
implType Specifies the implementation type that this JDBC provider uses. Valid values are Connection pool datasource and XA data source.
jdbcProvider Specifies the name to assign to the new JDBC provider.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 21. Optional attributes . Several scripts have these attributes.
Attributes Description Example
classpath Specifies a list of paths or Java archive (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 Specifies a description of the resource adapter.
['description', 'My description']
isolatedClassLoader If set to true, specifies that the resource provider is loaded in its own class loader.
Attention: 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}']
Table 22. Optional attributes, continued . Several scripts have this attribute.
Attributes Description
implementationClassName Specifies the implementation class to use for a given JDBC provider template.
providerType optional attribute

Syntax

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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

Use the following command syntax to 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

AdminJDBC.createJDBCProviderAtScope(scope,
 jdbcProvider, databaseType, providerType, implementationType,
 attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createJDBCProviderAtScope("myScope", "myJDBCProvider", "myDatabaseType","myProviderType", 
"myImplementationClass")
The following example script includes optional attributes in a string format:
AdminJDBC.createJDBCProviderAtScope("/Cell:IBM-F4A849C57A0Cell01/Node:IBM-F4A849C57A0Node01", "DB2", 
"DB2 Universal JDBC Driver Provider", "Connection pool data source", "My JDBCProvider Name", 
"description='My description', implementationClassName=com.ibm.db2.jcc.DB2ConnectionPoolDataSource, 
classpath=${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar, 
nativePath=${DB2_JCC_DRIVER_NATIVEPATH}, isolatedClassLoader=false”)

The following example script includes optional attributes in a list format:

AdminJDBC.createJDBCProviderAtScope("/Cell:IBM-F4A849C57A0Cell01/Node:IBM-F4A849C57A0Node01", "DB2", 
"DB2 Universal JDBC Driver Provider", "Connection pool data source", "My JDBCProvider Name", [['description', 'My description'],
[ 'implementationClassName ', 'com.ibm.db2.jcc.DB2ConnectionPoolDataSource'],
[ 'classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar'],
[ 'nativePath', '${DB2_JCC_DRIVER_NATIVEPATH}'], ['isolatedClassLoader', 'false'] ])

createJDBCProviderUsingTemplateAtScope

This script uses a template to create a new JDBC provider in your environment at the scope that you specify. 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 23. createJDBCProviderUsingTemplateAtScope script . Required and optional arguments.
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JDBC provider.
templateID Specifies the configuration ID of the template to use to create the JDBC provider.
jdbcProvider Specifies the name to assign to the new JDBC provider.
implementationClassName Specifies the name of the implementation class to use.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Table 24. Optional attributes . Several scripts have these attributes.
Attributes Description Example
classpath Specifies a list of paths or Java archive (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 Specifies a description of the resource adapter.
['description', 'My description']
isolatedClassLoader If set to true, specifies that the resource provider is loaded in its own class loader.
Attention: 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}']
Table 25. Optional attributes, continued . Several scripts have these attributes.
Attributes Description Example
propertySet Optionally specifies resource properties in the following format: [propertySet[[resourceProperties[[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]

When you use 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 Specifies the JDBC provider type that this JDBC provider uses.
['providerType', 'DB2 Universal JDBC Driver Provider']
xa Possible values are true and false. If set to 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
Implementation class optional attribute

Syntax

Use the following command syntax to 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

Use the following command syntax to 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.
AdminConfig.listTemplates(‘JDBCProvider')
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)

createJDBCProviderUsingTemplateAtScope script

Syntax

AdminJDBC.createJDBCProviderUsingTemplateAtScope(scope, 
  templateID, jdbcProvider, 
 implementationClass, attributes)

Example usage

The following example script contains required attributes only:

AdminJDBC.createJDBCProviderUsingTemplateAtScope("myScope", "Derby JDBC 
 Provider(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#JDBCProvider_1124467079638)", 
 "myJDBCProvider", "myImplementationClass") 
The following example script includes optional attributes in a string format:
AdminJDBC.createJDBCProviderUsingTemplateAtScope("/Cell:IBM-F4A849C57A0Cell01/ServerCluster:cluster1", 
"DB2 Universal JDBC Driver Provider(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_1)", 
"My JDBC Name001", " com.ibm.db2.jcc.DB2ConnectionPoolDataSource", 
"classpath= ${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar, 
description='My description', isolatedClassLoader=false, nativepath=${DB2_JCC_DRIVER_NATIVEPATH},  
providerType='DB2 Univesal JDBC Driver Provider', xa=true ") 

The following example script includes optional attributes in a list format:

AdminJDBC.createJDBCProviderUsingTemplateAtScope("/Cell:IBM-F4A849C57A0Cell01/ServerCluster:cluster1", 
"DB2 Universal JDBC Driver Provider(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_1)", 
"My JDBC Name001", " com.ibm.db2.jcc.DB2ConnectionPoolDataSource", 
[['classpath', '${DB2_JCC_DRIVER_PATH}/db2jcc4.jar;
${UNIVERSAL_JDBC_DRIVER}/db2jcc_license_cu.jar;${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar'], 
['description', 'My description'], ['isolatedClassLoader', 'false'], ['nativepath', '${DB2_JCC_DRIVER_NATIVEPATH}'], 
['providerType', 'DB2 Univesal JDBC Driver Provider'], ['xa', 'true'], ['propertySet', [['resourceProperties', 
[[['name', 'databaseName'], ['type', 'String'], ['value', 'myDbName']], [['name', 'driverType'], ['type', 'integer'], 
['value', 4]], [['name', 'serverName'], ['type', 'String'], ['value', 'localhost']], [['name', 'portNumber'], 
['type', 'Integer'], 
['value', 50000]]]]]]])