• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EmbeddedConnectionPoolDataSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedConnectionPoolDataSource类的具体用法?Java EmbeddedConnectionPoolDataSource怎么用?Java EmbeddedConnectionPoolDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EmbeddedConnectionPoolDataSource类属于org.apache.derby.jdbc包,在下文中一共展示了EmbeddedConnectionPoolDataSource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: before

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@BeforeClass
public void before() {
    storage = new StorageServiceImpl();
    EmbeddedDataSource dataSource = new EmbeddedConnectionPoolDataSource();
    dataSource.setDatabaseName(System.getProperty("java.io.tmpdir") +
            File.separator + "chii2" +
            File.separator + "mqtt" +
            File.separator + "server");
    dataSource.setCreateDatabase("create");
    storage.setDataSource(dataSource);
    storage.start();
    storage.clearTable("MESSAGE_ID");
    storage.clearTable("RETAIN");
    storage.clearTable("INFLIGHT");
    storage.clearTable("QOS2");
    storage.clearTable("SUBSCRIPTION");
}
 
开发者ID:longkerdandy,项目名称:chii2mqtt,代码行数:18,代码来源:StorageServiceImplTest.java


示例2: IPADatabaseManager

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
/**
 * Hidden constructor
 */
private IPADatabaseManager() {
	// we assume database has been created
	// and filled with data
	
	// setup connection pool
	EmbeddedConnectionPoolDataSource dataSource = new EmbeddedConnectionPoolDataSource();
	
	File dbLoc = new File(_dbLoc + File.separator + _dbName);
	boolean create = false;
	if(!dbLoc.exists()) {
		dataSource.setCreateDatabase("create");
		create = true;
	}
	dataSource.setDatabaseName(_dbLoc + File.separator + _dbName);
	
	connPool = new MiniConnectionPoolManager(dataSource, 10);
	
	if(create)
		createDatabase();
	
	LOGGER.info("[IPADatabaseManager]: Database location = " + _dbLoc + File.separator + _dbName +
			", maxConnections = 10");

}
 
开发者ID:phon-ca,项目名称:phon,代码行数:28,代码来源:IPADatabaseManager.java


示例3: before

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@Before
public void before() throws SQLException {
    EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
    ds.setDatabaseName("memory:testDB");
    ds.setCreateDatabase("create");
    ds.setLogWriter(new PrintWriter(System.out));
    
    try (Connection conn = ds.getConnection();
            Statement statement = conn.createStatement()) {
        statement.execute(
                "CREATE TABLE ACTOR (\n"
                + "    ADDRESS VARCHAR(1024) NOT NULL, \n"
                + "    CHECKPOINT_DATA BLOB NOT NULL,\n"
                + "    CHECKPOINT_MESSAGE_DATA BLOB NOT NULL,\n"
                + "    CHECKPOINT_TIME BIGINT NOT NULL,\n"
                + "    CHECKPOINT_INSTANCE INTEGER NOT NULL,\n"
                + "    IDLE INTEGER NOT NULL,\n"
                + "    DATA BLOB NOT NULL,\n"
                + "    PRIMARY KEY (ADDRESS)\n"
                + ")\n"
        );
        statement.execute(
                "CREATE TABLE MESSAGE_QUEUE (\n"
                + "    MSG_NUMBER INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\n"
                + "    ADDRESS VARCHAR(1024) NOT NULL,\n"
                + "    DATA BLOB NOT NULL,\n"
                + "    PRIMARY KEY (MSG_NUMBER),\n"
                + "    FOREIGN KEY (ADDRESS) REFERENCES ACTOR(ADDRESS) ON DELETE CASCADE\n"
                + ")\n"
        );
    }
    
    JdbcStore store = JdbcStore.create("actor", ds);
    actorSystem = ActorSystem.builder()
            .withDirectGateway()
            .withActorGateway(1, store)
            .build();
}
 
开发者ID:offbynull,项目名称:actors,代码行数:39,代码来源:ActorSystemTest.java


