Mybatis-Spring icon indicating copy to clipboard operation
Mybatis-Spring copied to clipboard

可以配置多数据源吗?

Open zcc225 opened this issue 8 years ago • 4 comments

尝试配置多数据源没成功,,,,

zcc225 avatar Sep 27 '17 01:09 zcc225

能直接搜到很多相关的文章。

abel533 avatar Sep 27 '17 12:09 abel533

可以的,晚上有很多多数据源配置博客。Spring框架本身就支持多数据源配置。

dear-Alice-moon avatar Mar 19 '19 08:03 dear-Alice-moon

自己实现 AbstractRoutingDataSource

Alice-moon [email protected] 于2019年3月19日周二 下午4:17写道:

可以的,晚上有很多多数据源配置博客。Spring框架本身就支持多数据源配置。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/abel533/Mybatis-Spring/issues/27#issuecomment-474240415, or mute the thread https://github.com/notifications/unsubscribe-auth/ACxdgPvNDWmIzVCGREkZpSGkk5UC2EKtks5vYJ0hgaJpZM4PlE_z .

ivwsai avatar Mar 20 '19 12:03 ivwsai

自己实现 AbstractRoutingDataSource Alice-moon [email protected] 于2019年3月19日周二 下午4:17写道: 可以的,网上有很多多数据源配置博客。Spring框架本身就支持多数据源配置。 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#27 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACxdgPvNDWmIzVCGREkZpSGkk5UC2EKtks5vYJ0hgaJpZM4PlE_z .

  好像就是实现这个类,还需要用到 ThreadLocal 类。

dear-Alice-moon avatar Mar 25 '19 13:03 dear-Alice-moon