We all use MySQL database now, and we must learn the steps of JDBC to connect to the database.
1. Open eclipse, create a project first, you can not write the content first, right-click the project and select "properties"
#2. Select "libraries" and select "add external jars" on the right. It depends on where you put the jar package before. It is usually placed under lib under JDK. Select it.
#3. In this way, the library you just selected will be added.
4. Then click OK, so there will be more jar packages under your project.
##Notes
You must import the jar package to connect To MySQL
The above is the detailed content of How does JDBC connect to MySQL database?. For more information, please follow other related articles on the PHP Chinese website!