Last active
June 13, 2024 11:17
-
-
Save sachin-handiekar/af78e8f54da3c529fc9cdc35230dbb3c 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
public static DataSource createFlexyPoolDataSource() { | |
BasicDataSource basicDataSource = (BasicDataSource) DataSourceConfig.getDataSource(); | |
Configuration<BasicDataSource> configuration = new Configuration.Builder<>( | |
"myFlexyPool", basicDataSource, BasicDataSourcePoolAdapter.FACTORY | |
).build(); | |
return new FlexyPoolDataSource<>(configuration); | |
} | |
public static JdbcTemplate createJdbcTemplate() { | |
DataSource flexyPoolDataSource = createFlexyPoolDataSource(); | |
return new JdbcTemplate(flexyPoolDataSource); | |
} | |
<dependency> | |
<groupId>com.vladmihalcea.flexy</groupId> | |
<artifactId>flexy-pool-core</artifactId> | |
<version>2.1.1</version> | |
</dependency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment