Package com.almworks.sqlite4java

Examples of com.almworks.sqlite4java.SQLiteQueue


  public static SQLiteQueue getQueue() {
    if (_queue == null) {
      try {
        Logger.getLogger("com.almworks.sqlite4java").setLevel(Level.OFF);
        _queue = new SQLiteQueue(
            RADSAirClientWrapper
                .getFile("assets/data/gameStats/gameStats_en_US.sqlite"));
        _queue.start();
      } catch (Exception e) {
        System.out.println("Unable to open gameStats");
View Full Code Here


    return null;
  }

  public static void initializeChampions() {
    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();
View Full Code Here

      new Exception(
          "Tried to initialize already initalized champion list")
          .printStackTrace();
    }

    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;
View Full Code Here

    boolean isNew = false;
    metadataStore = metadataStore.getCanonicalFile();
    if (! metadataStore.exists()) {
      isNew = true;
    }
    this.dbQueue = new SQLiteQueue(metadataStore);
    this.dbQueue.start();

    if (isNew) {
      createTables();
    }
View Full Code Here

              FIELD_TIME_MILLIS + " INTEGER, " +
              FIELD_TEXT + " TEXT" +
            ");"
    ).step();
   
    queue = new SQLiteQueue(databaseFile);
    queue.start();
  }
View Full Code Here

  //-------------------------------------------------------------------------
  public SQLite4JavaDataBase() throws Throwable {
    File f;
    Logger.getLogger("com.almworks.sqlite4java").setLevel(Level.WARNING);
    File dbfile = File.createTempFile("tmpdb", ".db", new File("data/db/"));
    this.currConnection = new SQLiteQueue(dbfile);
    dbfile.deleteOnExit();
    //create structure of data base
    this.currConnection.start();
    SQLiteJob<Void> job = currConnection.execute(new SQLiteJob<Void>() {
      protected Void job(SQLiteConnection connection) throws Throwable {
View Full Code Here

TOP

Related Classes of com.almworks.sqlite4java.SQLiteQueue

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.