当前位置: 首页>>代码示例>>Java>>正文


Java MysqlXADataSource.setUser方法代码示例

本文整理汇总了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;
}
 
开发者ID:flowable,项目名称:flowable-examples,代码行数:19,代码来源:Configuration.java

示例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;

	}
 
开发者ID:YihuaWanglv,项目名称:spring-boot-jta-atomikos-sample,代码行数:18,代码来源:CustomerConfig.java

示例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;
}
 
开发者ID:YihuaWanglv,项目名称:spring-boot-jta-atomikos-sample,代码行数:15,代码来源:OrderConfig.java

示例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;
}
 
开发者ID:adrobisch,项目名称:brainslug,代码行数:14,代码来源:TestDataSourceConfiguration.java


注:本文中的com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.setUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。