Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Spring Boot DB2 and MSSQL Configuration

$
0
0

By default Spring boot does a lot for you in datasource configuration, but if you’re using two separate database types DB2, mssql, mysql, Oracle, etc. It doesn’t know how to infer which database type each is, so if you are configuring multiple different database types in Spring you need to specify the jpa.database type. In a yaml configuration your datasources should be defines like so.

spring: datasource: url: jdbc:sqlserver://${server}:${port};databaseName=${databaseName} username: ${username} password: ${password} jpa: database: sql_server db2: datasource: jdbcurl: jdbc:db2://${server}:${port}/${databaseName} username: ${username} password: ${password} jpa: database: db2


Viewing all articles
Browse latest Browse all 3160

Trending Articles