参考:https://www.cnblogs.com/idelo/p/9466345.html
https://www.jianshu.com/p/2de5ceec6c9a
1.如果驱动使用的是sqljdbc4,建议换成mssql-jdbc,根据jdk选择对应的版本.
2.如果碰到"xa not support dbType :sqlserver"这个异常,解决办法是把MSSQL进行单独判断,使用SQLServerXADataSource
AtomikosDataSourceBean atomikosDataSourceBean = new AtomikosDataSourceBean();
if(druidProperties.getDriverClassName().equals("com.microsoft.sqlserver.jdbc.SQLServerDriver")){
SQLServerXADataSource datasource = new SQLServerXADataSource();
datasource.setURL(druidProperties.getUrl());
datasource.setUser(druidProperties.getUsername());
datasource.setPassword(druidProperties.getPassword());
atomikosDataSourceBean.setXaDataSource(datasource);
}else {
atomikosDataSourceBean.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
atomikosDataSourceBean.setMaxPoolSize(20);
atomikosDataSourceBean.setBorrowConnectionTimeout(60);
atomikosDataSourceBean.setXaProperties(druidProperties.createProperties());
}
atomikosDataSourceBean.setUniqueResourceName(dataSourceName);