示例#1
0
  /**
   * @param schema
   * @return
   * @author Jie Bao
   * @since 2006-07-01
   */
  public static boolean writeSchema(Schema schema) {
    // save to database
    String value = Zip.encode(schema.toText());
    String name = schema.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, "schemas", values, "name");
  }
示例#2
0
  public static boolean writeMapping(DataSourceMapping mapping) {
    // writeMappingOld(type);

    // save to database
    String value = Zip.encode(mapping.toText());
    String name = mapping.getName();
    String space = IndusBasis.user.name;
    String format = "XML1.0";

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

    values.put("name", name);
    values.put("value", value);
    values.put("space", space);
    values.put("ont1", mapping.schemaMapping.from);
    values.put("ont2", mapping.schemaMapping.to);
    values.put("format", format);

    Connection db = IndusBasis.indusSystemDB.db;
    return JDBCUtils.insertOrUpdateDatabase(db, "mappings", values, "name");
  }
示例#3
0
 public static boolean deleteView(String name) {
   String sql = "DELETE FROM views WHERE name = '" + name + "'";
   Connection db = IndusBasis.indusSystemDB.db;
   return JDBCUtils.updateDatabase(db, sql);
 }