6 Replies Latest reply on Feb 17, 2011 9:43 AM by satyakatti

    Use HSQLDB in JBoss5.1

    satyakatti

      Hi All,

       

      In my current project, I use hsqldb2.0 and JBoss5.1 .

       

      Currently I am starting the hsqldb server from command prompt as :

       

      java -cp ../lib/hsqldb.jar org.hsqldb.server.Server  --database.0 file:hmc

       

      and connect to hsqldb from datasource defined in deploy folder of jboss.

       

      But now I dont want to start hsqldb extermnally but would like to start it whenever jbosss starts.

       

      Is it somehow possible to perform?

       

      Regards,

      Satya

        • 1. Use HSQLDB in JBoss5.1
          welle

          The default configuration of the database (DefaultDS) starts an embedded hsql server automatically.

           

          PS. You shouldn't use HSQL in a production environment. It's not stable enough DS.

          • 2. Re: Use HSQLDB in JBoss5.1
            satyakatti

            Hi Anders Welen,

             

            If I change the database location, still will I be able to use same DefaultDS?

             

            How can I access that default DB in server mode?

             

            Will this work : <connection-url>jdbc:hsqldb:hsql://localhost:9001/myHobbyProjectDB/</connection-url>

             

            By the way, I use HSQL for my hobby project, and would have jboss schedule job to have a backup of DB every day, hope that should compensate the unstable nature of HSQL.

             

            Regards,

            Satya

            • 3. Re: Use HSQLDB in JBoss5.1
              welle

              There is nothing stopping you from deploying an updated datasource (for example "externalized" hsql) with the name DefaultDS. It will be picked up and should work ok.

               

              But there will be nothing in JBoss that can automatically start the external hsql. (You could of course add the start into the run.sh/run.bat)

              • 4. Re: Use HSQLDB in JBoss5.1
                satyakatti

                Ach so, I could by all means add hsql startup script to jboss startup script.

                 

                Thanks,

                Satya

                • 5. Re: Use HSQLDB in JBoss5.1
                  nickarls

                  Perhaps it would be possible to write a mbean or something that runs it on startup but it's probably not worth it.

                  • 6. Re: Use HSQLDB in JBoss5.1
                    satyakatti

                    Ya I feel quick and nice way would be to use jboss startup script for this purpose instead of going for mbean.