How to implement Write-Ahead Logging of SQLite in

2020-04-11 09:24发布

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

1条回答
三岁会撩人
2楼-- · 2020-04-11 10:05

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.
查看更多
登录 后发表回答