Package com.almworks.sqlite4java

Examples of com.almworks.sqlite4java.SQLiteStatement


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

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

    st.bind(1, this.getName());
    st.bind(2, this.getLeftPath());
    st.bind(3, this.getLeftResourceId());
    st.bind(4, this.getRightPath());
    st.bind(5, this.getRightResourceId());

    st.step();
  }
View Full Code Here


      "rightPath = ?, " +
      "rightResourceId = ? " +
    "WHERE " +
      "id = " + this.getId();

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

    st.bind(1, this.getName());
    st.bind(2, this.getLeftPath());
    st.bind(3, this.getLeftResourceId());
    st.bind(4, this.getRightPath());
    st.bind(5, this.getRightResourceId());

    st.step();
  }
View Full Code Here

    "FROM " +
      "projects " +
    "WHERE " +
      "id = " + id;

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

    st.step();

    if(st.hasRow())
    {
      Project project = new Project();
     
      project.id = st.columnInt(0);
      project.name = st.columnString(1);
      project.date = st.columnString(2);

      project.leftPath = st.columnString(3);
      project.leftResourceId = st.columnInt(4);
      project.leftHandler = HandlerFactory.factory(Resource.getResourceById(project.getLeftResourceId()), project.getLeftPath());

      project.rightPath = st.columnString(5);
      project.rightResourceId = st.columnInt(6);
      project.rightHandler = HandlerFactory.factory(Resource.getResourceById(project.getRightResourceId()), project.getRightPath());

      project.exclude = Project.getExclude(project.getId());

      return project;
View Full Code Here

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

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

    while(st.step())
    {
      projects.add(Project.getProjectById(st.columnInt(0)));
    }

    return projects;
  }
View Full Code Here

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

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

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

    st.step();
  }
View Full Code Here

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

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

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

    st.step();
  }
