I am trying to learn different ways of creating DataSource.
In this example https://github.com/ivoronline/springboot_db_datasource_create_DataSourceBuilder i have used DriverManagerDataSource.class to successfully create Datasource as shown below
application.properties
# ORACLE DB
my.spring.datasource.url = jdbc:oracle:thin:@localhost:1522/orcl
my.spring.datasource.username = TEST
my.spring.datasource.password = LETMEIN
MyDatabaseConfig
@Configuration
public class MyDatabaseConfig {
//=========================================================================================================
// DATA SOURCE
//=========================================================================================================
@Bean
@ConfigurationProperties("my.spring.datasource")
public DataSource dataSource() {
return DataSourceBuilder.create().type(DriverManagerDataSource.class).build();
}
}
But when I try to replace DriverManagerDataSource.class with HikariDataSource.class I get error. I am confused because in this other https://github.com/ivoronline/springboot_db_datasource_SaveSameEntityToDifferetnSchema more complicated project this was working.