23 package org.sleuthkit.autopsy.coreutils;
25 import java.sql.Connection;
26 import java.sql.DriverManager;
27 import java.sql.ResultSet;
28 import java.sql.SQLException;
29 import java.sql.Statement;
40 public Connection
conn = null;
59 public SQLiteDBConnect(String sDriverToLoad, String sUrlToLoad)
throws SQLException {
60 init(sDriverToLoad, sUrlToLoad);
63 public final void init(String sDriverVar, String sUrlVar)
throws SQLException {
74 private void setUrl(String sUrlVar) {
80 Class.forName(sDriver);
81 }
catch (ClassNotFoundException e) {
84 conn = DriverManager.getConnection(sUrl);
95 statement = conn.createStatement();
96 statement.setQueryTimeout(iTimeout);
104 statement.executeUpdate(instruction);
110 public void executeStmt(String[] instructionSet)
throws SQLException {
111 for (
int i = 0; i < instructionSet.length; i++) {
116 public ResultSet
executeQry(String instruction)
throws SQLException {
117 return statement.executeQuery(instruction);
123 }
catch (Exception ignore) {
ResultSet executeQry(String instruction)
void executeStmt(String[] instructionSet)
SQLiteDBConnect(String sDriverToLoad, String sUrlToLoad)
void executeStmt(String instruction)
void setDriver(String sDriverVar)
final void init(String sDriverVar, String sUrlVar)
Connection getConnection()
synchronized static Logger getLogger(String name)
static final Logger logger
void setUrl(String sUrlVar)