0

Problem 1: When we creat a sqlite database with sqlite IDE or coding we don’t define sqlite version(1/2/3). So what is the default version and which version we use automatically?

Problem 2: Is there any way to get my current and old sqlite database file version by java coding or something else?

Thanks in advance.

7
  • 1
    Regarding your first question stackoverflow.com/questions/2421189/…
    – Random
    Feb 11, 2014 at 20:59
  • 1
    It's almost certain that you're on some 3.x version (seeing as it came out ten years ago). Also relevant: How to find SQLITE database file version
    – rutter
    Feb 11, 2014 at 21:01
  • 1
    first problem is clear to me. But I don't konw how to use magic header and this type of command. $ file file2.db file2.db: SQLite 2.x database $ file file3.db file3.db: SQLite 3.x database @rutter
    – Xplosive
    Feb 11, 2014 at 21:13
  • file is a Unix command. As far as the header, you can check the first 16 bytes of the file: if they are equal to the string SQLite format 3, you are apparently dealing with a SQLite 3.x database file. SQLite's documentation describes their file header in some detail.
    – rutter
    Feb 11, 2014 at 22:41
  • 1
    Thanks for your reply. I got it. Can you help me about second question. @rutter
    – Xplosive
    Feb 12, 2014 at 5:35

1 Answer 1

1
  1. Android sqlite is sqlite3. The specific version depends on the device and software version.

  2. You can get your schema version with SQLiteDatabase getVersion() in Java code or PRAGMA user_version in SQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.