|
|
|
@ -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");
|
|
|
|
|
* 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.jdbc.DatabaseDriver;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Actual DataSource configurations imported by {@link DataSourceAutoConfiguration}.
|
|
|
|
@ -45,6 +46,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
|
/**
|
|
|
|
|
* Tomcat Pool DataSource configuration.
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
|
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
|
|
|
|
@ -71,6 +73,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
|
/**
|
|
|
|
|
* Hikari DataSource configuration.
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnClass(HikariDataSource.class)
|
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
|
|
|
|
@ -89,6 +92,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
|
*
|
|
|
|
|
* @deprecated as of 1.5 in favor of DBCP2
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnClass(org.apache.commons.dbcp.BasicDataSource.class)
|
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp.BasicDataSource", matchIfMissing = true)
|
|
|
|
@ -116,6 +120,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
|
/**
|
|
|
|
|
* DBCP DataSource configuration.
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
|
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
|
|
|
|
@ -134,6 +139,7 @@ abstract class DataSourceConfiguration {
|
|
|
|
|
/**
|
|
|
|
|
* Generic DataSource configuration.
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
@ConditionalOnMissingBean(DataSource.class)
|
|
|
|
|
@ConditionalOnProperty(name = "spring.datasource.type")
|
|
|
|
|
static class Generic {
|
|
|
|
|