View Full Code Here

    "FROM " +
      "releases " +
    "WHERE " +
      "id = " + id;

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

    st.step();

    if(st.hasRow())
    {
      Release release = new Release();

      release.id = st.columnInt(0);
      release.projectId = st.columnInt(1);
      release.date = st.columnString(2);

      return release;
    }
    else
    {
View Full Code Here

    if (champions == null) {
      SQLiteQueue queue = GameStatsDBWrapper.getQueue();
      champions = new LinkedList<Champion>();
      queue.execute(new SQLiteJob<Object>() {
        protected Object job(SQLiteConnection connection) throws Throwable {
          SQLiteStatement st = connection
              .prepare("SELECT * FROM champions");
          while (st.step()) {
            Champion newChamp = new Champion();
            int i = 0; // first column is id
            newChamp.ID = st.columnInt(i); i++;
            newChamp.name = st.columnString(i); i++;
            newChamp.displayName = st.columnString(i); i++;
            newChamp.title = st.columnString(i); i++;
            newChamp.iconPath = st.columnString(i); i++;
            newChamp.portraitPath = st.columnString(i); i++;
            newChamp.splashPath = st.columnString(i); i++;
            newChamp.danceVideoPath = st.columnString(i); i++; i++; // TODO: tags
            newChamp.description = st.columnString(i); i++;
            newChamp.quote = st.columnString(i); i++;
            newChamp.quoteAuthor = st.columnString(i); i++;
            newChamp.range = st.columnInt(i); i++;
            newChamp.movementSpeed = st.columnInt(i); i++;
            newChamp.armorBase = st.columnDouble(i); i++;
            newChamp.armorLevel = st.columnDouble(i); i++;
            newChamp.manaBase = st.columnInt(i); i++;
            newChamp.manaLevel = st.columnInt(i); i++;
            newChamp.criticalChanceBase = st.columnInt(i); i++;
            newChamp.criticalChanceLevel = st.columnInt(i); i++;
            newChamp.manaRegenBase = st.columnDouble(i); i++;
            newChamp.manaRegenLevel = st.columnDouble(i); i++;
            newChamp.healthRegenBase = st.columnDouble(i); i++;
            newChamp.healthRegenLevel = st.columnDouble(i); i++;
            newChamp.magicResistBase = st.columnInt(i); i++;
            newChamp.magicResistLevel = st.columnDouble(i); i++;
            newChamp.healthBase = st.columnInt(i); i++;
            newChamp.healthLevel = st.columnDouble(i); i++;
            newChamp.attackBase = st.columnDouble(i); i++;
            newChamp.attackLevel = st.columnDouble(i); i++;
            newChamp.ratingAttack = st.columnInt(i); i++;
            newChamp.ratingDefense = st.columnInt(i); i++;
            newChamp.ratingDifficulty = st.columnInt(i); i++;
            newChamp.ratingMagic = st.columnInt(i); i++;
            newChamp.tips = st.columnString(i); i++;
            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++;
              theSkin.order = skinsDB.columnInt(i); i++;
              theSkin.championID = skinsDB.columnInt(i); i++;
              theSkin.name = skinsDB.columnString(i); i++;
              theSkin.displayName = skinsDB.columnString(i); i++;
              theSkin.portraitPath = skinsDB.columnString(i); i++;
              theSkin.splashPath = skinsDB.columnString(i); i++;
              newChamp.skins.add(theSkin);
            }
            skinsDB.dispose();
 
            /*
             * SQLiteStatement itemsDB = connection.prepare(
             * "SELECT * FROM championitems WHERE championId = ?");
             * itemsDB.bind(1, newChamp.ID); while (itemsDB.step()) {
View Full Code Here

    SQLiteQueue queue = GameStatsDBWrapper.getQueue();
    items = new LinkedList<Item>();
    queue.execute(new SQLiteJob<Object>() {
      protected Object job(SQLiteConnection connection) throws Throwable {
        SQLiteStatement st = connection.prepare("SELECT * FROM items");
        while (st.step()) {
          Item newItem = new Item();
          int i = 0;
          newItem.ID = st.columnInt(i);
          i++;
          newItem.name = st.columnString(i);
          i++;
          newItem.description = st.columnString(i);
          i++;
          newItem.iconPath = st.columnString(i);
          i++;
          newItem.price = st.columnInt(i);
          i++;
          newItem.flatHPPoolMod = st.columnInt(i);
          i++;
          newItem.flatMPPoolMod = st.columnInt(i);
          i++;
          newItem.percentHPPoolMod = st.columnInt(i);
          i++;
          newItem.percentMPPoolMod = st.columnInt(i);
          i++;
          newItem.flatHPRegenMod = st.columnInt(i);
          i++;
          newItem.percentHPRegenMod = st.columnInt(i);
          i++;
          newItem.flatMPRegenMod = st.columnInt(i);
          i++;
          newItem.percentMPRegenMod = st.columnInt(i);
          i++;
          newItem.flatArmorMod = st.columnInt(i);
          i++;
          newItem.percentArmorMod = st.columnInt(i);
          i++;
          newItem.flatAttackDamageMod = st.columnInt(i);
          i++;
          newItem.percentAttackDamageMod = st.columnInt(i);
          i++;
          newItem.flatAbilityPowerMod = st.columnInt(i);
          i++;
          newItem.percentAbilityPowerMod = st.columnInt(i);
          i++;
          newItem.flatMovementSpeedMod = st.columnInt(i);
          i++;
          newItem.percentMovementSpeedMod = st.columnInt(i);
          i++;
          newItem.flatAttackSpeedMod = st.columnInt(i);
          i++;
          newItem.percentAttackSpeedMod = st.columnInt(i);
          i++;
          newItem.flatDodgeMod = st.columnInt(i);
          i++;
          newItem.percentDodgeMod = st.columnInt(i);
          i++;
          newItem.flatCritChanceMod = st.columnInt(i);
          i++;
          newItem.percentCritChanceMod = st.columnInt(i);
          i++;
          newItem.flatCritDamageMod = st.columnInt(i);
          i++;
          newItem.percentCritDamageMod = st.columnInt(i);
          i++;
          newItem.flatMagicResistMod = st.columnInt(i);
          i++;
          newItem.percentMagicResistMod = st.columnInt(i);
          i++;
          newItem.flatEXPBonus = st.columnInt(i);
          i++;
          newItem.percentEXPBonus = st.columnInt(i);
          i++;
          newItem.epicness = st.columnInt(i);
          i++;
          items.add(newItem);
        }
        st.dispose();

        // TODO: add all legacy items
        items.add(new Item(0, "Empty", "EmptyIcon.png"));
        items.add(new Item(1005, "Meki Pendant",
            "3013_Disruption_Rod.png"));
View Full Code Here

  // Manage Hive Support
  ///////////////////////////////////////////////
  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 {
            stmt.dispose();
          }
        }
      }).complete();
  }
View Full Code Here

TOP

Related Classes of com.almworks.sqlite4java.SQLiteStatement

Copyright © 2018 www.massapicom. 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.