How To Connect JDBC To MySql Database (Xampp)

 

 Connect Java Application with mysql database


1. Paste the mysqlconnector.jar file in C:\Program Files\Java\jre1.8.0_111\lib\ext folder



2. Copy the whole path 

C:\Program Files\Java\jre1.8.0_111\lib\ext\mysql-connector-java-5.0.8-bin.jar;.;

3. Go to Environmental Variable page >New 

        In variable name write classpath and in variable value paste the path to the below path



C:\Program Files\Java\jre1.8.0_111\lib\ext\mysql-connector-java-5.0.8-bin.jar;.;

4. Save it by clicking on OK.

5. Now Open Your Netbeans > Open Your JDBC Project File

6. Right click on project file name and choose properties



7. Then Choose library and click on Add Jar/Folder


    
    Select that jar file which you download before  and click on open , then save it .

8. Congratulations, You successfully configure JDBC application to run with mysql database





Post a Comment

0 Comments