org.hsqldb.server.Server Java Examples

The following examples show how to use org.hsqldb.server.Server. 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 File: TestJDBCSavepoints.java    From evosql with 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 File: DBCountPageView.java    From hadoop with 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 File: MemoryDbHsql.java    From MegaSparkDiff with 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 File: DBCountPageView.java    From big-c with 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 File: HsqldbLocalServer.java    From hadoop-mini-clusters with 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 File: JdbcCookbookTest.java    From java-client-api with 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 File: TestBase.java    From evosql with 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 File: MockDatabase.java    From soabase with Apache License 2.0 4 votes vote down vote up
public MockDatabase()
{
    this.server = new Server();
    server.start();
}