Examples of SQLiteDBConnect


Examples of org.sleuthkit.autopsy.coreutils.SQLiteDBConnect

    public static boolean checkColumn(String column, String tablename, String connection) {
        String query = "PRAGMA table_info(" + tablename + ")"; //NON-NLS
        boolean found = false;
        ResultSet temprs;
        try {
            SQLiteDBConnect tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", "jdbc:sqlite:" + connection); //NON-NLS
            temprs = tempdbconnect.executeQry(query);
            while (temprs.next()) {
                if (temprs.getString("name") == null ? column == null : temprs.getString("name").equals(column)) { //NON-NLS
                    found = true;
                }
            }
View Full Code Here

Examples of org.sleuthkit.autopsy.coreutils.SQLiteDBConnect

    }

    public static ResultSet runQuery(String query, String connection) {
        ResultSet results = null;
        try {
            SQLiteDBConnect tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", "jdbc:sqlite:" + connection); //NON-NLS
            results = tempdbconnect.executeQry(query);
            tempdbconnect.closeConnection();
        } catch (Exception ex) {
            logger.log(Level.WARNING, "Error while trying to run sql query: " + query + " : " + connection, ex); //NON-NLS
        }
        return results;
    }
View Full Code Here

Examples of org.sleuthkit.autopsy.coreutils.SQLiteDBConnect

    protected List<HashMap<String, Object>> dbConnect(String path, String query) {
        ResultSet temprs;
        List<HashMap<String, Object>> list;
        String connectionString = "jdbc:sqlite:" + path; //NON-NLS
        try {
            SQLiteDBConnect tempdbconnect = new SQLiteDBConnect("org.sqlite.JDBC", connectionString); //NON-NLS
            temprs = tempdbconnect.executeQry(query);
            list = this.resultSetToArrayList(temprs);
            tempdbconnect.closeConnection();
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, "Error while trying to read into a sqlite db." + connectionString, ex); //NON-NLS
            errorMessages.add(NbBundle.getMessage(this.getClass(), "Extract.dbConn.errMsg.failedToQueryDb", getName()));
            return Collections.<HashMap<String,Object>>emptyList();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.