本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}