Created
May 31, 2018 13:41
-
-
Save phillipuniverse/2bd00a2fa41312b749a0f6d7748050c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class CustomDatabaseAutoConfiguration extends DatabaseAutoConfiguration { | |
protected DataSource buildDataSource() { | |
DatabaseDriver driver = DatabaseDriver.fromJdbcUrl(props.getUrl()); | |
com.zaxxer.hikari.HikariDataSource ds = DataSourceBuilder | |
.create() | |
.username(props.getUser()) | |
.password(props.getPassword()) | |
.url(props.getUrl()) | |
.driverClassName(driver.getDriverClassName()) | |
.type(com.zaxxer.hikari.HikariDataSource.class) | |
.build(); | |
// customize other DataSource settings | |
return ds; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment