Graphic tutorial on connecting MyEclipse to MySQL database, myeclipsemysql
When I learned the JavaEE course by myself, I needed to connect to the MySQL database when I was doing some small things. I looked at the book myself and found myself. Step by step, the learning process was also a sharing process, hope to help more people.
1. Configure Database assumer1.
Open MyEclipse Database.
Method:Window --> Openperspective --> MyEclipse Database Explorer
2. Click MyEclipse... in the upper right corner and right-click the blank area of DB Browser --> new to open the DataBase Driver.
3. Enter the content in the opened DataBase Driver and explain what the table represents.
Template:Driver template: select different driver types based on the database in use. Because we connect to MySQL, we select MySQL Connector/J;
Driver name:Connection name;
Connection URL:Set the connection address. In the figure, User name:It is generally the default root;
Password:Database Password. The default value is 123456;
Add Jar:Add the database jar package and download it by yourself;
Driver classname:The system will automatically match;
4.
Test whether your database is connected successfully. If you follow these steps, no major problems will occur. It is the same as it is in navicat.
2. After the DataBase is configured, import and add the mysql package in the project.
Add a mysql package to the project, operate in the image order, click next, create a new package, name it, and click OK. Add the jar package, import the mysql package, and click OK and finish. That's all.
3. Check whether to import the jar package in the project and write a database java class.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.