Friday, March 28, 2014

Unable to connect to database using JDBC driver


I was trying to connect to a database from Cordys using jdbc driver. It gives an exception called "Configuration Validation was not successful". Please note below




When I expand that error I could understand the reason was "Unable to locate the path of the driver" basically "ClassNotFound" exception.





The solution to this would be to set the CLASSPATH environment variable to the required jar path. Here in this case it would be ojdbc14.jar which holds the necessary class files. It would be done in the below mentioned steps

Step 1 : Locate ojdbc14.jar file. If you have oracleXE installed in your environment it would be present in the below given location but if you don't have oracleXE installed then you would have to download this jar and copy the path from the explorer.



Step 2 : Set the environment variables using the jar path from step 1.

Since the above environment variables belong to system you might have to restart your system. However I have read at many places saying Windows 7 would not need a restart to have this environment variables to be set, but I did not want to take a chance and I restarted. It worked.


No comments:

Post a Comment