Results 1 to 5 of 5

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

  1. #1
    Join Date
    Aug 2004
    Posts
    11

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    11

    Default no takers?

    Is my question unclear?

  3. #3
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    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...

  4. #4
    Join Date
    Aug 2004
    Posts
    11

    Default I hadn't considered that...

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

  5. #5
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    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.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Replies: 5
    Last Post: Mar 17th, 2010, 04:32 AM
  2. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  3. Replies: 10
    Last Post: Oct 10th, 2005, 05:38 PM
  4. Deferred file upload
    By Thomas Matzner in forum Web
    Replies: 4
    Last Post: Sep 30th, 2005, 12:06 PM
  5. JPOX, HSQLDB and Spring
    By mraible in forum Data
    Replies: 2
    Last Post: Mar 1st, 2005, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •