Package com.jbidwatcher.util.db

Examples of com.jbidwatcher.util.db.Table$TypeColumn


    db.commit();
    db.shutdown();
  }

  private static Database dbMigrate() throws IllegalAccessException, SQLException, ClassNotFoundException, InstantiationException {
    Table schemaInfo = new Table("schema_info");
    List<Record> info = schemaInfo.findAll();
    if(info != null) {
      Record first = info.get(0);
      HashBacked record = new HashBacked(first);
      int version = record.getInteger("version", -1);
      if(version != -1) {
        int last_version = version;
        version++;
        NumberFormat nf = NumberFormat.getIntegerInstance();
        nf.setMinimumIntegerDigits(3);
        Statement s = schemaInfo.getDB().getStatement();
        while(runFile(schemaInfo.getDB(), s, "/db/" + nf.format(version) + ".sql")) {
          record.setInteger("version", version);
          schemaInfo.updateMap("schema_info", "version", Integer.toString(last_version), record.getBacking());
          last_version = version;
          version++;
        }
      }
    }
    return schemaInfo.getDB();
  }
View Full Code Here

TOP

Related Classes of com.jbidwatcher.util.db.Table$TypeColumn

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.