-1
我遇到問題。 我需要從我的代碼創建HSQLDB的服務器,運行它,並從其他應用程序連接(通過runManagerSwing.bat前) 這裏是我的代碼HSQLDB從代碼連接從另一個客戶端運行
HsqlProperties p = new HsqlProperties();
p.setProperty("server.database.0", "file:./db/idt_simulatordb");
p.setProperty("server.dbname.0", "idt_simulatordb");
p.setProperty("server.port", "9001");
Server server2 = new Server();
server2.setProperties(p);
server2.start();
// I even can connect to my server from the same application
Connection conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:9001 /idt_simulatordb", "sa", "");
Statement st = conn.createStatement(); // statements
String expression1 = "DROP SCHEMA IF EXISTS simulators CASCADE;\n";
String expression2 = "CREATE SCHEMA SIMULATORS AUTHORIZATION SA;";
String expression3 = "CREATE TABLE SIMULATORS.dirtyhack();";
st.executeUpdate(expression1); // run the query
st.executeUpdate(expression2); // run the query
st.executeUpdate(expression3); // run the query
//
st.close();
conn.close();
server2.shutdownWithCatalogs(Database.CLOSEMODE_NORMAL);
但是當我把斷點服務器運行後,並嘗試從runManagerSwing連接到我的服務器我有超時錯誤。
但是,如果我從bat-file啓動服務器,那麼確定。如何解決我的問題。 Isuppose我必須使用MainInvoker,但我不知道如何傳遞參數以及如何關閉服務器。 感謝名單
offcourse我這樣做了。這只是錯誤的複製/過去。 –