产品网站 模板,江苏网站建设seo优化,怎么做淘宝联盟的推广网站,国家职业技能培训平台为什么使用jdbc集成
需求简单#xff0c;只是往phoneix存储数据原本项目已经有mysql的mybatis plus集成#xff0c;如果采用dataSource方式就需要采用多数据源的方式#xff0c;造成架构复杂化#xff0c;使用复杂化#xff0c;并且修改地方过多。
Qualifier(phoe…为什么使用jdbc集成
需求简单只是往phoneix存储数据原本项目已经有mysql的mybatis plus集成如果采用dataSource方式就需要采用多数据源的方式造成架构复杂化使用复杂化并且修改地方过多。
Qualifier(phoenixJdbcTemplate)
Autowired
private JdbcTemplate jdbcTemplate;Configuration
public class PhoenixConfig {private String phoenixUrl;private String phoenixDriverClassName;Bean(name phoenixJdbcTemplate)public JdbcTemplate phoenixJdbcTemplate() {DruidDataSource druidDataSource new DruidDataSource();druidDataSource.setUrl(phoenixUrl);druidDataSource.setDriverClassName(phoenixDriverClassName);druidDataSource.setConnectionProperties(phoenix.schema.isNamespaceMappingEnabledtrue);druidDataSource.setInitialSize(20);druidDataSource.setMaxActive(40);druidDataSource.setQueryTimeout(30);druidDataSource.setMaxWait(4000);druidDataSource.setDbType(phoenix);return new JdbcTemplate(druidDataSource);}
}