Add JDBC provider in WebSphere

Home > Search

Configuring WebSphere to handle the connection to a database is a multi-step process. First, you add a JDBC driver, such as a MySQL, MariaDB, Oracle, DB2, or SQL Server driver. Next, you create a data source to use the JDBC driver.  Then, you configure the J2C alias (username, password). 

In ths example, the MySQL JDBC driver is downloaded, from This will download a tar archive. Move the tar archive onto your WebSphere server (Linux in this example). Decompress the gzip compress tar archive.

~]# gunzip mysql-<version>.tar.gz


Extract the tar archive.

~]# tar -xf mysql-<version>.tar


Copy the MySQL JAR into a directory where you will be storing your JDBC drivers (/opt/jdbc in this example).

~]# cp mysql-connector-java-version-bin.jar /opt/jdbc


In a clustered environment, repeat the above steps on the other servers in the cluster.


Add the JDBC driver to WebSphere.

  1. In the left panel of the WebSphere web console, expand Resources > JMS.
  2. Select JDBC provider.
  3. In the scope drop-down selector, select a scope (cluster, node, server). Only applications that are in the same scope will be able to use the JDBC provider.
  4. Select New.
  5. At Step 1: Create new JDBC provider, select the appropriate database type. In this example, the implemenation classname should be com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource. Select the appropriate database type and select Next.


  1. At Step 2, enter the path to where the JAR is located on the WebSphere server and select Next.


  1. At step 3, select Finish. The JDBC provider should now be displayed. Next, create the data source.



The (Linux) or wsadmin.bat (Windows) command can also be used to create a data source. This usually only makes sense if there is some problem with the web console, or as part of a scripted process.

wsadmin> 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
db2jcc_license_cisuz.jar -nativePath ${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}]')


Use the following command to list the JDBC Providers.

# Jython
wsadmin> AdminTask.listJDBCProviders()

# Jacl
wsadmin> $AdminTask listJDBCProviders()


Use the following command to delete a JDBC Provider.

# Jython
wsadmin> AdminTask.deleteJDBCProvider('DB2 Universal JDBC Driver Provider (XA)

# Jacl
wsadmin> $AdminTask deleteJDBCProvider "DB2 Universal JDBC Driver Provider


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.