示例4: before

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@Before
public void before() throws SQLException {
    EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
    ds.setDatabaseName("memory:testDB");
    ds.setCreateDatabase("create");
    ds.setLogWriter(new PrintWriter(System.out));
    
    try (Connection conn = ds.getConnection();
            Statement statement = conn.createStatement()) {
        statement.execute(
                "CREATE TABLE ACTOR (\n"
                + "    ADDRESS VARCHAR(1024) NOT NULL, \n"
                + "    CHECKPOINT_DATA BLOB NOT NULL,\n"
                + "    CHECKPOINT_MESSAGE_DATA BLOB NOT NULL,\n"
                + "    CHECKPOINT_TIME BIGINT NOT NULL,\n"
                + "    CHECKPOINT_INSTANCE INTEGER NOT NULL,\n"
                + "    IDLE INTEGER NOT NULL,\n"
                + "    DATA BLOB NOT NULL,\n"
                + "    PRIMARY KEY (ADDRESS)\n"
                + ")\n"
        );
        statement.execute(
                "CREATE TABLE MESSAGE_QUEUE (\n"
                + "    MSG_NUMBER INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\n"
                + "    ADDRESS VARCHAR(1024) NOT NULL,\n"
                + "    DATA BLOB NOT NULL,\n"
                + "    PRIMARY KEY (MSG_NUMBER),\n"
                + "    FOREIGN KEY (ADDRESS) REFERENCES ACTOR(ADDRESS) ON DELETE CASCADE\n"
                + ")\n"
        );
    }
    
    fixture = JdbcStore.create("actor", ds);
}
 
开发者ID:offbynull,项目名称:actors,代码行数:35,代码来源:JdbcStoreTest.java


示例5: createConnectionPoolDataSource

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@Override
public ConnectionPoolDataSource createConnectionPoolDataSource(
        final Properties inProperties) throws SQLException {
	final EmbeddedConnectionPoolDataSource outSource = new EmbeddedConnectionPoolDataSource();
	setup(outSource, inProperties);
	return outSource;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:8,代码来源:TestDataSourceFactoryDerby.java


示例6: WrappedDerbyDataSource

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
/**
 * ctor
 */
public WrappedDerbyDataSource() {
	this.ds = new EmbeddedConnectionPoolDataSource();
	JdbcProfilerDaemon.initializeDaemon();
}
 
开发者ID:dd00f,项目名称:ibm-performance-monitor,代码行数:8,代码来源:WrappedDerbyDataSource.java


示例7: newConnectionPoolDataSource

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@Override
public ConnectionPoolDataSource newConnectionPoolDataSource() throws SQLException {
    return new EmbeddedConnectionPoolDataSource();
}
 
开发者ID:wisdom-framework,项目名称:wisdom-jdbc,代码行数:5,代码来源:DerbyService.java


示例8: before

import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; //导入依赖的package包/类
@Before
public void before() throws SQLException {
    EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
    ds.setDatabaseName("memory:testDB");
    ds.setCreateDatabase("create");
    ds.setLogWriter(new PrintWriter(System.out));
    
    try (Connection conn = ds.getConnection();
            Statement statement = conn.createStatement()) {
        statement.execute(
                "CREATE TABLE SERVLET_CLIENT_IN_QUEUE (\n"
                + "MSG_NUMBER INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\n"
                + " ADDRESS VARCHAR(1024) NOT NULL,\n"
                + " OFFSET INTEGER NOT NULL,\n"
                + " DATA BLOB NOT NULL,\n"
                + " PRIMARY KEY (MSG_NUMBER),\n"
                + " UNIQUE (ADDRESS, OFFSET)\n"
                + ")");
        statement.execute(
                "CREATE TABLE SERVLET_CLIENT_IN_OFFSET (\n"
                + " ADDRESS VARCHAR(1024) NOT NULL,\n"
                + " OFFSET INTEGER NOT NULL,\n"
                + " PRIMARY KEY (ADDRESS)"
                + ")");
        statement.execute(
                "CREATE TABLE SERVLET_CLIENT_OUT_QUEUE (\n"
                + "MSG_NUMBER INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\n"
                + " ADDRESS VARCHAR(1024) NOT NULL,\n"
                + " OFFSET INTEGER NOT NULL,\n"
                + " DATA BLOB NOT NULL,\n"
                + " PRIMARY KEY (MSG_NUMBER),\n"
                + " UNIQUE (ADDRESS, OFFSET)\n"
                + ")");
        statement.execute(
                "CREATE TABLE SERVLET_CLIENT_OUT_OFFSET (\n"
                + " ADDRESS VARCHAR(1024) NOT NULL,\n"
                + " OFFSET INTEGER NOT NULL,\n"
                + " PRIMARY KEY (ADDRESS)"
                + ")");
    }
    
    fixture = JdbcStore.create("servlet", ds);
}
 
开发者ID:offbynull,项目名称:actors,代码行数:44,代码来源:JdbcStoreTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConstraintViolationProblemModule类代码示例发布时间:2022-05-22
下一篇:
Java HasOneWidget类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap