0

I am developing a Java-application, which is using an SQLite-database. To have a better view of the data and to change the tables easier, I am using the Firefox plugin "SQLite Manager".

The sqlite-database is placed in my src-folder (src/db/db.sqlite). If I open the database from that location, the database shows old entries.

Instead, I have a method in my code, which is reading all data from the table, and writing it into a .docx. Here I can see the data, I previously wrote into the table in another method.

It looked like Eclipse was locking the database-file somehow. Copying it to another location, and reopen it from there with the SQLite-Manager, still showed old entries.

Edit: Now I added another column to my table and deleted the content of the table with the SQLite Manager. If I export the content of my table to a .docx again, I get en empty .docx, which tells me that the database now is consistent again with what is shown in the SQLite Manager.

I didn't manage to find an answer to that behaviour in the web. Does anyone know, why this happens?

3
  • Thanks, this sounds like a solution. I will try this. Commented Jun 11, 2016 at 17:19
  • @cricket_007 You were right. Choosing it from the /bin-directory gave me the correct database. Commented Jun 12, 2016 at 12:15
  • If you post this as an answer, I would like to mark it as the top answer. Commented Jun 12, 2016 at 12:31

1 Answer 1

1

In Eclipse, your database is probably copied to the bin/ directory because you've included it under the src/ directory.

You should move your database file somewhere where you can load it from the resource loader instead of referencing the direct filepath on your disk.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.