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;
50 public SQLiteDBConnect(String sDriverToLoad, String sUrlToLoad)
throws SQLException {
51 init(sDriverToLoad, sUrlToLoad);
54 public final void init(String sDriverVar, String sUrlVar)
throws SQLException {
65 private void setUrl(String sUrlVar) {
71 Class.forName(sDriver);
73 catch (ClassNotFoundException e) {
76 conn = DriverManager.getConnection(sUrl);
87 statement = conn.createStatement();
88 statement.setQueryTimeout(iTimeout);
95 public void executeStmt(String instruction)
throws SQLException {
96 statement.executeUpdate(instruction);
102 public void executeStmt(String[] instructionSet)
throws SQLException {
103 for (
int i = 0; i < instructionSet.length; i++) {
108 public ResultSet
executeQry(String instruction)
throws SQLException {
109 return statement.executeQuery(instruction);
115 }
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()
static final Logger logger
void setUrl(String sUrlVar)
static Logger getLogger(String name)