Package com.almworks.sqlite4java

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


          stmt.bind(1, typeid);

          TypeSummary ts = null;
          try {
            List<TypeGuessSummary> tgslist = null;           
            while (stmt.step()) {
              int i = 0;
              long fid = stmt.columnLong(i++);
              String typelabel = stmt.columnString(i++);
              long schemaid = stmt.columnLong(i++);
              long crawlid = stmt.columnLong(i++);
View Full Code Here


            " FROM " + TABLE_USERS + " WHERE " + FIELD_LOGIN + "=?;"
        );
       
        st.bind(1, login);
       
        if (st.step()) {
          return new User(st.columnLong(0), login, st.columnString(2), st.columnString(1));
        } else {
          return null;
        }
      }
View Full Code Here

       
        st.bind(1, login);
        st.bind(2, password);
        st.bind(3, name);
       
        st.step();

        long newId = connection.getLastInsertId();
        return new User(newId, login, password, name);
      }
    }).complete();
View Full Code Here

       
        st.bind(1, userId);
        st.bind(2, timeMillis);
        st.bind(3, text);
       
        st.step();

        long newId = connection.getLastInsertId();
        return new Message(newId, userId, timeMillis, text);
      }
    }).complete();
View Full Code Here

       
        st.bind(1, timeMillis);

        LinkedList<Message> resList = new LinkedList<>();

        while (st.step()) {
          resList.add(new Message(
              st.columnLong(0),
              st.columnLong(1),
              st.columnLong(2),
              st.columnString(3)
View Full Code Here

          " FROM " + TABLE_USERS + ";"
        );

        LinkedList<User> resList = new LinkedList<>();

        while (st.step()) {
          resList.add(new User(
              st.columnLong(0),
              st.columnString(1),
              st.columnString(2),
              st.columnString(3)
View Full Code Here

      st = conn.prepare(query, false);
      if(timeoutThread != null) {
        timeoutThread.endQuery(conn);
      }
      List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
      if(st.step()) {
        do {
          // true if there is data (SQLITE_ROW) was returned, false if statement has been completed (SQLITE_DONE)
          Map<String, Object> objectToRead = new HashMap<String, Object>();
          for(int i = 0; i < st.columnCount(); i++) {
            objectToRead.put(st.getColumnName(i), st.columnValue(i));
View Full Code Here

          Map<String, Object> objectToRead = new HashMap<String, Object>();
          for(int i = 0; i < st.columnCount(); i++) {
            objectToRead.put(st.getColumnName(i), st.columnValue(i));
          }
          list.add(objectToRead);
        } while(st.step() && list.size() < maxResults);
      }
      if(list.size() == maxResults) {
        throw new SQLException("Hard limit on number of results reached (" + maxResults + "), please use a LIMIT for this query.");
      }
      return JSONSerDe.ser(list);
View Full Code Here

      // Warning: this pragma is deprecated and may be removed in further versions, however there is no choice
      // other than recompiling SQLite or modifying the environment.
      conn.open(true);
      conn.exec("PRAGMA temp_store_directory = '" + new File(".").getAbsolutePath() + "'");
      SQLiteStatement st = conn.prepare("PRAGMA temp_store_directory");
      st.step();
      LOG.info("Changed temp_store_directory to: " + st.columnString(0));
      // journal_mode=OFF speeds up insertions
      conn.exec("PRAGMA journal_mode=OFF");
      /*
       * page_size is one of of the most important parameters for speed up indexation. SQLite performs a merge sort for
View Full Code Here

          }
        }
        count++;
        tupleCount++;
      }
      pS.step();
      pS.reset();

      records++;
      if(records == getBatchSize()) {
        SQLiteConnection conn = connCache.get(partition);
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.