How to embed HSQLDB in file with Spring to a WebApp

后端 未结 3 1668
猫巷女王i
猫巷女王i 2021-01-03 16:15

I have a webApp with Spring and it works correctly when I use HSQLDB in server mode, but in file mode, it only passes the unit test. This is my data source:

         


        
3条回答
  •  轮回少年
    2021-01-03 16:41

    You should use an absolute file path. When you run your web application, your "current" (or "working") directory is most likely the bin folder of your application server. Therefore, when you specify relative path for HSQLDB URL it tries to load this file from there as opposed to somewhere relative to your webapp root.

提交回复
热议问题