以数据库MySQL8.0.16为例:
JDBC连接:
//加载数据库驱动
Class.forName("com.mysql.cj.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/库名?useUnicode=true&characterEncoding=UTF-8&userSSL=false&serverTimezone=GMT%2B8&useSSL=false";
//建立数据库
conn=DriverManager.getConnection(url, "root", "123456");
database.properties
#加载数据库驱动
driver=com.mysql.cj.jdbc.Driver
url = jdbc:mysql://localhost:3306/库名?useUnicode=true&characterEncoding=UTF-8&userSSL=false&serverTimezone=GMT%2B8&useSSL=false
user=root
password=123456
pom.xml
帮助:
MySQL 8.0新特性:
- https://blog.csdn.net/devcloud/article/details/91802620
- https://www.cnblogs.com/xyabk/p/10882913.html
MySQL 必备资源汇总:https://blog.csdn.net/horses/article/details/99944757
共勉:明日复明日,明日何其多。我生待明日,万事成蹉跎。