Refine search
public void start() { System.out.println("running H2 server"); if (realH2Server == null || !realH2Server.isRunning(false)) { try { DeleteDbFiles.execute("", "JPADroolsFlow", true); realH2Server = Server.createTcpServer(new String[0]); realH2Server.start(); } catch (SQLException e) { throw new RuntimeException("Can't start h2 server db", e); } } }
if (arg == null) { } else if ("-?".equals(arg) || "-help".equals(arg)) { showUsage(); return; } else if (arg.startsWith("-web")) { i++; } else { showUsageAndThrowUnsupportedOption(arg); tcpShutdownForce = true; } else { showUsageAndThrowUnsupportedOption(arg); i++; } else { showUsageAndThrowUnsupportedOption(arg); i += 2; } else { showUsageAndThrowUnsupportedOption(arg); verifyArgs(args); if (startDefaultServers) { tcpStart = true; shutdownTcpServer(tcpShutdownServer, tcpPassword, tcpShutdownForce, false);
@BeforeClass public static void startH2Database() throws Exception { DeleteDbFiles.execute("", "DroolsFlow", true); h2Server = Server.createTcpServer(new String[0]); h2Server.start(); }
@AfterClass public static void stopH2Database() throws Exception { h2Server.stop(); DeleteDbFiles.execute("", "DroolsFlow", true); }
/** * Slow to start & stop so do this as infrequently as possible. * @throws SQLException the SQL exception */ @BeforeClass public static void setupH2() throws SQLException { h2Server = Server.createTcpServer().start(); }
@AfterClass public static void stopDBServer() { if (h2Server.isRunning(false)) { h2Server.stop(); } }
@AfterClass public static void teardownH2() { h2Server.stop(); } }
private void startServer(String key) { try { server = Server.createTcpServer( "-tcpPort", Integer.toString(autoServerPort), "-tcpAllowOthers", "-tcpDaemon", "-key", key, databaseName); server.start(); } catch (SQLException e) { throw DbException.convert(e); } String localAddress = NetUtils.getLocalAddress(); String address = localAddress + ":" + server.getPort(); lock.setProperty("server", address); String hostName = NetUtils.getHostName(localAddress); lock.setProperty("hostName", hostName); lock.save(); }
Server.shutdownTcpServer(tcpShutdownServer, tcpPassword, tcpShutdownForce, false); Server.startWebServer(conn); web = Server.createWebServer(args); web.setShutdownHandler(this); web.start(); if (printStatus) { out.println(web.getStatus()); openBrowser(web.getURL()); tcp = Server.createTcpServer(args); tcp.start(); if (printStatus) { out.println(tcp.getStatus()); tcp.setShutdownHandler(this); } catch (SQLException e) { printProblem(e, tcp); pg = Server.createPgServer(args); pg.start(); if (printStatus) { out.println(pg.getStatus());
@Bean public Server h2TcpServer() throws SQLException { Server h2Server = Server.createTcpServer().start(); if (h2Server.isRunning(true)) { System.out.println("H2 server was started and is running."); return h2Server; } else { throw new RuntimeException("Could not start H2 server."); } } }
"-baseDir", systemEnvironment.getDbPath().getCanonicalPath() }; tcpServer = Server.createTcpServer(args); tcpServer.start(); } catch (Exception e) { bomb("Could not create database server.", e);
@Before public void setUp() { DeleteDbFiles.execute("~", "mydb", false); System.out.println("Staring DB for white pages ..."); try { server = Server.createTcpServer(new String[] {"-tcp","-tcpAllowOthers","-tcpDaemon","-trace"}).start(); } catch (SQLException ex) { System.out.println("ERROR: "+ex.getMessage()); } System.out.println("DB for white pages started! "); }
@Bean @ConditionalOnExpression("${h2.web.enabled:false}") public Server h2WebServer() throws SQLException { return Server.createWebServer("-web", "-webAllowOthers", "-webPort", h2WebPort).start(); }
int exitCode = 0; try { web = Server.createWebServer(args); web.setShutdownHandler(this); web.start(); } catch (SQLException e) { if (web == null) { e.printStackTrace(); } else { System.out.println(web.getStatus()); tcp = Server.createTcpServer(args); tcp.start(); } catch (SQLException e) { if (tcp == null) { e.printStackTrace(); } else { System.out.println(tcp.getStatus()); pg = Server.createPgServer(args); pg.start(); } catch (SQLException e) { if (pg == null) { e.printStackTrace(); } else { System.out.println(pg.getStatus()); StartBrowser.openURL(web.getURL()); if (!web.isRunning(true)) {
continue; } else if ("-?".equals(arg) || "-help".equals(arg)) { showUsage(null, out); return EXIT_ERROR; } else if (arg.startsWith("-web")) { webStart = true; } else if ("-webAllowOthers".equals(arg)) { if (readArgBoolean(args, i) != 0) { i++; if (readArgBoolean(args, i) != 0) { i++; i++; } else { showUsage(arg, out); return EXIT_ERROR; tcpStart = true; } else if ("-tcpAllowOthers".equals(arg)) { if (readArgBoolean(args, i) != 0) { i++; if (readArgBoolean(args, i) != 0) { i++; tcpShutdownServer = args[++i]; } else if ("-tcpShutdownForce".equals(arg)) {
/** * @throws IgniteCheckedException If failed. */ public H2CacheStoreStrategy() throws IgniteCheckedException { Server srv = null; try { srv = Server.createTcpServer().start(); port = srv.getPort(); dataSrc = H2CacheStoreSessionListenerFactory.createDataSource(port); try (Connection conn = connection()) { RunScript.execute(conn, new StringReader(CREATE_CACHE_TABLE)); RunScript.execute(conn, new StringReader(CREATE_STATS_TABLES)); RunScript.execute(conn, new StringReader(POPULATE_STATS_TABLE)); } } catch (SQLException e) { throw new IgniteCheckedException("Failed to set up cache store strategy" + (srv == null ? "" : ": " + srv.getStatus()), e); } }
if (h2TestServer) { try { webServer = Server.createWebServer("-webAllowOthers", "-webPort", "8082").start(); server = Server.createTcpServer("-tcpAllowOthers", "-tcpPort", "9092").start(); logger.info("H2 TCP and Web server started."); } catch (SQLException e) {