本文整理汇总了Java中org.hsqldb.jdbc.pool.JDBCXADataSource类的典型用法代码示例。如果您正苦于以下问题:Java JDBCXADataSource类的具体用法?Java JDBCXADataSource怎么用?Java JDBCXADataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JDBCXADataSource类属于org.hsqldb.jdbc.pool包,在下文中一共展示了JDBCXADataSource类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: props
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public Properties props() {
return new PropertiesBuilder()
.p("openejb.jdbc.datasource-creator", BoneCPDataSourceCreator.class.getName())
.p("txMgr", "new://TransactionManager?type=TransactionManager")
.p("txMgr.txRecovery", "true")
.p("txMgr.logFileDir", "target/test/xa/howl")
// real XA datasources
.p("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName())
.p("xa.url", "jdbc:hsqldb:mem:tomcat-xa")
.p("xa.user", "sa")
.p("xa.password", "")
.p("xa.SkipImplicitAttributes", "true")
.p("xadb", "new://Resource?type=DataSource")
.p("xadb.xaDataSource", "xa")
.p("xadb.JtaManaged", "true")
.build();
}
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:XABoneCPTest.java
示例2: props
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public Properties props() {
return new PropertiesBuilder()
.p("openejb.jdbc.datasource-creator", DefaultDataSourceCreator.class.getName())
.p("txMgr", "new://TransactionManager?type=TransactionManager")
.p("txMgr.txRecovery", "true")
.p("txMgr.logFileDir", "target/test/xa/howl_XAPoolTest")
// real XA datasources
.p("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName())
.p("xa.url", "jdbc:hsqldb:mem:dbcpxa")
.p("xa.user", "sa")
.p("xa.password", "")
.p("xa.SkipImplicitAttributes", "true")
.p("xa.SkipPropertiesFallback", "true") // otherwise goes to connection properties
.p("xadb", "new://Resource?type=DataSource")
.p("xadb.xaDataSource", "xa")
.p("xadb.JtaManaged", "true")
.p("xadb.MaxIdle", "25")
.p("xadb.MaxTotal", "25")
.p("xadb.InitialSize", "3")
.build();
}
开发者ID:apache,项目名称:tomee,代码行数:27,代码来源:XAPoolTest.java
示例3: props
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public Properties props() {
return new PropertiesBuilder()
.p("openejb.jdbc.datasource-creator", DefaultDataSourceCreator.class.getName())
.p("txMgr", "new://TransactionManager?type=TransactionManager")
.p("txMgr.txRecovery", "true")
.p("txMgr.logFileDir", "target/test/xa/DbcpNPEXAConnectionTest")
// real XA datasources
.p("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName())
.p("xa.url", "jdbc:hsqldb:mem:dbcpxa")
.p("xa.user", "sa")
.p("xa.password", "")
.p("xa.SkipImplicitAttributes", "true")
.p("xa.SkipPropertiesFallback", "true") // otherwise goes to connection properties
.p("xadb", "new://Resource?type=DataSource")
.p("xadb.xaDataSource", "xa")
.p("xadb.JtaManaged", "true")
.p("xadb.MaxIdle", "25")
.p("xadb.MaxTotal", "25")
.p("xadb.InitialSize", "3")
.build();
}
开发者ID:apache,项目名称:tomee,代码行数:27,代码来源:DbcpNPEXAConnectionTest.java
示例4: config
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public Properties config() {
final File file = new File("target/test/xa/howl");
if (file.isDirectory()) {
Files.delete(file);
}
final Properties p = new Properties();
p.put(DataSourceCreator.class.getName(), DbcpDataSourceCreator.class.getName()); // default dbcp pool supports xaDataSource config, not our proxy layer
p.put("txMgr", "new://TransactionManager?type=TransactionManager");
p.put("txMgr.txRecovery", "true");
p.put("txMgr.logFileDir", "target/test/xa/howl");
p.put("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
p.put("xa.url", "jdbc:hsqldb:mem:xa");
p.put("xa.user", "sa");
p.put("xa.password", "");
p.put("xa.SkipImplicitAttributes", "true"); // conflict with connectionProperties
p.put("xaFacade", "new://Resource?class-name=" + IsDifferentXaDataSourceWrapper.class.getName() + "&constructor=delegate");
p.put("xaFacade.delegate", "@xa");
return p;
}
开发者ID:apache,项目名称:tomee,代码行数:26,代码来源:XADataSourceIsDifferentTest.java
示例5: createHsqlDataSource
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
private XADataSource createHsqlDataSource() throws SQLException, IOException {
JDBCXADataSource ds = new JDBCXADataSource();
ds.setURL("jdbc:hsqldb:mem:target/testdb");
ds.setUser("sa");
ds.setPassword("");
return ds;
}
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:8,代码来源:HsqlTest.java
示例6: dataSource
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Bean(initMethod = "init", destroyMethod = "close")
public DataSource dataSource() throws SQLException {
AtomikosDataSourceBean datasource = new AtomikosDataSourceBean();
datasource.setUniqueResourceName("xads");
JDBCXADataSource hsqlDs = new JDBCXADataSource();
hsqlDs.setURL("jdbc:hsqldb:mem:test?hsqldb.applog=3");
hsqlDs.setUser("sa");
hsqlDs.setPassword("");
datasource.setXaDataSource(hsqlDs);
return datasource;
}
开发者ID:Kloudtek,项目名称:ktspring,代码行数:12,代码来源:AtomikosHsqlMemDbDatasourceConfig.java
示例7: createFromUrl
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Test
public void createFromUrl() throws Exception {
ApplicationContext context = createContext(FromProperties.class,
"spring.datasource.url:jdbc:hsqldb:mem:test",
"spring.datasource.username:un");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertThat(dataSource).isNotNull();
assertThat(dataSource.getUrl()).isEqualTo("jdbc:hsqldb:mem:test");
assertThat(dataSource.getUser()).isEqualTo("un");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:XADataSourceAutoConfigurationTests.java
示例8: createFromClass
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Test
public void createFromClass() throws Exception {
ApplicationContext context = createContext(FromProperties.class,
"spring.datasource.xa.data-source-class-name:org.hsqldb.jdbc.pool.JDBCXADataSource",
"spring.datasource.xa.properties.database-name:test");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertThat(dataSource).isNotNull();
assertThat(dataSource.getDatabaseName()).isEqualTo("test");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:XADataSourceAutoConfigurationTests.java
示例9: createFromUrl
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Test
public void createFromUrl() throws Exception {
ApplicationContext context = createContext(FromProperties.class,
"spring.datasource.url:jdbc:hsqldb:mem:test",
"spring.datasource.username:un");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertNotNull(dataSource);
assertThat(dataSource.getUrl(), equalTo("jdbc:hsqldb:mem:test"));
assertThat(dataSource.getUser(), equalTo("un"));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:XADataSourceAutoConfigurationTests.java
示例10: createFromClass
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Test
public void createFromClass() throws Exception {
ApplicationContext context = createContext(FromProperties.class,
"spring.datasource.xa.data-source-class-name:org.hsqldb.jdbc.pool.JDBCXADataSource",
"spring.datasource.xa.properties.database-name:test");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertNotNull(dataSource);
assertThat(dataSource.getDatabaseName(), equalTo("test"));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:XADataSourceAutoConfigurationTests.java
示例11: props
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public Properties props() {
return new PropertiesBuilder()
.p("openejb.jdbc.datasource-creator", TomEEDataSourceCreator.class.getName())
.p("txMgr", "new://TransactionManager?type=TransactionManager")
.p("txMgr.txRecovery", "true")
.p("txMgr.logFileDir", "target/test/xa/howl")
// real XA datasources
.p("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName())
.p("xa.url", "jdbc:hsqldb:mem:tomcat-xa")
.p("xa.user", "sa")
.p("xa.password", "")
.p("xa.SkipImplicitAttributes", "true")
.p("xa.SkipPropertiesFallback", "true") // otherwise goes to connection properties
.p("xadb", "new://Resource?type=DataSource")
.p("xadb.xaDataSource", "xa")
.p("xadb.JtaManaged", "true")
.p("xadb.MaxIdle", "25")
.p("xadb.MaxActive", "25")
.p("xadb.InitialSize", "3")
.p("xa2", "new://Resource?class-name=" + BadDataSource.class.getName())
.p("xa2.url", "jdbc:hsqldb:mem:tomcat-xa2")
.p("xa2.user", "sa")
.p("xa2.password", "")
.p("xa2.SkipImplicitAttributes", "true")
.p("xa2.SkipPropertiesFallback", "true") // otherwise goes to connection properties
.p("xadb2", "new://Resource?type=DataSource")
.p("xadb2.xaDataSource", "xa2")
.p("xadb2.JtaManaged", "true")
.p("xadb2.MaxIdle", "25")
.p("xadb2.MaxActive", "25")
.p("xadb2.InitialSize", "3")
.build();
}
开发者ID:apache,项目名称:tomee,代码行数:41,代码来源:TomcatXADataSourceTest.java
示例12: newXADataSource
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Override
public XADataSource newXADataSource() throws SQLException {
return new JDBCXADataSource();
}
开发者ID:wisdom-framework,项目名称:wisdom-jdbc,代码行数:5,代码来源:HsqlDbService.java
示例13: config
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Configuration
public java.util.Properties config() {
final File file = new File("target/test/xa/howl");
if (file.isDirectory()) {
Files.delete(file);
}
final Properties p = new Properties();
p.put(DataSourceCreator.class.getName(), DbcpDataSourceCreator.class.getName()); // default dbcp pool supports xaDataSource config, not our proxy layer
p.put("txMgr", "new://TransactionManager?type=TransactionManager");
p.put("txMgr.txRecovery", "true");
p.put("txMgr.logFileDir", "target/test/xa/howl");
// real XA datasources
p.put("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
p.put("xa.url", "jdbc:hsqldb:mem:xa");
p.put("xa.user", "sa");
p.put("xa.password", "");
p.put("xa.SkipImplicitAttributes", "true"); // conflict with connectionProperties
p.put("xa2", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
p.put("xa2.url", "jdbc:hsqldb:mem:xa2");
p.put("xa2.user", "sa");
p.put("xa2.password", "");
p.put("xa2.SkipImplicitAttributes", "true");
// pooled "XA" datasources
p.put("xadb", "new://Resource?type=DataSource");
p.put("xadb.XaDataSource", "xa"); // to be xa
p.put("xadb.JtaManaged", "true");
p.put("xadb2", "new://Resource?type=DataSource");
p.put("xadb2.XaDataSource", "xa2"); // to be xa
p.put("xadb2.JtaManaged", "true");
// non jta datasources
p.put("xadbn", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
p.put("xadbn.JdbcDriver", jdbcDriver.class.getName());
p.put("xadbn.url", "jdbc:hsqldb:mem:xa");
p.put("xadbn.user", "sa");
p.put("xadbn.password", "");
p.put("xadbn2", "new://Resource?type=DataSource");
p.put("xadbn2.JdbcDriver", jdbcDriver.class.getName());
p.put("xadbn2.JdbcUrl", "jdbc:hsqldb:mem:xa2");
p.put("xadbn2.UserName", "sa");
p.put("xadbn2.Password", "");
p.put("xadbn2.JtaManaged", "false");
return p;
}
开发者ID:apache,项目名称:tomee,代码行数:53,代码来源:XADataSourceTest.java
示例14: nonJta
import org.hsqldb.jdbc.pool.JDBCXADataSource; //导入依赖的package包/类
@Test
public void nonJta() throws Exception {
assertTrue(JDBCXADataSource.class.isInstance(new InitialContext().lookup("java:app/xads2")));
}
开发者ID:apache,项目名称:tomee,代码行数:5,代码来源:XADataSourceDefinitionTest.java
注:本文中的org.hsqldb.jdbc.pool.JDBCXADataSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论