Create and configuring a JDBC provider and data source using the JMX API

You need two JAR files in your classpath -- wsexception.jar and wasjmx.jar. The following command suffices for most invocations:

set classpath=%classpath%;D:\WebSphere\AppServer\lib\wsexception.jar;D:\WebSphere\AppServer\lib\wasjmx.jar
The usual program follows these main points:

 

  1. Look up the host and get an administration client handle.

  2. Get a configuration service handle.

  3. Update the resource.xml file using the configuration service as desired.

    1. Add a JDBC provider

    2. Add the data source

    3. Add the connection factory (for CMP)

  4. Reload the resource.xml file to bind the newly created data source into the JNDI namespace. Perform this step if you want to use the newly created data source right away without restarting the appserver.

    1. Locate the DataSourceConfigHelper MBean using the name.

    2. Put together the signature and parameters for the call.

    3. Invoke the reload() call.


Connection factory
JDBC providers
Data sources
Using the JMX API to create a JDBC driver and data source for CMP
Using the JMX API to create a JDBC driver and data source for BMP, session beans, or servlets
Test a connection to a data source
Creating a JDBC provider and data source using JMX API and the scripting tool
Data Sources (Version 4)
Data Source collection
CMP Connection Factories collection
JDBC Provider collection

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.