0

I have developed a demo application in java.It has a simple log-in screen that has username and password fields.Now,i am using sqilte for the purpose.I am able to log in to by connecting to the predefined database.But i want to run the application in a different machine with successful log in.For this purpose I want to create a database in the different machine automatically from the application if it does not exist.For that I want to package the application in to an executable installer and install in a different machine and run it.Sqlite being an embedded database what is the exact solution to it?

2 Answers2

1

Just include a default/sample SQLite database file in your installer package or application. SQLite isn't magic, it's just a file on the filesystem.

From: Creating Database in JDBC Sqlite

The SQLite JDBC string you're using contains the filename of the file you should copy:

jdbc:sqlite:filename.db

The file filename.db will be in your application's working directory.

Community
  • 1
  • 1
Ben
  • 1,902
  • 17
  • 17
0

Take a look at Creating Database in JDBC Sqlite.

Then you can use create table if not exist to create your tables and relations.

Community
  • 1
  • 1
JackTools.Net
  • 734
  • 6
  • 13