Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Public Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.coreutils.SQLiteDBConnect Class Reference

Inherits AutoCloseable.

Public Member Functions

 SQLiteDBConnect (String driver, String url) throws SQLException
 
 SQLiteDBConnect ()
 
void close ()
 
void closeConnection ()
 
ResultSet executeQry (String sqlStatement) throws SQLException
 
void executeStmt (String sqlStatement) throws SQLException
 
void executeStmt (String[] sqlStatements) throws SQLException
 
Connection getConnection ()
 
Statement getStatement ()
 
final void init (String driver, String url) throws SQLException
 
void setConnection () throws SQLException
 
void setStatement () throws SQLException
 

Public Attributes

Connection conn = null
 
int iTimeout = STMT_EXEC_TIMEOUT_SECS
 
String sDriver = ""
 
Statement statement = null
 
String sUrl = null
 

Static Private Attributes

static final Logger logger = Logger.getLogger(SQLiteDBConnect.class.getName())
 
static final int STMT_EXEC_TIMEOUT_SECS = 30
 

Detailed Description

An abstraction that loads a given SQLite driver, establishes a connection to a given database, and creates a statement for the connection to support basic SQL operations on the database.

Definition at line 37 of file SQLiteDBConnect.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.SQLiteDBConnect ( String  driver,
String  url 
) throws SQLException

Constructs an abstraction that loads a given SQLite driver, establishes a connection to a given database, and creates a statement for the connection to support basic SQL operations on the database.

Parameters
driverThe SQLite driver class name.
urlThe SQLite database URL to which to connect.
Exceptions
SQLExceptionIf there is an error loading the driver, establishing the connection, or creating a statement for the connection.

Definition at line 54 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sDriver, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement, and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sUrl.

org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.SQLiteDBConnect ( )

Definition at line 138 of file SQLiteDBConnect.java.

Member Function Documentation

void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.close ( )
void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.closeConnection ( )

Closes the connection to the database. Should be called when the use of this object is completed, unless the object was constructed in a try with resources statement, in which case the closing is automatic when the object goes out of scope.

Definition at line 114 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn, and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sUrl.

Referenced by org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.close(), org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.init(), and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setConnection().

ResultSet org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.executeQry ( String  sqlStatement) throws SQLException

Executes an SQL query and returns a result set. The caller should close the result set when finished with it, and should not make any other calls on this object until finished with the result set.

Parameters
sqlStatementThe SQL query to execute.
Returns
The result set.
Exceptions
SQLExceptionIf there is an error executing the query.

Definition at line 104 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement.

Referenced by org.sleuthkit.autopsy.modules.plaso.PlasoIngestModule.createPlasoArtifacts().

void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.executeStmt ( String  sqlStatement) throws SQLException

Executes an SQL statement. For use with statements that do not return result sets.

Parameters
sqlStatementThe SQL statement to execute.
Exceptions
SQLExceptionIf there is an error executing the statement.

Definition at line 75 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement.

Referenced by org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.executeStmt().

void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.executeStmt ( String[]  sqlStatements) throws SQLException

Executes one or more SQL statements in sequence. For use with statements that do not return result sets.

Parameters
sqlStatementsThe SQL statements to execute.
Exceptions
SQLExceptionIf there is an error executing the statements.

Definition at line 87 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.executeStmt().

Connection org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.getConnection ( )

Gets the connection, if any, to the database.

Returns
The connection to the database, may be null.
Deprecated:
Do not use.

Definition at line 193 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn.

Statement org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.getStatement ( )

Gets the statement, if any, associated with the connection to the database, if any.

Returns
The statement, may be null.
Deprecated:
Do not use.

Definition at line 224 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement.

final void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.init ( String  driver,
String  url 
) throws SQLException

Loads a given SQLite driver, establishes a connection to a given database, and creates a statement for the connection.

Parameters
driverThe SQLite driver class name.
urlThe SQLite database URL to which to connect.
Exceptions
SQLExceptionIf there is an error establishing the connection or creating a statement for the connection.
Deprecated:
Do not use.

Definition at line 154 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.closeConnection(), org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sDriver, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setConnection(), org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setStatement(), and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sUrl.

void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setConnection ( ) throws SQLException

Sets or resets the connection to the SQLite database, if the SQLite driver and the database URL have been set.

Exceptions
SQLExceptionIf there is an error loading the driver or establishing the connection.
Deprecated:
Do not use.

Definition at line 172 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.closeConnection(), org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sDriver, and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sUrl.

Referenced by org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.init(), and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setStatement().

void org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setStatement ( ) throws SQLException

Creates a connection to the database if there is none, and creates a statement using the connection.

Exceptions
SQLExceptionIf there is an error creating the connection or the staement.
Deprecated:
Do not use.

Definition at line 207 of file SQLiteDBConnect.java.

References org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.iTimeout, org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.setConnection(), and org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement.

Referenced by org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.init().

Member Data Documentation

Connection org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.conn = null
int org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.iTimeout = STMT_EXEC_TIMEOUT_SECS
final Logger org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.logger = Logger.getLogger(SQLiteDBConnect.class.getName())
staticprivate

Definition at line 39 of file SQLiteDBConnect.java.

String org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sDriver = ""
Statement org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.statement = null
final int org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.STMT_EXEC_TIMEOUT_SECS = 30
staticprivate

Definition at line 40 of file SQLiteDBConnect.java.

String org.sleuthkit.autopsy.coreutils.SQLiteDBConnect.sUrl = null

The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Fri Dec 2 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.