We are working on a project in netbeans using Java which uses mysql database to process some common queries. But I am having issues with loading jdbc drivers for mysql in netbeans. It is giving following error:
Class Not Found Exception : com.jdbc.mysql.Driver
please help me out.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You just have to add the MySQL JDBC connector to your project. It would be similar for an Oracle database, for example (you would have to add the ojdbc6.jar).
For MySQL, you have to get the MySQL JDBC connector and add it to your project’s classpath.
- Get the MySQL JDBC connector, either on the MySQL site, either adding it through a Maven dependency (if your project is driven by Maven), check the official MySQL site. The current version as of May 2012 is 5.1.19 (works with any version of MySQL);
- Add it to your Netbeans classpath, in the project properties. Check the online Netbeans configuration about project classpath if needed
Method 2
When your suffering from this kind of problem then you need to check MySQL version is updated or corrected . If your are working on normal program then add MySQL jar version 5.1.32 or if you used maven structure then you used this dependency
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.32</version> </dependency>
I hope that it will work on your problem…..
Method 3
if we add any jar files related data base drivers to class path are not visible in the IDE.
so once again we must add jar file to IDE in library folder,then only the classes in jar file can identified,in the IDE.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0