When programming using JDBC, you need to connect to the database. It is necessary to import JAR packages. The same is true for importing other jar package methods. The import method is
Open eclipse
1. Right-click the project to import the jar package and click properties
2. Select java build path on the left and libraries on the right
3. Select add External jars
4. Select the jar package and follow the path to determine it.
Java connection MySQL latest driver package download address
http://www.mysql.com/downloads/connector/j
There are two ways to import jar packages. The first is to first place the jar package in the project directory. By adding jar packages, you can use the relative address. This way, copying the project to other computers can also be used.
The second method is to import the external jar package, which is the absolute address. If the project is to be copied to another computer, it needs to be re-imported.
The first method is recommended
The second method
After adding the following will appear