Package com.almworks.sqlite4java

Examples of com.almworks.sqlite4java.SQLiteStatement.step()


          try {
            FileSummary fs = null;
            FileSummaryData fsd = null;
            long lastFid = -1L;
            List<TypeGuessSummary> tgslist = null;
            while (stmt.step()) {
              long fid = stmt.columnLong(0);
              long crawlid = stmt.columnLong(1);
              String fname = stmt.columnString(2);
              String owner = stmt.columnString(3);
              String groupowner = stmt.columnString(4);
View Full Code Here


    return dbQueue.execute(new SQLiteJob<FileSummary>() {
        protected FileSummary job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare(singletonFileInfoQuery);
          stmt.bind(1, fullName);           
          try {
            if (stmt.step()) {
              long fid = stmt.columnLong(0);
              return new FileSummary(FSAnalyzer.this, fid);
            }
          } catch (SQLiteException se) {
            se.printStackTrace();
View Full Code Here

        protected List<Path> job(SQLiteConnection db) throws SQLiteException {
          List<Path> output = new ArrayList<Path>();         
          SQLiteStatement stmt = db.prepare(filenameForCrawlQuery);
          try {
            stmt.bind(1, crawlid).bind(2, isDir);
            while (stmt.step()) {
              output.add(new Path(stmt.columnString(0), stmt.columnString(1)));
            }
          } catch (SQLiteException se) {
            se.printStackTrace();
          } finally {
View Full Code Here

          String path = null;
          String fname = null;
          SQLiteStatement stmt = db.prepare("SELECT Types.typelabel, Files.path, Files.fname FROM Types, TypeGuesses, Files WHERE TypeGuesses.fid = ? AND Files.fid = TypeGuesses.fid AND Types.typeid = TypeGuesses.typeid");
          try {
            stmt.bind(1, fid);
            if (stmt.step()) {
              identifier = stmt.columnString(0);
              path = stmt.columnString(1);
              fname = stmt.columnString(2);
            }
          } finally {
View Full Code Here

            List<String> schemaReprs = new ArrayList<String>();
            List<String> schemaDescs = new ArrayList<String>();
            List<byte[]> schemaBlobs = new ArrayList<byte[]>();
             
            stmt.bind(1, fid);
            while (stmt.step()) {
              schemaReprs.add(stmt.columnString(1));
              schemaDescs.add(stmt.columnString(2));
              schemaBlobs.add(stmt.columnBlob(3));
            }
View Full Code Here

          String identifier = null;         

          SQLiteStatement stmt = db.prepare("SELECT isDir, crawlid, fname, owner, groupowner, permissions, size, modified, path FROM Files WHERE Files.fid = ?");
          try {
            stmt.bind(1, fid);
            if (stmt.step()) {
              isDir = "True".equals(stmt.columnString(0));
              crawlid = stmt.columnLong(1);
              fname = stmt.columnString(2);
              owner = stmt.columnString(3);
              groupowner = stmt.columnString(4);
View Full Code Here

          if (! isDir) {
            stmt = db.prepare("SELECT typelabel FROM Types, TypeGuesses WHERE TypeGuesses.fid = ? AND Types.typeid = TypeGuesses.typeid");
            try {
              stmt.bind(1, fid);
              if (stmt.step()) {
                identifier = stmt.columnString(0);
              }
            } finally {
              stmt.dispose();
            }
View Full Code Here

              List<String> schemaReprs = new ArrayList<String>();
              List<String> schemaDescs = new ArrayList<String>();
              List<byte[]> schemaBlobs = new ArrayList<byte[]>();
             
              stmt.bind(1, fid);
              while (stmt.step()) {
                schemaReprs.add(stmt.columnString(1));
                schemaDescs.add(stmt.columnString(2));
                schemaBlobs.add(stmt.columnBlob(3));
              }
View Full Code Here

    return dbQueue.execute(new SQLiteJob<Path>() {
        protected Path job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("SELECT path, fname FROM Files WHERE crawlid = ? AND isDir = 'True' ORDER BY length(path||fname) ASC LIMIT 1");
          try {
            stmt.bind(1, crawlid);
            if (stmt.step()) {
              return new Path(stmt.columnString(0) + stmt.columnString(1));
            } else {
              return null;
            }
          } finally {
View Full Code Here

          SQLiteStatement stmt = db.prepare("select fid, path, fname from Files WHERE crawlid = ? AND length(?) > length(path||fname) AND isDir = 'True' AND replace(?, path||fname, '') LIKE '/%'");
          try {
            Path targetDir = new Path(targetDirStr);
            if (targetDir.getParent() != null) {
              stmt.bind(1, crawlid).bind(2, targetDir.toString()).bind(3, targetDir.toString());
              while (stmt.step()) {
                //Path p = new Path(stmt.columnString(0) + stmt.columnString(1));
                output.add(new FileSummary(FSAnalyzer.this, stmt.columnLong(0)));
              }
            }
          } finally {
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.