Springboot 2.3.1 dynamically update Jdbc template's schema in Multi-tenant environment

前端 未结 2 1984
不思量自难忘°
不思量自难忘° 2021-01-03 17:24

My Project is on spring-boot-starter-parent - "1.5.9.RELEASE" and I\'m migrating it to spring-boot-starter-parent - "2.3.1.RELEASE".

This is multi

2条回答
  •  旧时难觅i
    2021-01-03 17:59

    There's no need to get rid of JdbcTemplate. NativeJdbcExtractor was removed in Spring Framework 5 as it isn't needed with JDBC 4.

    You should replace your usage of NativeJdbcExtractor with calls to connection.unwrap(Class). The method is inherited by Connection from JDBC's Wrapper.

    You may also want to consider using AbstractRoutingDataSource which is designed to route connection requests to different underlying data sources based on a lookup key.

提交回复
热议问题