本文整理汇总了Java中com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.setUser方法的典型用法代码示例。如果您正苦于以下问题:Java MysqlXADataSource.setUser方法的具体用法?Java MysqlXADataSource.setUser怎么用?Java MysqlXADataSource.setUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
的用法示例。
在下文中一共展示了MysqlXADataSource.setUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dataSource
import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource; //导入方法依赖的package包/类
@Bean(initMethod = "init", destroyMethod = "close")
public DataSource dataSource() {
MysqlXADataSource mysqlXaDataSource = new MysqlXADataSource();
mysqlXaDataSource
.setUrl("jdbc:mysql://localhost:3306/flowable?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC");
mysqlXaDataSource.setPinGlobalTxToPhysicalConnection(true);
mysqlXaDataSource.setPassword("flowable");
mysqlXaDataSource.setUser("flowable");
AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
xaDataSource.setXaDataSource(mysqlXaDataSource);
xaDataSource.setUniqueResourceName("xads");
xaDataSource.setBorrowConnectionTimeout(30000);
xaDataSource.setMinPoolSize(10);
xaDataSource.setPoolSize(20);
xaDataSource.setMaxPoolSize(50);
return xaDataSource;
}
示例2: customerDataSource
import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource; //导入方法依赖的package包/类
@Primary
@Bean(name = "customerDataSource", initMethod = "init", destroyMethod = "close")
// @Qualifier("customerDataSource")
public DataSource customerDataSource() {
MysqlXADataSource mysqlXaDataSource = new MysqlXADataSource();
mysqlXaDataSource.setUrl(customerDatasourceProperties.getUrl());
mysqlXaDataSource.setPinGlobalTxToPhysicalConnection(true);
mysqlXaDataSource.setPassword(customerDatasourceProperties.getPassword());
mysqlXaDataSource.setUser(customerDatasourceProperties.getUsername());
mysqlXaDataSource.setPinGlobalTxToPhysicalConnection(true);
AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
xaDataSource.setXaDataSource(mysqlXaDataSource);
xaDataSource.setUniqueResourceName("xads1");
return xaDataSource;
}
示例3: orderDataSource
import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource; //导入方法依赖的package包/类
@Bean(name = "orderDataSource", initMethod = "init", destroyMethod = "close")
public DataSource orderDataSource() {
MysqlXADataSource mysqlXaDataSource = new MysqlXADataSource();
mysqlXaDataSource.setUrl(orderDatasourceProperties.getUrl());
mysqlXaDataSource.setPinGlobalTxToPhysicalConnection(true);
mysqlXaDataSource.setPassword(orderDatasourceProperties.getPassword());
mysqlXaDataSource.setUser(orderDatasourceProperties.getUsername());
mysqlXaDataSource.setPinGlobalTxToPhysicalConnection(true);
AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
xaDataSource.setXaDataSource(mysqlXaDataSource);
xaDataSource.setUniqueResourceName("xads2");
return xaDataSource;
}
示例4: createMySQLDatasource
import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource; //导入方法依赖的package包/类
private XADataSource createMySQLDatasource() {
System.out.println("URL: " + getJdbcUrl());
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
MysqlXADataSource mysqlXADataSource = new MysqlXADataSource();
mysqlXADataSource.setURL(getJdbcUrl() + "?pinGlobalTxToPhysicalConnection=true");
mysqlXADataSource.setUser(getDbUser());
mysqlXADataSource.setPassword(getDbPassword());
return mysqlXADataSource;
}