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


Java Driver.load方法代码示例

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


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

示例1: beforeTest

import org.h2.Driver; //导入方法依赖的package包/类
/**
 * This method is called before a complete set of tests is run. It deletes
 * old database files in the test directory and trace files. It also starts
 * a TCP server if the test uses remote connections.
 */
public void beforeTest() throws SQLException {
    Driver.load();
    FileUtils.deleteRecursive(TestBase.BASE_TEST_DIR, true);
    DeleteDbFiles.execute(TestBase.BASE_TEST_DIR, null, true);
    FileUtils.deleteRecursive("trace.db", false);
    if (networked) {
        String[] args = ssl ? new String[] { "-tcpSSL", "-tcpPort", "9192" }
                : new String[] { "-tcpPort", "9192" };
        server = Server.createTcpServer(args);
        try {
            server.start();
        } catch (SQLException e) {
            System.out.println("FAIL: can not start server (may already be running)");
            server = null;
        }
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:23,代码来源:TestAll.java

示例2: testDriverObject

import org.h2.Driver; //导入方法依赖的package包/类
private void testDriverObject() throws Exception {
    Driver instance = Driver.load();
    assertTrue(DriverManager.getDriver("jdbc:h2:~/test") == instance);
    Driver.unload();
    try {
        java.sql.Driver d = DriverManager.getDriver("jdbc:h2:~/test");
        fail(d.toString());
    } catch (SQLException e) {
        // ignore
    }
    Driver.load();
    assertTrue(DriverManager.getDriver("jdbc:h2:~/test") == instance);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:14,代码来源:TestDriver.java

示例3: before

import org.h2.Driver; //导入方法依赖的package包/类
@Override
protected void before() throws Throwable {
  loadScript();
  Driver.load();
  String user = "sa";
  keepAlive = DriverManager.getConnection(connectionString, "sa", "");
  if (!sqls.isEmpty()) {
    Statement statement = keepAlive.createStatement();
    for (String sql : sqls) {
      statement.addBatch(sql.trim());
    }
    statement.executeBatch();
    keepAlive.commit();
  }
}
 
开发者ID:schemaspy,项目名称:schemaspy,代码行数:16,代码来源:H2MemoryRule.java

示例4: newConnection

import org.h2.Driver; //导入方法依赖的package包/类
Connection newConnection() throws SQLException {
  System.out.println("url="+url);
  org.h2.Driver driver = Driver.load();
  Properties props = new Properties();
  props.setProperty("user", user);
  props.setProperty("password", password);
  return driver.connect(url, props);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:9,代码来源:DBAppenderH2TestFixture.java

示例5: simpleDataSourceUrl

import org.h2.Driver; //导入方法依赖的package包/类
@Test
public void simpleDataSourceUrl() {
    SimpleDriverDataSource dataSource = new SimpleDriverDataSource(Driver.load(), "jdbc:test-url");

    assertEquals("jdbc:test-url", this.dataSourceUtils.getUrl(dataSource));
}
 
开发者ID:cloudfoundry,项目名称:java-test-applications,代码行数:7,代码来源:DataSourceUtilsTest.java


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