Reputation: 140
I'm trying to use a DB for reading and writing that is contained in a JAR. I can read in it, but can't write throwed exeception :
java.sql.SQLException: path to '/database/scddata.db': 'LocationOfJar/database' does not exist
Is there any way I can bundle the database file inside a JAR?
Thanks in advance.
Upvotes: 2
Views: 585
Reputation: 2316
Jar files does not allows to write.
So :
define a working path (in properties for example). Let's call it : workingPath/file.db.
on init of your program, before opening your db.
workingPath/file.db
.Then you program will use the db from workingPath/file.db
for execution.
Upvotes: 4