Java Code Examples for org.hsqldb.server.Server

The following examples show how to use org.hsqldb.server.Server. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: evosql   Source File: TestJDBCSavepoints.java    License: Apache License 2.0 5 votes vote down vote up
protected void setUp() throws Exception {

        super.setUp();
        user     = "sa";
        password = "";
        stmt     = null;
        conn1    = null;
        conn2    = null;
        server   = new Server();

//        server = new WebServer();
        server.putPropertiesFromString(serverProps);
        server.start();

        try {
            Class.forName("org.hsqldb.jdbc.JDBCDriver");

            conn1 = DriverManager.getConnection(url, user, password);
            conn2 = DriverManager.getConnection(url, user, password);
            stmt  = conn1.createStatement();
        } catch (Exception e) {

            //e.printStackTrace();
            System.out.println(this + ".setUp() error: " + e.getMessage());
            throw e;
        }
    }
 
Example 2
Source Project: hadoop   Source File: DBCountPageView.java    License: Apache License 2.0 5 votes vote down vote up
private void startHsqldbServer() {
  server = new Server();
  server.setDatabasePath(0, 
      System.getProperty("test.build.data", "/tmp") + "/URLAccess");
  server.setDatabaseName(0, "URLAccess");
  server.start();
}
 
Example 3
Source Project: MegaSparkDiff   Source File: MemoryDbHsql.java    License: Apache License 2.0 5 votes vote down vote up
public void initializeMemoryDB()
{
    hsqlDbServer = new Server();
    hsqlDbServer.setDatabaseName(0, "testDb");
    hsqlDbServer.setDatabasePath(0, "mem:testDb");
    hsqlDbServer.setPort(9001); // this is the default port
    hsqlDbServer.setSilent(true);
    hsqlDbServer.start();
}
 
Example 4
Source Project: big-c   Source File: DBCountPageView.java    License: Apache License 2.0 5 votes vote down vote up
private void startHsqldbServer() {
  server = new Server();
  server.setDatabasePath(0, 
      System.getProperty("test.build.data", "/tmp") + "/URLAccess");
  server.setDatabaseName(0, "URLAccess");
  server.start();
}
 
Example 5
Source Project: hadoop-mini-clusters   Source File: HsqldbLocalServer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void start() throws Exception {
    LOG.info("HSQLDB: Starting HSQLDB");
    configure();
    server = new Server();
    server.setProperties(hsqlProperties);
    server.start();
}
 
Example 6
Source Project: java-client-api   Source File: JdbcCookbookTest.java    License: Apache License 2.0 5 votes vote down vote up
private void setupHSQLDBServer() {
  hsqlDBServer = new Server();
  hsqlDBServer.setDatabaseName(0, "employees");
  hsqlDBServer.setDatabasePath(0, "mem:employees");
  hsqlDBServer.setPort(9002);
  hsqlDBServer.start();
}
 
Example 7
Source Project: evosql   Source File: TestBase.java    License: Apache License 2.0 4 votes vote down vote up
protected void setUp() throws Exception {

        if (isNetwork) {

            //  change the url to reflect your preferred db location and name
            if (url == null) {
                if (isServlet) {
                    url = "jdbc:hsqldb:http://localhost:8080/HSQLwebApp/test";
                } else if (isHTTP) {
                    url = "jdbc:hsqldb:http://localhost:8085/test";
                } else {
                    url = "jdbc:hsqldb:hsql://localhost/test";
                }
            }

            if (!isServlet) {
                server = isHTTP ? new WebServer()
                                : new Server();

                if (isHTTP) {
                    server.setPort(8085);
                }

                server.setDatabaseName(0, "test");
                server.setDatabasePath(0, dbPath);
                server.setLogWriter(null);
                server.setErrWriter(null);
                server.start();
            }
        } else {
            if (url == null) {
                url = "jdbc:hsqldb:" + dbPath;
            }
        }

        try {
            Class.forName("org.hsqldb.jdbc.JDBCDriver");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(this + ".setUp() error: " + e.getMessage());
        }
    }
 
Example 8
Source Project: soabase   Source File: MockDatabase.java    License: Apache License 2.0 4 votes vote down vote up
public MockDatabase()
{
    this.server = new Server();
    server.start();
}