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


Java PoolingDataSource.setDriverProperties方法代码示例

本文整理汇总了Java中bitronix.tm.resource.jdbc.PoolingDataSource.setDriverProperties方法的典型用法代码示例。如果您正苦于以下问题:Java PoolingDataSource.setDriverProperties方法的具体用法?Java PoolingDataSource.setDriverProperties怎么用?Java PoolingDataSource.setDriverProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bitronix.tm.resource.jdbc.PoolingDataSource的用法示例。


在下文中一共展示了PoolingDataSource.setDriverProperties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
@Override
public DataSource createDataSource(IsolationLevel isolationLevel, Class<?> qualifier,
        Consumer<Closeable> closeableRegistrar) {
    Properties props = new Properties();
    initializeProperties(props);

    PoolingDataSource btmDataSource = new PoolingDataSource();
    btmDataSource.setUniqueName((qualifier == null ? "" : qualifier.getSimpleName()) + "_" + isolationLevel.name());
    btmDataSource.setClassName(databaseIntegrationInfo.getDataSourceClass().getName());
    btmDataSource.setIsolationLevel(isolationLevel.name());
    btmDataSource.setDriverProperties(props);
    btmDataSource.setShareTransactionConnections(true);
    btmDataSource.setMaxPoolSize(10);
    btmDataSource.setAllowLocalTransactions(true);
    btmDataSource.setMinPoolSize(1);
    customizeDataSource(btmDataSource);

    closeableRegistrar.accept(btmDataSource::close);
    return new P6DataSource(btmDataSource);
}
 
开发者ID:ruediste,项目名称:rise,代码行数:21,代码来源:BitronixDataSourceFactory.java

示例2: batchMetaDataDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
@Bean(initMethod = "init", destroyMethod = "close")
public PoolingDataSource batchMetaDataDataSource() {
	PoolingDataSource ds = new PoolingDataSource();

	ds.setClassName(org.hsqldb.jdbc.pool.JDBCXADataSource.class.getName());
	ds.setUniqueName("batchdb");
	ds.setMaxPoolSize(100);

	Properties props = new Properties();
	props.setProperty("databaseName", "spring-batch-metadata");
	// props.setProperty("createDatabase", "create");
	ds.setDriverProperties(props);

	ds.setAllowLocalTransactions(true);

	final ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
	populator.addScript(batchDropSchemaScript);
	populator.addScript(batchCreateSchemaScript);
	DatabasePopulatorUtils.execute(populator, ds);

	return ds;
}
 
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:23,代码来源:JtaConfiguration.java

示例3: applicationDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
@Bean(initMethod = "init", destroyMethod = "close")
public PoolingDataSource applicationDataSource() {
	PoolingDataSource ds = new PoolingDataSource();

	ds.setClassName(org.hsqldb.jdbc.pool.JDBCXADataSource.class.getName());
	ds.setUniqueName("appdb");
	ds.setMaxPoolSize(100);

	final Properties props = new Properties();
	props.setProperty("databaseName", "chapter09-application");
	// props.setProperty("createDatabase", "create");
	ds.setDriverProperties(props);

	ds.setAllowLocalTransactions(true);

	final ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
	populator.addScript(dropTablesScript);
	populator.addScript(createTableScript);
	DatabasePopulatorUtils.execute(populator, ds);

	return ds;
}
 
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:23,代码来源:JtaConfiguration.java

示例4: actualDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
@Bean(destroyMethod = "close")
public DataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("url", jdbcUrl);
    return poolingDataSource;
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:15,代码来源:JTATransactionManagerConfiguration.java

示例5: actualDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
public DataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("url", jdbcUrl);
    return poolingDataSource;
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:14,代码来源:HSQLDBJtaTransactionManagerConfiguration.java

示例6: actualDataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
public DataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("databaseName", jdbcDatabase);
    poolingDataSource.getDriverProperties().put("serverName", jdbcHost);
    poolingDataSource.getDriverProperties().put("portNumber", jdbcPort);
    return poolingDataSource;
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:16,代码来源:PostgreSQLJTATransactionManagerConfiguration.java

示例7: dataSource

import bitronix.tm.resource.jdbc.PoolingDataSource; //导入方法依赖的package包/类
@Bean
	public javax.sql.DataSource dataSource() {
		// TODO: make it as configurable
		PoolingDataSource dataSource0 = new PoolingDataSource();
		dataSource0.setClassName("com.mysql.jdbc.jdbc2.optional.MysqlXADataSource");
		try {
			//Each datasource must be assigned a unique name. This is required for distributed crash recovery.
			dataSource0.setUniqueName(InetAddress.getLocalHost().getHostAddress());
		} catch (UnknownHostException e) {
		}
		dataSource0.setAutomaticEnlistingEnabled(true);
		dataSource0.setAllowLocalTransactions(true);
		dataSource0.setShareTransactionConnections(true);
		dataSource0.setUseTmJoin(true);
		dataSource0.setMinPoolSize(1);
		dataSource0.setMaxPoolSize(100);
		
		Properties driverProperties = new Properties();
		driverProperties.put("url", this.getDataSource().getUrl());
		driverProperties.put("user", this.getDataSource().getUsername());
		driverProperties.put("password", this.getDataSource().getPassword());
		driverProperties.put("password", this.getDataSource().getPassword());
//		driverProperties.put("journal", this.getDataSource().getPassword());
//		driverProperties.put("log-part1-filename", "btm1.tlog");
//		driverProperties.put("log-part2-filename", "btm2.tlog");
		
		dataSource0.setDriverProperties(driverProperties);
		dataSource0.init();
		return dataSource0;
	}
 
开发者ID:shaolinwu,项目名称:uimaster,代码行数:31,代码来源:PersistentConfig.java


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