Package com.almworks.sqlite4java

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


      "datetime()" +
    ")";

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

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

    st.step();
  }

  public void update() throws Exception
View Full Code Here


    "WHERE " +
      "id = " + this.getId();

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

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

    st.step();
  }

  public void delete() throws Exception
View Full Code Here

            newChamp.opponentTips = st.columnString(i); i++;
            newChamp.selectSoundPath = st.columnString(i); i++;
 
            SQLiteStatement skinsDB = connection
                .prepare("SELECT * FROM championskins WHERE championId = ?");
            skinsDB.bind(1, newChamp.ID);
            while (skinsDB.step()) {
              ChampionSkin theSkin = new ChampionSkin();
              i = 0;
              theSkin.ID = skinsDB.columnInt(i); i++;
              theSkin.isDefault = skinsDB.columnInt(i) == 1; i++;
View Full Code Here

  public String checkHiveSupport(final Path fpath) {
    return dbQueue.execute(new SQLiteJob<String>() {
        protected String job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("SELECT hiveTableName FROM HiveTables WHERE fpath = ?");
          try {
            stmt.bind(1, fpath.toString());
            while (stmt.step()) {
              return stmt.columnString(0);
            }
            return null;
          } finally {
View Full Code Here

  public void addHiveSupport(final Path fpath, final String tablename) {
    dbQueue.execute(new SQLiteJob<Object>() {
        protected Object job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("INSERT into HiveTables VALUES(?, ?)");
          try {
            stmt.bind(1, fpath.toString());
            stmt.bind(2, tablename);
            stmt.step();
            return null;
          } finally {
            stmt.dispose();
View Full Code Here

    dbQueue.execute(new SQLiteJob<Object>() {
        protected Object job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("INSERT into HiveTables VALUES(?, ?)");
          try {
            stmt.bind(1, fpath.toString());
            stmt.bind(2, tablename);
            stmt.step();
            return null;
          } finally {
            stmt.dispose();
          }
View Full Code Here

   
    long fsid = dbQueue.execute(new SQLiteJob<Long>() {
        protected Long job(SQLiteConnection db) throws SQLiteException {
          SQLiteStatement stmt = db.prepare("SELECT fsid FROM Filesystems WHERE fsname = ?");
          try {
            stmt.bind(1, fsuri.toString());
            if (stmt.step()) {
              long resultId = stmt.columnLong(0);
              return resultId;
            } else {
              return -1L;
View Full Code Here

    if (canCreate) {
      return dbQueue.execute(new SQLiteJob<Long>() {
          protected Long job(SQLiteConnection db) throws SQLiteException {
            SQLiteStatement stmt = db.prepare("INSERT into Filesystems VALUES(null, ?)");
            try {
              stmt.bind(1, fsuri.toString());
              stmt.step();
              return db.getLastInsertId();
            } finally {
              stmt.dispose();
            }
View Full Code Here

  public long getCreatePendingCrawl(final long fsid, boolean shouldCreate)  {
      long crawlid = dbQueue.execute(new SQLiteJob<Long>() {
          protected Long job(SQLiteConnection db) throws SQLiteException {
            SQLiteStatement stmt = db.prepare("SELECT crawlid from Crawls WHERE fsid = ? AND inprogress = 'True'");
            try {
              stmt.bind(1, fsid);
              if (stmt.step()) {
                return stmt.columnLong(0);
              } else {
                return -1L;
              }
View Full Code Here

              String dateCreated = fileDateFormat.format(now);
              String syntheticDateFinished = fileDateFormat.format(new Date(0));
              String inprogress = "True";
              SQLiteStatement stmt = db.prepare("INSERT into Crawls VALUES(null, ?, ?, ?, ?)");
              try {
                stmt.bind(1, dateCreated).bind(2, syntheticDateFinished).bind(3, inprogress).bind(4, fsid);
                stmt.step();
                return db.getLastInsertId();
              } finally {
                stmt.dispose();
              }
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.