springboot動(dòng)態(tài)切換數(shù)據(jù)源 springboot配置兩個(gè)數(shù)據(jù)源怎么實(shí)現(xiàn)?
springboot配置兩個(gè)數(shù)據(jù)源怎么實(shí)現(xiàn)?配置多個(gè)數(shù)據(jù)源信息,如datasource1、datasource2、datasource3等,定義一個(gè)動(dòng)態(tài)數(shù)據(jù)源類,同時(shí)注入上述數(shù)據(jù)源和相應(yīng)的標(biāo)志。一般用
springboot配置兩個(gè)數(shù)據(jù)源怎么實(shí)現(xiàn)?
配置多個(gè)數(shù)據(jù)源信息,如datasource1、datasource2、datasource3等,定義一個(gè)動(dòng)態(tài)數(shù)據(jù)源類,同時(shí)注入上述數(shù)據(jù)源和相應(yīng)的標(biāo)志。一般用地圖來區(qū)分。使用動(dòng)態(tài)數(shù)據(jù)源類得到相應(yīng)的數(shù)據(jù)源操作