コード例 #1
0
ファイル: InfoWriter.java プロジェクト: baojie/indus
  // save to the indus server
  public static boolean writeTypeOld(DataType type) {
    // the old XML-based storage
    // return write(CMD_UPDATE_TYPE, type.getName(), type);

    // 2006-06-20 compressed plain text
    // @see InfoReader
    String text = Zip.encode(type.toText());
    // Debug.trace("after encoding: "+text.length());
    // send to server
    IndusHttpClient client = new IndusHttpClient();
    String res = client.sendCmd(CMD_UPDATE_TYPE + ";name=" + type.getName() + ";value=" + text);
    return res.equals(RES_OK);
  }
コード例 #2
0
ファイル: InfoWriter.java プロジェクト: baojie/indus
  public static boolean writeType(DataType type) {
    // writeTypeOld(type);

    // save to database
    String value = Zip.encode(type.toText());
    String name = type.getName();
    String space = IndusBasis.user.name;

    Map<String, String> values = new HashMap<String, String>();

    values.put("name", name);
    values.put("value", value);
    values.put("space", space);

    Connection db = IndusBasis.indusSystemDB.db;
    return JDBCUtils.insertOrUpdateDatabase(db, "types", values, "name");
  }