+

Search Tips   |   Advanced Search

JDBCProviderManagement


Use the Jython or Jacl scripting languages in interactive mode to configure data access and data sources with scripting. The commands and parameters in the JDBCProviderManagement group can be used to create or list data sources and Java database connectivity (JDBC) providers.

The JDBCProviderManagement includes the following commands:

 

createDatasource

The createDatasource command creates a new data source to access the back end data store. Application components use the data source to access connection instances to the database.

Target object

JDBC Provider Object ID - The configuration object of the JDBC provider to which the new data source will belong.

Required parameters

- name

The name of the data source. (String, required)

-jndiName

The Java Naming and Directory Interface (JNDI) name. (String, required)

-dataStoreHelperClassName

The name of the DataStoreHelper implementation class that extends the capabilities of the selected JDBC driver implementation class to perform data-specific functions. WAS provides a set of DataStoreHelper implementation classes for each of the JDBC provider drivers it supports. (String, required)

configureResourceProperties

This command step configures the resource properties that are required by the data source. (Required) We can specify the following parameters for this step:

name

The name of the resource property. (String, required)

type

The type of the resource property. (String, required)

value

The value of the resource property. (String, required)

Optional parameters

-description

The description of the data source. (String, optional)

-category

The category that we can use to classify a group of data sources. (String, optional)

-componentManagedAuthenticationAlias

The alias used for database authentication at run time. This alias is only used when the application resource reference is using res-auth=Application. (String, optional)

-containerManagedPersistence

Specifies if the data source is used for container managed persistence for enterprise beans. The default value is true. (Boolean, optional)

Examples

Batch mode example usage:

Interactive mode example usage:

Be aware of the following issues with the createDatasource command:

gotcha

 

createJDBCProvider

The createJDBCProvider command creates a new Java database connectivity provider (JDBC) that we can use to connect to a relational database for data access.

Target object

None

Required parameters

-scope

The scope for the new JDBC provider. Provide the scope in the form type=name. Type can be Cell, Node, Server, Application, or Cluster, and name is the name of the specific instance of the cell, node, server, application, or cluster that we are using. The default is none. (String, required)

-databaseType

The type of database that will be used by the JDBC provider. For example, DB2, Derby, Informix, Oracle, and so on. (String, required)

-providerType

The JDBC provider type that will be used by the JDBC provider. (String, required)

-implementationType

The implementation type for this JDBC provider. Use Connection pool data source if the application runs in a single phase or a local transaction. Otherwise, use XA data source to run in a global transaction. (String, required)

Optional parameters

-classpath

List of paths or JAR file names that form the location for the resource provider classes. (String, optional)

-description

The description for the JDBC provider. (String, optional)

-implementationClassName

Java class name for the JDBC driver implementation. (String, optional)

-isolated

Specifies that the JDBC provider will load in its own class loader. The default value is false. We cannot specify a native path for an isolated JDBC provider. (Boolean, optional)

-name

The name of the JDBC provider. The default is the value from the provider template. (String, optional)

-nativePath

List of paths that form the location for the resource provider native libraries. (String, optional)

-isolated

Specifies whether the JDBC provider loads within the class loader.

The default value is false. We cannot specify a native path for an isolated JDBC provider. (Boolean, optional)

Examples

Batch mode example usage:

  • Use Jython string:

    AdminTask.createJDBCProvider('[-scope Cell=myCell -databaseType DB2 -providerType "DB2 Universal JDBC Driver Provider" -implementationType "XA datasource" -name "DB2 Universal JDBC Driver Provider (XA)" -description "XA DB2 Universal JDBC Driver-compliant Provider. Datasources created under this provider support the use of XA to perform 2-phase commit processing. Use of driver type 2 on WAS z/OS is not supported for datasources created under this provider." -classpath ${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar;${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar;${DB2UNIVERSAL_JDBC_DRIVER_PATH}/ db2jcc_license_cisuz.jar -nativePath ${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}]')

  • Use Jython list:

    AdminTask.createJDBCProvider(['-scope', 'Cell=myCell', '-databaseType', 'DB2', '-providerType', 'DB2 Universal JDBC Driver Provider', '-implementationType', 'XA data source', '-name', 'DB2 Universal JDBC Driver Provider (XA)', '-description', 'XA DB2 Universal JDBC Driver-compliant Provider. Datasources created under this provider support the use of XA to perform 2-phase commit processing. Use of driver type 2 on WAS z/OS is not supported for datasources created under this provider.', '-classpath', '${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar;${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar;${DB2UNIVERSAL_JDBC_DRIVER_PATH}/ db2jcc_license_cisuz.jar', '-nativePath', '${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}'])

    Interactive mode example usage:

     

    listDatasources

    Use the listDatasources command to list data sources that are contained in the specified scope.

    Target object

    None

    Required parameters: None.

    Optional parameters

    -scope

    The scope for the data sources that will be listed. Provide the scope in the form type=name. Type can be Cell, Node, Server, Application, or Cluster, and name is the name of the specific instance of the cell, node, server, application, or cluster that we are using. The default is All. (String, optional)

    Examples

    Batch mode example usage:

    Interactive mode example usage:

     

    listJDBCProviders

    The listJDBCProviders command lists JDBC providers that are contained in the specified scope.

    Target object

    None

    Required parameters: None.

    Optional parameters

    -scope

    The scope for the JDBC providers that will be listed. Provide the scope in the form type=name. Type can be Cell, Node, Server, Application, or Cluster, and name is the name of the specific instance of the cell, node, server, application, or cluster that we are using. The default is All. (String, optional)

    Examples

    Batch mode example usage:

    Interactive mode example usage:





     

    Related tasks


    Use AdminTask for scripted administration

     

    Related


    Commands for AdminTask