Test Connection throws ClassNotFoundException error
A ClassNotFoundException exception is thrown when the user hits the “Test Connection” button on the Database SQL Transformation Module’s Connection configuration panel.
When the user hits the “Test Connection” button on the Database SQL Transformation Module’s Connection configuration panel shown below…
a ClassNotFoundException exception is thrown …
and the phrase “Unknown driver:” shows in the JDBC driver selection pull down menu.
The “ClassNotFound” error is most likely caused by the eiConsole not finding the jar file containing the specified driver class name. This can be fixed by placing the jar file for the JDBC driver in the proper directory and specifying the driver class in the JDBC driver field. Here is how:
1. Determine your Working Directory from the File Management window.
In our case the working directory is “C:\PilotFish”.
2. With the eiConsole closed, copy your JDBC driver jar to the “lib” directory within your working directory.
In our case the destination directory will be “C:\PilotFish\lib” and our JDBC driver jar file is called “sqljdbc4.jar”.
3. Start the eiConsole and go back to editing your route’s Database Polling SQL Listener.
4. In the listener’s JDBC driver field, in the Connection tab, type the class name for the JDBC driver you just copied to the lib directory.
In our case the class name is “com.microsoft.sqlserver.jdbc.SQLServerDriver”.
5. Make sure that the other settings in this tab (User name, Password and JDBC URL) have the proper values for your SQL server.
6. Click “Test Connection”. You shouldn’t get the “ClassNotFound” error message now and the “Unknown driver:” message next to the class name in the pull down menu should’t be there anymore for that particular driver.