|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -26,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.jdbc.DatabaseDriver;
|
|
|
|
import org.springframework.boot.jdbc.DatabaseDriver;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -46,6 +47,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tomcat Pool DataSource configuration.
|
|
|
|
* Tomcat Pool DataSource configuration.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
|
|
|
|
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
|
|
|
@ -72,6 +74,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Hikari DataSource configuration.
|
|
|
|
* Hikari DataSource configuration.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass(HikariDataSource.class)
|
|
|
|
@ConditionalOnClass(HikariDataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
|
|
|
@ -93,6 +96,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* DBCP DataSource configuration.
|
|
|
|
* DBCP DataSource configuration.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
|
|
|
|
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
|
|
|
@ -111,6 +115,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Generic DataSource configuration.
|
|
|
|
* Generic DataSource configuration.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type")
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type")
|
|
|
|
static class Generic {
|
|
|
|
static class Generic {
|
|
|
|