Where to place SQLite 3 database for use in a Java Project in Eclipse

My Eclipse Java project path is as follows:
~/workspace/PayrollApp/src/org/username/payrollapp/payroll.db

I had placed the SQLite database file payroll.db in the above path, and found it was not getting used when I ran the Java program.

Upon inspecting the contents of ~/workspace/PayrollApp, I found that payroll.db was there with 0 bytes. That implied that the file needs to be in that location.

All I then did, was to copy the payroll.db file from
~/workspace/PayrollApp/src/org/username/payrollapp/payroll.db to ~/workspace/PayrollApp/payroll.db

The program then worked correctly with the database.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s