Orion Papadakis
Orion Papadakis

Reputation: 408

how to make executable java app with sqlite

i am working a java app using an sqlite db, with eclipse.

i produce an executable jar with library handling: copy required libraries into a sub-folder next to generated JAR

the problem is that the app runs ok in my computer, but when i try to run it in another computer doesnt connect with the db.

(in code i put url for db E:\\ and i put also the .sqlite file in that location in my and the other computer)

String url = "E:\\"; this.dburl = "jdbc:sqlite:"+url+"\\converted.sqlite";

i want the .sqlite file to be out or jar file, so i can back it up. Any ideas?

Upvotes: 0

Views: 121

Answers (1)

noshusan
noshusan

Reputation: 313

I always like to use unix style forward slashes in path and it also work in windows. you are putting an extra slash in your db url. Try to put these file into C drive because other PC might not have an E drive. Try this:

String url = "E:/";
this.dburl = "jdbc:sqlite:"+url+"converted.sqlite";

Upvotes: 1

Related Questions