The scripting library provides many script procedures to manage Java Database Connectivity (JDBC) configurations in your environment. This topic provides 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.
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 lower case for the type (cell=, node=, server=, or cluster=.)
The examples in the following table are split on multiple lines for publishing purposes.
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=myNodeor Cell=myCell: Node=myNodeor 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=myServeror Node=myNode: Server=myServeror 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=myClusteror Cell=myCell: Cluster=myClusteror cell=myCell, Cluster=myCluster |
This script creates a data source in your configuration. The script returns the configuration ID of the new data source.
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 |
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'] |
Attributes | Description | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. | ['providerType', 'DB2 Using IBM JCC Driver'] |
Syntax
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape® JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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']] )
This script uses a template to create a data source in your configuration. The script returns the configuration ID of the new data source.
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:
|
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'] |
Attributes | Description | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. | ['providerType', 'DB2 Using IBM JCC Driver'] |
Syntax
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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']] )
This script creates a 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 data source. The createDataSource script creates a data source using the AdminConfig create command.
Argument | Description |
---|---|
scope | Specifies a scope of cell, node, server, or cluster for the JDBC provider. |
![]() ![]() |
Specifies the name of the JDBC provider of interest. |
![]() ![]() |
Specifies the name to assign to the new data source. |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
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 data source obtains connections. Examples are jdbc:oracle:thin:@localhost:1521:sample for a thin driver and jdbc:oracle:oci8:@sample for a thick driver. |
![]() ![]() |
Optionally specifies additional
attributes in a particular format:
|
![]() ![]() |
![]() Optionally specifies additional
attributes in a particular format:
![]() |
![]() ![]() |
![]() ![]() |
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. |
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")
Example scripts for the DB2® database type:
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]])
Example scripts for the Derby database:
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']])
Example scripts for the Informix database:
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=localhost, 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', 'localhost'], ['portNumber', 1526], ['ifxIFXHOST', 'localhost'], ['informixLockModeWait', 2]])
Example scripts for the Oracle database:
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']])
Example scripts for the SQLServer database:
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]])
Example scripts for the Sybase database:
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]])
This script uses a template to create a data source in your configuration at the scope that you specify. The script returns the configuration ID of the new data source.
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:
|
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'] |
Attributes | Description | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. | ['providerType', 'DB2 Using IBM JCC Driver'] |
Syntax
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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']] )
This script creates a JDBC provider in your environment. The script returns the configuration ID of the new JDBC provider.
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:
|
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 isolated 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 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
Syntax
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.DB2XADataSourceSome possible implementation class names:
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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]]]]]]])
This script uses a template to create a JDBC provider in your environment. The script returns the configuration ID of the new JDBC provider.
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:
|
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 isolated 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 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
Syntax
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.DB2XADataSourceSome possible implementation class names:
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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]]]]]]])
This script creates a 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 JDBC provider. The createJDBCProvider script procedure creates a JDBC provider by using the AdminConfig create command.
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. |
![]() ![]() |
Specifies the implementation type that this JDBC provider uses. Valid values are Connection pool datasource and XA data source. |
![]() ![]() |
![]() ![]() |
attributes | Optionally specifies additional
attributes in a particular format:
|
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 isolated 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 | Specifies the implementation class to use for a given JDBC provider template. |
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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)
Syntax
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.DB2XADataSourceSome possible implementation class names:
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")
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'] ])
This script uses a template to create a JDBC provider in your environment at the scope that you specify. The script returns the configuration ID of the new JDBC provider.
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:
|
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 isolated 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 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
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.DB2XADataSourceSome possible implementation class names:
Syntax
AdminConfig.listTemplates(‘JDBCProvider')Example partial result showing the JDBC provider template ID for the JDBC provider type name of Cloudscape JDBC Provider (XA):
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)Some JDBC provider template IDs:
Cloudscape JDBC Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2j_4)"
Cloudscape Network Server Using Universal JDBC Driver (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_db2jN_1)
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")
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]]]]]]])