Using the Database integration tool of IDEA (Database) to connect to the Database, take MySQL as an example, through the built-in Database tool connection operation, show the project as Maven project, through this method can use the powerful function of IDEA.

Add database-driven dependencies

 <dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
 </dependency>
Copy the code

Create MySQL data source

Filling in database Information

Setting the database Driver

Either way, you can go to the database driven Settings page

Add the local JAR package

{maven repository address}\mysql\mysql-connector-java

Test the connection

An error message is displayed indicating that the time zone is invalid. Set the time zone

Set the time zone

Enter UTC in the serverTimezone option

The connection is successful

Viewing the database