Embedded HSQLDB persist data to a file

后端 未结 1 1565
北恋
北恋 2021-01-02 08:58

I am creating a spring based web application that uses embedded hsqldb. My spring config is pretty simple:



        
相关标签:
1条回答
  • 2021-01-02 09:41

    This solution worked for me

    <bean class="org.apache.commons.dbcp2.BasicDataSource" id="dataSource">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
        <property name="url" value="jdbc:hsqldb:file:#{systemProperties['user.home']}/db/data" />
        <property name="username" value="sa" />
        <property name="password" value="" />
    </bean>
    
    <jdbc:initialize-database data-source="dataSource">
        <jdbc:script location="classpath:scripts/create-table-if-not-exists" />
    </jdbc:initialize-database>
    
    0 讨论(0)
提交回复
热议问题