[关闭]
@nextleaf 2018-11-16T23:40:51.000000Z 字数 757 阅读 772

常用数据源和连接器


maven依赖

  1. <!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
  2. <dependency>
  3. <groupId>com.alibaba</groupId>
  4. <artifactId>druid</artifactId>
  5. <version>${druid-version}</version>
  6. </dependency>
  7. <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
  8. <dependency>
  9. <groupId>mysql</groupId>
  10. <artifactId>mysql-connector-java</artifactId>
  11. <version>${mysql-version}</version>
  12. </dependency>

config.properties或db.properties

  1. jdbc.driverClassName=com.mysql.cj.jdbc.Driver
  2. jdbc.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
  3. jdbc.username=
  4. jdbc.password=

druid官方文档https://github.com/alibaba/druid/wiki/常见问题

druid配置博文https://www.cnblogs.com/wuyun-blog/p/5679073.html

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注