First, you will need to extract and repackage the appropriate classes and DLL from a Java 1.7 install. This section is adapted from http://bigfatball.blogspot.it/2016/03/how-to-enable-jdbc-odbc-bridge-for-jdk-8.html.
- Download a JDK 7 or JRE 7 and install it.
- Goto JRE\lib folder and find the rt.jar
- Unzip it (if you have WinRAR installed) or you can rename it to rt.zip and unzip it.
- Copy sun\jdbc and sun\security\action folders out to a new folder, keep the folder structure. i.e., you should have the folder structure like below:
- Sun –> Security –> Action
- Sun –> JDBC
- Open a CMD window. Go to the parent folder of Sun folder. Run the command:jar -cvf jdbc.jar sun
NOTE: You may need the full path to jar.exe in here. Example: “c:\Program Files\Java\jdk1.7.x\bin\jar.exe” -cvf jdbc.jar sun
- The above command will create a file named jdbc.jar
- Copy JDBC.jar to your Lucee lib/ext folder. This is typically at C:\lucee\jdk\jre\lib\ext.
- Copy jdbcodbc.dll from JRE\bin of your JRE 7 installation to Lucee’s JRE\bin. This is typically at C:\lucee\jdk\jre\bin.
- Restart Lucee.
You should now have the classes available to set up an ODBC datasource in Lucee.
- Confirm that your ODBC datasource is set up in the Windows ODBC manager.
- Go to your Lucee server or web admin.
- Select Datasource from the left menu.
- Under “Create new datasource”, give it a name and select “Other-JDBC Driver” and click Create.
- Add a username of “System” and leave password blank.
- For Class, enter “sun.jdbc.odbc.JdbcOdbcDriver”.
- For Connect string, enter “jdbc:odbc:<odbc data source name>”. For example, “jdbc:odbc:mydsn”. This must exactly match the ODBC datasource name in Windows.
- Click UPDATE.
- After submission, you should see an OK next to your new datasource and it is available for use.
DISCLAIMER: I have no idea if this violates any licensing for Java.