In this recipe, we will learn how to make a JDBC driver compliant to version 4. This is needed to install the driver and to make it available for your datasources, and hence to your applications.
If you already have a JDBC 4 compliant driver, you can skip this recipe; otherwise, I assume that you do not have a JDBC driver and I'll refer to it as non-jdbc-4-driver.jar
, throughout the recipe.
To make your driver JDBC 4 compliant, you just need to add a file into it, as described in the following steps:
Create a temporary folder and navigate into it.
Place your
non-jdbc-4-driver.jar
driver file into it.Create a
META-INF/services
directory.Create a file named
java.sql.Driver
and place it into the folder specified in step 3.Edit the file
java.sqlDriver
and enter one line containing the fully qualified name of the class implementing the driver.Starting from the empty folder as per step
1
, update the filenon-jdbc-4-driver.jar
using...