Announcement Announcement Module
Collapse
No announcement yet.
hsqldb: using file based db in WEB-INF dir Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • hsqldb: using file based db in WEB-INF dir

    Hi all,

    I'm trying to setup a demo application that requires no installation other than deploying a war file. I'm trying to use a hsql database that resides in something like /WEB-INF/data/hsql.script. Since hsql allows you to specify this path in it's URL, I'm able to do this using the full path. However, I'd like to be able to do the same thing with the context relative path (/WEB-INF/data/hsql) or somehow inject (at runtime) the full path into my applicationContext.xml file, something like the following snippet. Any ideas?

    Thanks,
    Brian

    <bean id="dataSource"
    class="org.sprin...DriverManagerDataSource">

    <property name="driverClassName">
    <value>org.hsqldb.jdbcDriver</value>
    </property>

    <property name="url">
    <value>jdbc:hsqldb:${webapp-root}/WEB-INF/data/hsql</value>
    </property>

    <property name="username">
    <value>sa</value>
    </property>

    <property name="password">
    <value></value>
    </property>

    </bean>

  • #2
    no takers?

    Is my question unclear?

    Comment


    • #3
      Keep in mind this is actually not very portable. Some environments, like WebLogic BEA, do not even extract all the contents of WAR files, but rather access them via a ZipFileClassloader...

      Comment


      • #4
        I hadn't considered that...

        Thanks. I hadn't considered that. I'll look for another way to do this...

        Comment


        • #5
          I'm pretty sure you would limit yourself to a single user at a time running in standalone mode as well. If there is an active connection, then additional connections to the same database fail.

          Comment

          Working...
          X