1. jdbc.properties配置文件的编写
jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://ip:port/database?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
jdbc.username=root
jdbc.password=123
2. druid.properties配置文件的编写
druid.driverClassName = com.mysql.cj.jdbc.Driver
druid.url= jdbc:mysql://ip:port/database?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
druid.username = root
druid.password = 123
druid.maxActive=20
3. jdbc连接数据库的代码
class A{
final String USERNAME="root";
final String PASSWORD="123";
final String URL="jdbc:mysql://192.168.0.154:3306/book_db?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true";
Class.forName(