Menu

test if hsqldb server is running

Help
2015-08-13
2015-10-04
  • David Denny

    David Denny - 2015-08-13

    Edited..

    What is the simplest way to find out if a HSQL server is running? e.g. sqltool.

    This is to be able to automate some Open Office stuff.

    [Windows]

    Thanks
    DD

     

    Last edit: David Denny 2015-08-19
  • Blaine Simpson

    Blaine Simpson - 2015-08-24

    Here's a sample cmd script showing error-handling. It uses JDBC to avoid the work associated with an SQL command. I'm accessing an Oracle database here. You can use the simpler -jar syntax for a HyperSQL database.

    @echo off
    java -cp %HOMEDRIVE%%HOMEPATH%/lib/ojdbc6_g.jar;%HOMEDRIVE%%HOMEPATH%/lib/sqltool-2.3.2.jar org.hsqldb.cmdline.SqlTool --sql="\dc" URLID || (
        echo Bad
        echo worse
    )
    
     

    Last edit: Blaine Simpson 2015-08-24
    • David Denny

      David Denny - 2015-09-08

      Thanks!

      Having fixed some other necessaries am just ready to have a go at this.

      Sorry I did not pick this up earlier.

      Kind regards.

       
  • David Denny

    David Denny - 2015-09-08

    Thanks for your time, Blaine.
    I found an alternative. As this might be generally useful I have added a specimen.

    It is based on whether the HSQLDB server is running using the standard netstat facility. The implication being that you can only test per server not per database if you serve more than one db on the same listener. For my purposes this was not a problem as I needed to separate the live system from the test system.

    It is a DOS mechanism but would apply to UNIX with an obvious change to the script syntax and the netstat options.

    Nice to be able to put something back into the pot!

    [see attached if curious]
    David.

    Three Thumbs Up for HSQL ...

     

    Last edit: David Denny 2015-10-03

Log in to post a comment.