Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6708039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:42:39+00:00 2026-05-26T07:42:39+00:00

Well, I need to create hsqldb in server mode and connect to this server

  • 0

Well, I need to create hsqldb in server mode and connect to this server from another client (f.e. from runManagerSwing.bat).
Here are my code:

 public static Server server = new Server();


    public static void main(String[] args) throws IOException, ServerAcl.AclFormatException, SQLException {
        HsqlProperties p = new HsqlProperties();
        p.setProperty("server.database.0", "file:./db/myHsqlDb");
        p.setProperty("server.dbname.0", "idt_simulatordb");
        p.setProperty("server.port", "9001");

        server.setProperties(p);
        server.setSilent(false);
        server.setTrace(true);
        server.start();


        (1) Connection conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:9001/idt_simulatordb", "sa", "");
        Statement st = conn.createStatement();
        String expression1 = "DROP SCHEMA IF EXISTS simulators CASCADE;\n";
        String expression2 = "CREATE SCHEMA SIMULATORS AUTHORIZATION SA;";
        String expression3 = "CREATE TABLE SIMULATORS.dirtyhack();";
        String expression4 = "DROP SCHEMA IF EXISTS myschema CASCADE;\n";
        String expression5 = "CREATE SCHEMA myschema AUTHORIZATION SA;";
        st.executeUpdate(expression1);
        st.executeUpdate(expression2);
        st.executeUpdate(expression3);
        st.executeUpdate(expression4);
        st.executeUpdate(expression5);
        st.close();
        conn.close();

        (2)server.shutdown();
    }

To check out that my server is fine I add line (1). And it’s really ok. But I want to connect from another tool. To do so I put break point before (2) and start client runManagerSwing.bat.
The client succsessfully finds server but suspend. Sometimes it wakeup if I make several step between line (1) and (2).

  1. Why does it happen? Maybe I have to launch server from another thread? How to do so?
  2. And second question. I want to clear up all hsqldb files after shutdown (even .properties and .script). Are there any preferences to do so or I have to delete it manually?

p.s. sorry for my english

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:42:40+00:00Added an answer on May 26, 2026 at 7:42 am

    Your program uses server.start() which starts the server from a separate thread. This is how you can connect to it after server.start() is executed. If it was the same thread, the code you marked with (1) would not execute.

    If you remove the server.shutdown() line at the end and do not put a breakpoint, then you can connect from DatabaseManagerSwing. When you want to shutdown the server, use DatabaseManagerSwing and execute the SQL statement “SHUTDOWN”.

    When you use a breakpoint in an IDE, it may suspend execution of other threads as well.

    There is no way to delete the database files automatically. The next version 2.2.6 will have a static mathod as a utility to delete a set of database files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well i need some help here i don't know how to solve this problem.
I need to embed an entire well-formed xml document within another xml document. However,
I need to define new UI Elements as well as data binding in code
I need the advice from someone who knows Java very well and the memory
Well, i have the following need: create 3 dropdownlist with dependencies. My table in
I need to create poster frames from videos hosted on Amazon S3 via ffmpeg.
Within this program, we need to create an 8x8 grid of LifeCell widgets. The
I need to create a historical timeline starting from 1600's to the present day.
I need to create a linked server to a DB2 database on a mainframe.
Need to create some table so I can get an info from it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.