Skip to content

yookue/datasource-builder-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datasource Builder Spring Boot Starter

Spring Boot application integrates DataSource quickly.

Quickstart

  • Import dependencies
    <dependency>
        <groupId>com.yookue.springstarter</groupId>
        <artifactId>datasource-builder-spring-boot-starter</artifactId>
        <version>LATEST</version>
    </dependency>

By default, this starter will auto take effect, you can turn it off by spring.datasource-builder.enabled = false

  • Configure your beans with a DataSourceBuilder bean by constructor or @Autowired/@Resource annotation, then you can create beans with it as following:
Method Return Method Name
DataSourceProperties dataSourceProperties
DataSource dataSource
DataSource xaDataSource
DataSourceTransactionManager jdbcTransactionManager
JpaTransactionManager jpaTransactionManager
  • This starter supports the most popular data source pools in the word, including
    • c3p0
    • dbcp2
    • druid
    • hikari
    • oracle ucp
    • tomcat
    • vibur

Document

Requirement

  • jdk 1.8+

License

This project is under the Apache License 2.0

See the NOTICE.txt file for required notices and attributions.

Donation

You like this package? Then donate to Yookue to support the development.

Website