Is there way to create embedded HSQLDB inside my web-app directory (I want that the path to my data was this: “Tomcat/webapps/ROOT/db”, but I don’t want to specify an absolute path) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would not do that because if you redeploy your webapp you will blow away the database or some other weird behavior might happen.
What you can do is use the system property
${catalina.base}and put it in your Tomcat directory somewhere (or even in the webapps directory like you want).How you get access of the system property and apply to HSQLDB is dependent on how you startup it up. If your using Spring you can use the PropertyPlaceholder to configure HSQLDB’s location.