Menu

Where are the data files

Help
Paco
2005-06-07
2014-01-19
  • Paco

    Paco - 2005-06-07

    Hi everybody,

    Well, my question is quick and simple, where are the datafiles saved/stored in stand-alone, server and web-server modes of HSQLDB, because I need to know how the information is stored.

    Respectfully
    Francisco

     
    • IchBin

      IchBin - 2005-06-07

      Not to be to simple but it depends on where you specify it on the the jdbc url.

      --

      Thanks in Advance...
      IchBin, Pocono Lake, Pa, USA
      __________________________________________________________________________

      ' If there is one, Knowledge is the "Fountain of Youth"'
      -William E. Taylor, Regular Guy (1952-)

       
    • Paco

      Paco - 2005-06-07

      Thank you William,

      Can you give me an example, please!

      Respectfully
      Francisco

       
    • IchBin

      IchBin - 2005-06-07

      Probably The best practice is to use the '..\hsqldb\demo\runManagerSwing.bat' to define you databases or just fool around to get familiar with the URL format for the different DB implantations. I would use the current HSQLDB release candidate 11  for the current runManagerSwing.bat.

      Naturally for a server implementation you need to have a server.properties file which define the physical location 'server.database' and database name reference 'server.dbname' you use to load the database into the server.

      Example..'3 databases and few server properties'.

      server.database.0=/hsqldb/databases/jhackerdb/jhackerdb
      server.dbname.0=jhackerdbfree
      server.database.1=/hsqldb/databases/systemdb/systemdb
      server.dbname.1=systemdbfree
      server.database.2=/hsqldb/databases/applies/applies
      server.dbname.2=applies
      server.restart_on_shutdown=true
      server.silent=true
      server.trace=false
      server.no_system_exit=false

      So in the runManagerSwing you would
      - For TYPE select 'HSQL Engine Database Server'
      - For URL  add your database server.dbname to the end of the displayed URL

      EXAMPLE 'jdbc:hsqldb:hsql://localhost/jhackerdbfree'.

      For stand alone using the same database above you naturally do not need  a  server.properties file

      So in the runManagerSwing you would
      - For TYPE select 'HSQL Database  Engine Standalone'
      - For URL  add your database server.dbname to the end of the displayed URL

      jdbc:hsqldb:file:/hsqldb/databases/jhackerdb/jhackerdb

      In either case If the database does not exist  HSQLDB will create it with all of the required files. Once  ManagerSwing displays it's interface you can create all of your database needs. You will need to look at the documentation at HSQLDB's website.. http://hsqldb.sourceforge.net/

      Thanks in Advance...
      IchBin, Pocono Lake, Pa, USA
      __________________________________________________________________________

      ' If there is one, Knowledge is the "Fountain of Youth"'
      -William E. Taylor, Regular Guy (1952-)

       
    • IchBin

      IchBin - 2005-06-07

      Sorry, forgot to mention where to keep the server.properties file. I normally keep it in the run directory for the runManagerSwing.bat file.

      EXAMPLE  '..\hsqldb\demo'

      And again the last reply for standalone execution should have said this

      So in the runManagerSwing you would
      - For TYPE select 'HSQL Database Engine Standalone'
      - For URL add your database server.database to the end of the displayed URL

      jdbc:hsqldb:file:/hsqldb/databases/jhackerdb/jhackerdb

      --

      Thanks in Advance...
      IchBin, Pocono Lake, Pa, USA
      __________________________________________________________________________

      ' If there is one, Knowledge is the "Fountain of Youth"'
      -William E. Taylor,  Regular Guy (1952-)

       
    • Paco

      Paco - 2005-06-07

      Thanks William,

      But I still wonder where are the .data files.

      I did the following

      java -cp \hsqldb\lib\hsqldb.jar org.hsqldb.Server -address=localhost -database.0=file:prueba -dbname=prueba -silent=false -trace=true

      ...and then run

      java -cp \hsqldb\lib\hsqldb.jar org.hsqldb.util.DatabaseManagerSwing

      tried to connect to jdbc:hsqldb:hsql://localhost/prueba

      and appear the following error in the application java.sql.SQLException: Database does not exists in statement [prueba]

      and in the console where I ran the DatabaseManager

      java.sql.SQLException: Database does not exists in statement [prueba]
              at org.hsqldb.jdbc.jdbcUtil.sqlException(Unknown Source)
              at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
              at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
              at org.hsqldb.jdbcDriver.connect(Unknown Source)
              at java.sql.DriverManager.getConnection(Unknown Source)
              at java.sql.DriverManager.getConnection(Unknown Source)
              at org.hsqldb.util.ConnectionDialogSwing.createConnection(Unknown Source
      )
              at org.hsqldb.util.ConnectionDialogSwing.actionPerformed(Unknown Source)

              at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
              at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
              at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
              at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
      ce)
              at java.awt.Component.processMouseEvent(Unknown Source)
              at javax.swing.JComponent.processMouseEvent(Unknown Source)
              at java.awt.Component.processEvent(Unknown Source)
              at java.awt.Container.processEvent(Unknown Source)
              at java.awt.Component.dispatchEventImpl(Unknown Source)
              at java.awt.Container.dispatchEventImpl(Unknown Source)
              at java.awt.Component.dispatchEvent(Unknown Source)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
              at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
              at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
              at java.awt.Container.dispatchEventImpl(Unknown Source)
              at java.awt.Window.dispatchEventImpl(Unknown Source)
              at java.awt.Component.dispatchEvent(Unknown Source)
              at java.awt.EventQueue.dispatchEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

              at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
              at java.awt.Dialog$1.run(Unknown Source)
              at java.awt.event.InvocationEvent.dispatch(Unknown Source)
              at java.awt.EventQueue.dispatchEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

              at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.run(Unknown Source)

      ...is anything wrong with it?

      Regards
      Francisco

       
    • IchBin

      IchBin - 2005-06-07

      Because you did not follow my simple instruction.

      I figured you would try to do it as a standalone database first since that was simpler. That is, it would create your database and then you could build your server.properties file.  and then just issue the runServer.bat with no params.

      You can create the database using the runServer.bat and passing your database and server properties on the command line.

      I did not tell you to do it that way. Understand what I am showing you first. I try one more time.

      1 - Create a server.properties file with the information below and store where the runManagerSwing.bat resides.

      server.database.0=/SOME DIRECTORY PATH TO HOLD YOUR DATABASE/prueba
      server.dbname.0=pruebaDB
      server.silent=false
      server.trace=true

      Note that on your database statement you need to specify a path, to your database, to where it is or where it will reside.

      In your sample the actual file names for the database will have a filename of 'prueba' and the dbname of 'prueba'. They do not have to be the same for confusion reasons, initially.  I will change just so you see the difference. It's like in IBM's SDLC. You have the physical unit 'PU' and the logical unit 'LU'. The LU references PU. Anyway..

      2 - Once you save the server.properties to where the runServer.bat resides then just execute the runServer.bat. You will see in the console that it opens the database.

      3 - Now that the Server is running, run the runManagerSwing.bat

      - For TYPE select 'HSQL Engine Database Server'
      - For URL enter..   jdbc:hsqldb:hsql://localhost/pruebaDB

      4 - Now you can do your normal DBMS stuff.

      Is this clear now...

       
    • Anonymous

      Anonymous - 2005-06-08

      Thanks William.  Good explanation.

      Paco:  I'm not trying to give you the "rtfm" line, but all of this stuff is covered fairly well

      here:

      http://hsqldb.sourceforge.net/doc/src/org/hsqldb/Server.html

      here:

      http://hsqldb.sourceforge.net/doc/src/org/hsqldb/jdbc/jdbcConnection.html

      and here:

      http://hsqldb.sourceforge.net/doc/guide/ch01.html

       
    • Paco

      Paco - 2005-06-08

      Thank you both William & Campbell.

      Let me see If I finally understand the point to run the engine in a server/webserver mode I need to create a server.properties file, which contains the directory of .properties, .log and .lck files, it also contains if it trace the exit, ...and some other stuff.

      The information is stored in the .log file, and every time the server starts up or the stand-alone mode runs, the data contained in the .log file is loaded to memory, so there is no physical storage of the data except in the .log file, which contains the DDL and DML instructions to recreate the database in memory, Is that ok?

      But I am still confused about <b>.data<b> files, are those particular to the stand-alone mode?

      Are this files (.data files) the physical storage of data?

      I also run in a stand-alone mode and I the output files generated are .lck (lock), .properties (of the database) and .log.

      Respectfuly
      Francisco

       

Log in to post a comment.