We will use MySQL as an example of how to adapt a plain-vanilla jar file driver to work within the OSGi framework of CRX/CQ.
We assume that you have both the Database Connector-enabled CRX or CQ instance and an instance of MySQL installed on the same machine (MySQL can be downloaded here: http://www.mysql.com/).
The MySQL JDBC driver file is
(it can be downloaded here: http://www.mysql.com/downloads/connector/j)
The first step is to copy the driver file to the shared classpath of your application server. If you are using CQSE (which comes with CRX and CQ) the shared classpath is
If you are using another application server, conult the documentaion for that server to find the shared classpath location.
Simply put the driver jar file there. For example, copying the MySQL JDBC to the shared classpath of CQSE wil result in it being located here:
Next, create a manifest file for converting the standard jar into an OSGi compliant jar, or bundle. Our example manifest file will be called mysql-jdbc.mf with the following content.