Sleuth Kit Java Bindings (JNI)  4.3
Java bindings for using The Sleuth Kit

Inserting Into the Database

This page is for people who are developing code for the Autopsy framework and need to place items into the database with SQL statements. If you are not developing Autopsy framework code (Autopsy Modules are not Autopsy framework code), you should have no need to create SQL statements to insert items into the database. If you developing an Autopsy module, please see Query the Database.

Autopsy currently allows either SQLite or PostgreSQL as the back-end database system for a case. Any code you write could be used with either as the backend database, at the user's discretion. Be sure to test your work with both platforms.


  • Use SQL statements supported by SQLite 3
  • Used for Single-user cases
  • Built-in
  • No configuration required
  • Databases are stored locally


  • Use SQL statements supported by PostgreSQL 9.4
  • Used for Multi-user cases
  • An accessible instance of PostgreSQL must be running (on a server, or locally)
  • Proper configuration to connect to this instance of PostgreSQL required
  • Databases are stored within PostgreSQL, wherever it happens to be running

How to Avoid Pitfalls When INSERTing into the Database

  • Do not use INSERT OR REPLACE INTO. It does not exist in PostgreSQL.

  • Do not use INSERT OR IGNORE INTO. It does not exist in PostgreSQL.

  • Do not insert NUL characters into the database as UTF-8 (NUL characters are not NULL fields). Translate NUL characters to the SUB character with the following instead:
    private String replaceNulls(String text);

Copyright © 2011-2015 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.