Updating the MySQL JDBC Driver on Adobe ColdFusion
This guide explains how to update the MySQL JDBC driver (mysql-connector-j) for a typical Adobe ColdFusion installation.
Example ColdFusion installation path
C:\ColdFusion[version]\cfusion
Driver location
C:\ColdFusion[version]\cfusion\lib
Prerequisites
- Access to the ColdFusion server
- Maintenance window (recommended)
- Backup of the existing JDBC driver
- New MySQL Connector/J driver downloaded from Oracle
Version Compatibility Considerations
ColdFusion Version
Older ColdFusion releases may ship with older Java runtimes, which can limit the versions of Connector/J that are supported.
Always verify that the Connector/J version supports the Java version used by your ColdFusion installation.
MySQL Server Compatibility
Connector/J versions generally support multiple MySQL server versions, but newer drivers may deprecate support for very old MySQL releases.
If connecting to older MySQL servers, thoroughly test before deploying a major Connector/J upgrade.
Step 1: Determine the Current JDBC Driver Version
There are several ways to identify the currently installed driver:
- Check the filename in:
C:\ColdFusion[version]\cfusion\lib
Example:
mysql-connector-j-8.0.33.jar
or
mysql-connector-java-5.1.49.jar
You can also review the datasource in the ColdFusion Administrator to verify the driver class being used.
Step 2: Download the New Driver
Download the appropriate version of MySQL Connector/J from Oracle.
Typical filename:
mysql-connector-j-8.4.x.jar
Step 3: Stop ColdFusion
Stop the ColdFusion Application Server.
Windows Services:
Adobe ColdFusion [version] Application Server
Verify that the ColdFusion process has completely stopped before continuing.
Step 4: Backup the Existing Driver
If you haven’t already navigate to:
C:\ColdFusion[version]\cfusion\lib
Rename or move the existing driver.
Example:
mysql-connector-j-8.0.33.jar
↓
mysql-connector-j-8.0.33.jar.bak
Keeping the old driver allows an easy rollback if you encounter any issues with the new JDBC driver.
Step 5: Copy the New JDBC Driver
Copy the new JDBC .jar into:
C:\ColdFusion[version]\cfusion\lib
Ensure that only one active version of the MySQL Connector/J driver exists in this directory whenever possible. Having multiple MySQL Connector/J versions on the classpath can lead to unpredictable class loading behavior.
Step 6: Start ColdFusion
Start the Windows ColdFusion service.
Step 7: Verify Datasource Connectivity
Open the ColdFusion Administrator and verify that your MySQL datasource connections are still working.
Step 8: Test Applications
Verify that applications using MySQL can:
- Connect successfully
- Execute queries
- Perform inserts/updates
- Use transactions
- Access connection pooling normally
Review:
- ColdFusion logs
- Application logs
For any JDBC-related errors. Such as suddenly failing query tags, timeouts, etc.