在spring中application.properties 配置 sql 数据源

原创于 【模棱博客】

在spring中application.properties 配置 sql 数据源以下翻译为Spring官网

https://docs.spring.io/spring-boot/docs/1.5.8.RELEASE/reference/htmlsingle/#boot-features-configure-datasource

# data source ( datasourceautoconfiguration & datasourceproperties )
spring.datasource.continue - on - error = false#不要在初始化数据库时发生错误。
spring.datasource.data = # data ( DML)脚本资源引用。
spring.datasource.data - -用于执行DML脚本的数据库的# user(如果不同)。
spring.datasource.data - password=数据库执行DML脚本的密码(如果不同)。
spring.datasource.dbcp2. * = # commonsdbcp2特定设置
spring.datasource.driver - class - name = #JDBC驱动程序的完全限定名。默认情况下基于URL自动检测到。
spring.datasource.generate - unique - name = false#生成一个随机数据源名称。
spring.datasource.hikari. * = #hikari特定设置
spring.datasource.initialize = true #使用' data.sql'填充数据库。
enabled = false#启用JMX支持(如果由底层池提供)。
spring.datasource.jndi - name=数据源的JNDI位置。类、URL、用户名和密码设置时将被忽略。
spring.datasource.name = datasource的名称。
spring.datasource.password=数据库的#登录密码。
spring.datasource.platform =在DDL或DML脚本(例如模式-${ platform })中使用的所有#平台。SQL或数据-${ platform}。SQL)。
spring.datasource.schema = # schema ( DDL)脚本资源引用。
spring.datasource.schema - -用于执行DDL脚本的数据库的用户名= # user(如果不同)。
spring.datasource.schema - password =数据库的#password,以执行DDL脚本(如果不同)。
spring.datasource.separator=;在SQL初始化脚本中的#语句分隔符。
spring.datasource.sql - script -编码= #SQL脚本编码。
spring.datasource.tomcat. * = #Tomcat数据源特定设置
spring.datasource.type=要使用的连接池实现的完全限定名。默认情况下,它是从类路径中删除的。
spring.datasource.url =数据库的# JDBCURL。
spring.datasource.username=数据库的#登录用户。
spring.datasource.xa.data - source - class - name = #xa数据源完全限定名。
spring.datasource.xa.properties =#属性传递到xa数据源。

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值