6

I'm still a beginner in java. I dont have any idea on how to import the files that I have downloaded into my java class. Its in this path:

E:\Users\user\Downloads\mysql-connector-java-5.1.12

I don't know what to do with the files I extracted from the file that I have downloaded in the mysql site for me to connect my java application and mysql database.

I'm using Netbeans 6.8. And have also installed wampserver.

ive already check out This: Java: Trouble connecting to MySQL and this: Connecting to a MySQL database

But they don't seem to have answers on how to make use of the mysql java connector file from mysql site. Please help, thanks.

Community
  • 1
  • 1
user225269
  • 10,743
  • 69
  • 174
  • 251
  • Another answer: http://stackoverflow.com/questions/2839321/java-connectivity-with-mysql/2840358#2840358 – BalusC Jun 02 '10 at 17:59

2 Answers2

4

Right click on your project in your project explorer and click on properties.

From there go to libraries -> add jar file then go to whatever .jar file you want to import.

That should add the jar file to your project classpath.

Albinoswordfish
  • 1,949
  • 7
  • 34
  • 50
1

This answer to the second question you already found here on SO is a good reference! In addition you simply have to make sure, that the mysql connector library is on the classpath. That should be all.

Community
  • 1
  • 1
Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268