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.
범위 인수의 형식
범위 형식은 범위 인수를 사용하는 스크립트 라이브러리의 스크립트에 적용됩니다.
셀은 노드, 서버 및 클러스터 범위에서 선택적입니다. 서버 범위에서는 필수입니다.
유형은 쉼표(,) 또는 콜론(:)으로 구분할 수 있습니다. 유형(cell=, node=, server= 또는 cluster=)에는 소문자를 사용할 수 있습니다.
다음 표에 나와 있는 예제는 공개를 위해 여러 행으로 분할되어 있습니다.
범위 | 포함 경로 | 구성 ID | 유형 |
---|---|---|---|
셀 | /Cell:myCell/ |
|
Cell=myCell or cell=myCell |
노드 | /Cell:myCell/Node:myNode/ 또는 /Node:myNode/ |
|
또는
또는
|
서버 |
또는
|
|
또는
or
|
클러스터 |
or
|
|
or
or
|
createDataSource
This script creates a new 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 | Optionally specifies additional
attributes in a particular format:
|
Attributes | Description | Example |
---|---|---|
authDataAlias | Specifies the alias used for database authentication at run time. |
|
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. |
|
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. |
|
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. |
|
description | Specifies a description of the data source. |
|
jndiName | Specifies the Java Naming and Directory Interface (JNDI) name for this data source. |
|
logMissingTransactionContext | Specifies whether missing transaction context logging is enabled. |
|
manageCachedHandles | Specifies whether this data source is used for container-managed persistence of enterprise beans. The default value is true. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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 | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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")
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.
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. |
|
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. |
|
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. |
|
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. |
|
description | Specifies a description of the data source. |
|
jndiName | Specifies the Java Naming and Directory Interface (JNDI) name for this data source. |
|
logMissingTransactionContext | Specifies whether missing transaction context logging is enabled. |
|
manageCachedHandles | Specifies whether this data source is used for container-managed persistence of enterprise beans. The default value is true. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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 | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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")
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.
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:
|
resoureAttributes | Optionally specifies additional
attributes in a particular format:
|
failonerror | Specifies the administrative utilities that process an error condition. |
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")
Examples 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]])
Examples 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']])
Examples 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=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:
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:
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:
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.
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. |
|
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. |
|
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. |
|
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. |
|
description | Specifies a description of the data source. |
|
jndiName | Specifies the Java Naming and Directory Interface (JNDI) name for this data source. |
|
logMissingTransactionContext | Specifies whether missing transaction context logging is enabled. |
|
manageCachedHandles | Specifies whether this data source is used for container-managed persistence of enterprise beans. The default value is true. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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 | Example |
---|---|---|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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")
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.
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. |
|
description | Specifies a description of the resource adapter. |
|
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.
|
|
nativepath | Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). |
|
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. |
|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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. |
|
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:
implementationClassName attribute example usage:AdminConfig.showAttribute(JDBCProvID,'implementationClassName')
Result:print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")
Some possible implementation class names:com.ibm.db2.jcc.DB2XADataSource
- 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")
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.
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. |
|
description | Specifies a description of the resource adapter. |
|
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.
|
|
nativepath | Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). |
|
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. |
|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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. |
|
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:
implementationClassName attribute example usage:AdminConfig.showAttribute(JDBCProvID,'implementationClassName')
Result:print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")
Some possible implementation class names:com.ibm.db2.jcc.DB2XADataSource
- 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")
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.
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:
|
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. |
|
description | Specifies a description of the resource adapter. |
|
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.
|
|
nativepath | Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). |
|
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:
implementationClassName attribute example usage:AdminConfig.showAttribute(JDBCProvID,'implementationClassName')
Result:print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")
Some possible implementation class names:com.ibm.db2.jcc.DB2XADataSource
- 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")
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.
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. |
|
description | Specifies a description of the resource adapter. |
|
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.
|
|
nativepath | Specifies an optional path to any native libraries, such as *.dll and *.so. Native path entries are separated by a semicolon (;). |
|
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. |
|
providerType | Specifies the JDBC provider type that this JDBC provider uses. |
|
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. |
|
- Implementation class optional attribute
Syntax
Use the following command syntax to find the implementationClassName attribute by specifying the JDBC provider template ID for JDBCProvID:
implementationClassName attribute example usage:AdminConfig.showAttribute(JDBCProvID,'implementationClassName')
Result:print AdminConfig.showAttribute("DB2 Universal JDBC Driver Provider (XA) (templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_DB2_UNI_2)", "implementationClassName")
Some possible implementation class names:com.ibm.db2.jcc.DB2XADataSource
- 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")
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]]]]]]])