Package com.almworks.sqlite4java

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


  public void deleteConfigProperty(final String propertyName) {
    dbQueue.execute(new SQLiteJob<Object>() {
        protected Object job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("DELETE from Configs WHERE propertyname=?");
          try {
            stmt.bind(1, propertyName);
            stmt.step();
          } finally {
            stmt.dispose();
          }
          return null;
View Full Code Here


  public long countFilesForSchema(final long schemaid) {
    return dbQueue.execute(new SQLiteJob<Long>() {
        protected Long job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare(countFilesQueryForSchema);
          try {
            stmt.bind(1, schemaid);
            if (stmt.step()) {
              return stmt.columnLong(0);
            }
          } finally {
            stmt.dispose();
View Full Code Here

    return dbQueue.execute(new SQLiteJob<List<TypeGuessSummary>>() {
        protected List<TypeGuessSummary> job(SQLiteConnection db) throws SQLiteException {
          List<TypeGuessSummary> outputList = new ArrayList<TypeGuessSummary>();
          SQLiteStatement stmt = db.prepare(queryStr);
          try {
            stmt.bind(1, idval);
            while (stmt.step()) {
              outputList.add(new TypeGuessSummary(FSAnalyzer.this, stmt.columnLong(0), stmt.columnLong(1), stmt.columnLong(2)));
            }
          } finally {
            stmt.dispose();
View Full Code Here

  static String precachedTypeSummaryQuery = "SELECT TypeGuesses.fid, Types.typelabel, SchemaGuesses.schemaid, Files.crawlid, Files.fname, Files.owner, Files.groupowner, Files.permissions, Files.size, Files.modified, Files.path FROM SchemaGuesses, TypeGuesses, Files, Types WHERE TypeGuesses.fid = SchemaGuesses.fid AND TypeGuesses.fid = Files.fid AND TypeGuesses.typeid = Types.typeid AND TypeGuesses.typeId = ?";
  public TypeSummary getPrecachedTypeSummary(final long typeid) {
    return dbQueue.execute(new SQLiteJob<TypeSummary>() {
        protected TypeSummary job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare(precachedTypeSummaryQuery);
          stmt.bind(1, typeid);

          TypeSummary ts = null;
          try {
            List<TypeGuessSummary> tgslist = null;           
            while (stmt.step()) {
View Full Code Here

              FIELD_NAME + ", " +
              FIELD_PASSWORD +
            " 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

                  FIELD_PASSWORD + ", " +
                  FIELD_NAME +
                ") VALUES (?, ?, ?);"
        );
       
        st.bind(1, login);
        st.bind(2, password);
        st.bind(3, name);
       
        st.step();
View Full Code Here

                  FIELD_NAME +
                ") VALUES (?, ?, ?);"
        );
       
        st.bind(1, login);
        st.bind(2, password);
        st.bind(3, name);
       
        st.step();

        long newId = connection.getLastInsertId();
View Full Code Here

                ") VALUES (?, ?, ?);"
        );
       
        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);
View Full Code Here

                  FIELD_TIME_MILLIS + ", " +
                  FIELD_TEXT +
                ") VALUES (?, ?, ?);"
        );
       
        st.bind(1, userId);
        st.bind(2, timeMillis);
        st.bind(3, text);
       
        st.step();
View Full Code Here

                  FIELD_TEXT +
                ") VALUES (?, ?, ?);"
        );
       
        st.bind(1, userId);
        st.bind(2, timeMillis);
        st.bind(3, text);
       
        st.step();

        long newId = connection.getLastInsertId();
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.