How to implement Write-Ahead Logging of SQLite in java program

后端 未结 1 1601
礼貌的吻别
礼貌的吻别 2021-01-21 04:54

I want to use the Write-Ahead Logging feature of SQLite in a j2se program. Please help me with a java implemention example.

相关标签:
1条回答
  • 2021-01-21 05:36

    You need to execute a Sqlite specific command (just like you'd execute other SQL queries):

    pragma journal_mode=wal
    

    For the specifics of using this pragma, please read http://www.sqlite.org/pragma.html#pragma_journal_mode

    Here are some highlights:

    • Your Sqlite library must be >= 3.7.0.
    • This journal_mode is persistent (or sticky), ie you'll need to disable it explicitly if you want to access your database with a < 3.7.0 Sqlite.
    0 讨论(0)
提交回复
热议问题