Examples of SQLiteStatement


Examples of android.database.sqlite.SQLiteStatement

    return insert(statement, args, argFieldTypes, null);
  }

  public int insert(String statement, Object[] args, FieldType[] argFieldTypes, GeneratedKeyHolder keyHolder)
      throws SQLException {
    SQLiteStatement stmt = null;
    try {
      stmt = db.compileStatement(statement);
      bindArgs(stmt, args, argFieldTypes);
      long rowId = stmt.executeInsert();
      if (keyHolder != null) {
        keyHolder.addKey(rowId);
      }
      return 1;
    } catch (android.database.SQLException e) {
      throw SqlExceptionUtil.create("inserting to database failed: " + statement, e);
    } finally {
      if (stmt != null) {
        stmt.close();
      }
    }
  }
View Full Code Here

Examples of android.database.sqlite.SQLiteStatement

      }
    }
  }

  public int update(String statement, Object[] args, FieldType[] argFieldTypes) throws SQLException {
    SQLiteStatement stmt = null;
    try {
      stmt = db.compileStatement(statement);
      bindArgs(stmt, args, argFieldTypes);
      stmt.execute();
      return 1;
    } catch (android.database.SQLException e) {
      throw SqlExceptionUtil.create("updating database failed: " + statement, e);
    } finally {
      if (stmt != null) {
        stmt.close();
      }
    }
  }
View Full Code Here

Examples of android.database.sqlite.SQLiteStatement

      }
    }
  }

  public long queryForLong(String statement) throws SQLException {
    SQLiteStatement stmt = null;
    try {
      stmt = db.compileStatement(statement);
      return stmt.simpleQueryForLong();
    } catch (android.database.SQLException e) {
      throw SqlExceptionUtil.create("queryForLong from database failed: " + statement, e);
    } finally {
      if (stmt != null) {
        stmt.close();
      }
    }
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

    "FROM " +
      "exclude " +
    "WHERE " +
      "projectId = " + projectId;

    SQLiteStatement st = Db.getInstance().query(sql);

    while(st.step())
    {
      exclude.add(st.columnString(0));
    }

    return exclude;
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

      "?, " +
      "?, " +
      "?" +
    ")";

    SQLiteStatement st = Db.getInstance().query(sql);

    st.bind(1, this.getType());
    st.bind(2, this.getName());
    st.bind(3, serialize(this.getConfig()));

    st.step();
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

      "name = ?, " +
      "config = ? " +
    "WHERE " +
      "id = " + this.getId();

    SQLiteStatement st = Db.getInstance().query(sql);

    st.bind(1, this.getType());
    st.bind(2, this.getName());
    st.bind(3, serialize(this.getConfig()));

    st.step();
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

    "FROM " +
      "resources " +
    "WHERE " +
      "id = " + id;

    SQLiteStatement st = Db.getInstance().query(sql);

    st.step();

    if(st.hasRow())
    {
      Resource resource = new Resource();

      resource.id = st.columnInt(0);
      resource.type = st.columnString(1);
      resource.name = st.columnString(2);
      resource.config = Resource.unserialize(st.columnBlob(3));

      return resource;
    }
    else
    {
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

    String sql = "SELECT " +
      "id " +
    "FROM " +
      "resources";

    SQLiteStatement st = Db.getInstance().query(sql);

    while(st.step())
    {
      resources.add(Resource.getResourceById(st.columnInt(0)));
    }

    return resources;
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

    ") VALUES (" +
      "?, " +
      "?" +
    ")";

    SQLiteStatement st = Db.getInstance().query(sql);

    st.bind(1, this.getProjectId());
    st.bind(2, this.getPattern());

    st.step();
  }
View Full Code Here

Examples of com.almworks.sqlite4java.SQLiteStatement

      "projectId = ?, " +
      "pattern = ? " +
    "WHERE " +
      "id = " + this.getId();

    SQLiteStatement st = Db.getInstance().query(sql);

    st.bind(1, this.getProjectId());
    st.bind(2, this.getPattern());

    st.step();
  }
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.