How to sync Sqlite Database with Remote Database?

How can I set the locking status of my SQLite database using java?

  • I want to create a SQLite DB using the jdbc driver sqlitejdbc-v056.jar. When I try to run the create query of a table, it returns me the error: java.sql.SQLException: database is locked. SQLite has five locking states: Unlocked, Shared, Reserved, Pending and Exclusive. I need an Exclusive locking state to create my tables.

  • Answer:

    Default is normal; for exclusive use PRAGMA [db_name.]locking_mode = EXCLUSIVE; The part between [ and ] is optional. See http://www.sqlite.org/pragma.html#pragma_locking_mode

Klaas V Innocentisart at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.