I have the following code which Spring can't resolve. What's the step I can take for this?
public JdbcTemplate jdbcTemplate() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
SimpleNativeJdbcExtractor simpleNativeJdbcExtractor = new SimpleNativeJdbcExtractor() {
@Override
public Connection getNativeConnection(Connection con) throws SQLException {
con.setSchema(TenantContext.getCurrentTenant());
return super.getNativeConnection(con);
}
@Override
public Connection getNativeConnectionFromStatement(Statement stmt) throws SQLException {
return super.getNativeConnectionFromStatement(stmt);
}
};
simpleNativeJdbcExtractor.setNativeConnectionNecessaryForNativeStatements(true);
jdbcTemplate.setNativeJdbcExtractor(simpleNativeJdbcExtractor);
return jdbcTemplate;
}
I this is the Spring boot I use for the app and also tried with an earlier version:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<!-- <version>1.5.11.RELEASE</version>-->
<relativePath/>
</parent>
Thank you.