public boolean save(BaseVo baseVo) { FtpTransConfig vo = (FtpTransConfig) baseVo; StringBuffer sql = new StringBuffer(); sql.append("insert into nms_ftptransconfig(ip,username,password,flag)values("); sql.append("'"); sql.append(vo.getIp()); sql.append("','"); sql.append(vo.getUsername()); sql.append("','"); sql.append(vo.getPassword()); sql.append("','"); sql.append(vo.getFlag()); sql.append("');"); String yj = sql.toString(); return saveOrUpdate(yj); }
public boolean update(BaseVo baseVo) { FtpTransConfig vo = (FtpTransConfig) baseVo; StringBuffer sql = new StringBuffer(); sql.append("update nms_ftptransconfig set ip='"); sql.append(vo.getIp()); sql.append("',username='******',password='******',flag='"); sql.append(vo.getFlag()); sql.append("' where id="); sql.append(vo.getId()); String yj = sql.toString(); return saveOrUpdate(yj); }
@Override public BaseVo loadFromRS(ResultSet rs) { FtpTransConfig vo = new FtpTransConfig(); try { vo.setId(rs.getInt("id")); vo.setIp(rs.getString("ip")); vo.setUsername(rs.getString("username")); vo.setPassword(rs.getString("password")); vo.setFlag(rs.getInt("flag")); } catch (Exception e) { SysLogger.error("Error in TFtpServerDao.loadFromRS()", e); vo = null; e.printStackTrace(); } return vo; }