4 Replies Latest reply on Jan 12, 2008 3:20 PM by peterj

    How to start up multiple hsql database?

    netiskra

      Hi, all.

      I know that HSQL can serve up to 10 different databases simultaneously in 1.8.0.

      Does anybody know how to start up multiple hsql database?

      And I want a dbname(alias) each hsql database too.

      When I start up JBoss 4.0.2... what I have to do?


      I need your help. thanks.

        • 1. Re: How to start up multiple hsql database?
          netiskra


          When HSQL is starting.. server.properties is loaded.

          So I wrote a property within server.properties.

          server.database.0=localdb
          server.dbname.0=localdb
          
          server.database.1=file:/C:\\z_dev\\jboss-4.0.2\\server\\default\\data\\hypersonic\\ibatis
          server.dbname.1=ibatis
          


          Are there any other idea?



          • 2. Re: How to start up multiple hsql database?
            mussie

            does anyone has an answer to this question please.
            I'm stuck with the same problem!

            • 3. Re: How to start up multiple hsql database?
              mussie

              Since I could not find out how to buid a crud application with certain tables of a database, I tried to create another instance of the hsql database.
              In the hsql documentation Table4.1
              http://hsqldb.org/doc/guide/ch04.html#N108EC
              it says that if you're using protocoll hsql and running HSQLDB in server mode

              The database to connect to is specified by an alias.
              This alias is a lowercase string defined in the server.properties file to refer to an actual database on the file system of the server or a transient, in-memory database on the server.

              So I'm wondering where to find that file in my jboss-4.2.1.GA there is no such file. Where can I define these settings?
              In my jboss-4.2.1.GA\server\default\deploy\hsqldb-ds.xml?

              Thanks and best regards,
              Mussie

              • 4. Re: How to start up multiple hsql database?
                peterj

                Mussie, you should have started a new post, not appended to an old post, especially not one that is almost 3 years old.

                It has been a while since I used multiple hsqldb database, bit is I recall correctly, to do so I made a copy of hsqldb-ds.xml (for example, as hsqldb2-ds.xml), and change these lines:

                <jndi-name>OtherDS</jndi-name>
                <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}otherDB</connection-url>
                


                Then in my code I used OtherDS to look up the datasource in JNDI.

                Personally, I would not bother with hsqldb and would use MySQL or PostgreSQL instead.