Package com.almworks.sqlite4java

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


    List<Long> finalResults = dbQueue.execute(new SQLiteJob<List<Long>>() {
        protected List<Long> job(SQLiteConnection db) throws SQLiteException {
          List<Long> results = new ArrayList<Long>();         
          SQLiteStatement stmt = db.prepare(subpathFilesQuery);
          try {
            stmt.bind(1, pathPrefix + "%");
            while (stmt.step()) {
              long resultId = stmt.columnLong(0);
              results.add(resultId);
            }
            return results;
View Full Code Here


        protected List<FileSummary> job(SQLiteConnection db) throws SQLiteException {
          List<FileSummary> output = new ArrayList<FileSummary>();
          SQLiteStatement stmt;
          if (prefix == null) {
            stmt = db.prepare(fileInfoQueryWithoutPrefix);
            stmt.bind(1, isDir ? "True" : "False");           
          } else {
            stmt = db.prepare(fileInfoQueryWithPrefix);
            String prefixStr = prefix;
            if (! prefixStr.endsWith("/")) {
              prefixStr += "/";
View Full Code Here

            stmt = db.prepare(fileInfoQueryWithPrefix);
            String prefixStr = prefix;
            if (! prefixStr.endsWith("/")) {
              prefixStr += "/";
            }
            stmt.bind(1, isDir ? "True" : "False").bind(2, prefixStr);           
          }
          try {
            while (stmt.step()) {
              long fid = stmt.columnLong(0);
              output.add(new FileSummary(FSAnalyzer.this, fid));
View Full Code Here

        protected List<FileSummary> job(SQLiteConnection db) throws SQLiteException {
          List<FileSummary> output = new ArrayList<FileSummary>();
          SQLiteStatement stmt;
          if (prefix == null) {
            stmt = db.prepare(precachedFileInfoQueryWithoutPrefix);
            stmt.bind(1, isDir ? "True" : "False");           
          } else {
            stmt = db.prepare(precachedFileInfoQueryWithPrefix);
            String prefixStr = prefix;
            if (! prefixStr.endsWith("/")) {
              prefixStr += "/";
View Full Code Here

            stmt = db.prepare(precachedFileInfoQueryWithPrefix);
            String prefixStr = prefix;
            if (! prefixStr.endsWith("/")) {
              prefixStr += "/";
            }
            stmt.bind(1, isDir ? "True" : "False").bind(2, prefixStr);           
          }
          try {
            FileSummary fs = null;
            FileSummaryData fsd = null;
            long lastFid = -1L;
View Full Code Here

  static String singletonFileInfoQuery = "SELECT fid FROM Files WHERE path||fname = ?"
  public FileSummary getSingleFileSummary(final String fullName) {
    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);
            }
View Full Code Here

    return dbQueue.execute(new SQLiteJob<List<Path>>() {
        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();
View Full Code Here

          String identifier = null;
          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);
            }
View Full Code Here

          try {
            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 path = null;
          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);
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.