コード例 #1
0
  public boolean update(BaseVo baseVo) {
    Oraspaceconfig vo = (Oraspaceconfig) baseVo;
    boolean result = false;

    StringBuffer sql = new StringBuffer();
    sql.append("update system_oraspaceconf set ipaddress='");
    sql.append(vo.getIpaddress());
    sql.append("',spacename='");
    sql.append(vo.getSpacename());
    sql.append("',linkuse='");
    sql.append(vo.getLinkuse());
    sql.append("',sms=");
    sql.append(vo.getSms());
    sql.append(",bak='");
    sql.append(vo.getBak());
    sql.append("',reportflag=");
    sql.append(vo.getReportflag());
    sql.append(",alarmvalue=");
    sql.append(vo.getAlarmvalue());
    sql.append(" where id=");
    sql.append(vo.getId());

    try {
      conn.executeUpdate(sql.toString());
      result = true;
    } catch (Exception e) {
      result = false;
      SysLogger.error("OraspaceconfigDao:update()", e);
    } finally {
      conn.close();
    }

    return result;
  }
コード例 #2
0
 public boolean save(BaseVo baseVo) {
   Oraspaceconfig vo = (Oraspaceconfig) baseVo;
   StringBuffer sql = new StringBuffer(100);
   sql.append(
       "insert into system_oraspaceconf(ipaddress,spacename,linkuse,sms,bak,reportflag,alarmvalue)values(");
   sql.append("'");
   sql.append(vo.getIpaddress());
   sql.append("','");
   sql.append(vo.getSpacename());
   sql.append("','");
   sql.append(vo.getLinkuse());
   sql.append("',");
   sql.append(vo.getSms());
   sql.append(",'");
   sql.append(vo.getBak());
   sql.append("',");
   sql.append(vo.getReportflag());
   sql.append(",");
   sql.append(vo.getAlarmvalue());
   sql.append(")");
   return saveOrUpdate(sql.toString());
 }