Best way to access a sqlite database file in a web service.
Posted
by rogernorling
on Stack Overflow
See other posts from Stack Overflow
or by rogernorling
Published on 2010-05-22T17:11:04Z
Indexed on
2010/05/22
17:20 UTC
Read the original article
Hit count: 156
First question from me on stack overflow.
I have created a java web application containing a web service using netbeans (I hope a web application were the correct choice). I use the web application as is with no extra frameworks. This web service use a sqlite JDBC driver for accessing a sqlite database file.
My problem is that the file path end up incorrect when I try to form the JDBC connection string. Also, the working directory is different when deploying and when running JUnit tests. I read somewhere about including the file as a resource, but examples of this were nowhere to be seen.
In any case, what is the best way to open the sqlite database, both when the web service is deployed and when I test it "localy"?
I don't know much about web services, I just need it to work, so please, help me with the technicalities.
© Stack Overflow or respective owner