I have a Spring Boot micro service that connects to several databases through a JDBC connection using JDBCTemplate:
@Bean(name = "mysqlJdbcTemplate")
public JdbcTemplate jdbcTemplate(@Qualifier("mysqlDb") DataSource dsMySQL) {
return new JdbcTemplate(dsMySQL);
}
I have different template for each database and then rest template controller that chooses the right template to use depending on the parameters passed in the request. I read the documentation, however it's not clear:
- Is a connection pool used out of the box or I need to specify it through configuration?
- In this case is a connection pool used for each JDBCTemplate?