MyEclipse connecting MySQL Database

Source: Internet
Author: User

In developing Java EE with MyEclipse, it is essential to connect to the database:
Here's what I'm doing here.
First, follow:
[Window]->[open perspective]->[myeclipse database Explorer] Opens a view of the databases.
You can see the top right icon switch.

Then we create a new connection, right-click in the blank of [DB Browser] and select New.

Then fill in the information:
Driver Template: This is based on the type of database you are connected to. I chose MySQL.
Driver Name: This is the connection name that you fill out. Fill in any.
Connection URL: This is the URL of the connection database. After selecting the type of database in the first step, a sample is automatically generated and replaced with one of its own. Take MySQL as an example:
The generated example is:jdbc:mysql://I want to fill it out: jdbc:mysql://localhost:3306/text
The last dbname is the name of the database you want to connect to.
User Name: Default is root, I did not add other.
Password: is the password to log in to the database. The password that was created when the database was created.
Driver JARs: Add a driver package for the database. The driver packages for each kind of database are not the same. I use the MySQL jar package here, as long as it is selected in the specified directory. But the directory is best not to take Chinese, although do not know why, but in order to insure, the English catalogue is always right.
Driver ClassName: The jar package will appear automatically after we have selected it.
We then clicked test driver below to see if the connection was successful.

Here we find that an error has occurred, that is, to check the URL. I checked the URL multiple times and there was no error. But this is always the wrong hint. I spent half an hour on this question to find a solution. Finally found is driver classname error, the default selection is wrong. The correct one should be this:

If you could start noticing here, you wouldn't have spent so much time here as I did. Cry
Finally we tested successfully:

So our database connection is complete.
Although it is a preparatory work, but I am not familiar with the database, the situation is still very troublesome ...

Alkane 2018-01-22 17:07:54

MyEclipse connecting MySQL Database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.