[CQ5.4] “java.sql.SQLException: No suitable driver found for”

Are you trying to configure JDBC Datasource on CQ5.4 and keep getting the following exception:

“java.sql.SQLException: No suitable driver found for”

 

Follow the next three steps and you should be good to go:

First of all, get the jdbc driver jar from your database vendor. I m sure you already have this!

My assumption is this is the non-OSGI(fied) version of the jdbc driver jar.

1. Copy the driver jar under crx-quickstart/server/lib/container.

Before we proceed further, shutdown CQ.

2. Open sling.properties file under crx-quickstart/launchpad

 

3. Add the following line towards the end of this file and then restart CQ

sling.bootdelegation.class.some.jdbc.vendor.and.their.driver.jdbcdriver=some.jdbc.vendor.and.their.driver

For Oracle JDBC driver, it will be something like:

sling.bootdelegation.class.oracle.jdbc.driver.OracleDriver=oracle.jdbc.driver

For MySQL JDBC driver, it will be something like:

sling.bootdelegation.com.mysql.jdbc.Driver=com.mysql.jdbc

That’s it!

Any issues/ questions, please leave in comments.

 

Make sure to read the below documentation if you haven’t already:

http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html

http://sling.apache.org/site/configuration.html