@Override
 public boolean MOD_PADRES(
     String AP_NOMBRES_PADRE, String AP_NOMBRES_MADRE, String ID_TRABAJADOR, String USER) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_MOD_PADRES( ?, ?, ?, ?, ?)}");
     cst.setString(1, AP_NOMBRES_PADRE);
     cst.setString(2, AP_NOMBRES_MADRE);
     cst.setString(3, ID_TRABAJADOR);
     cst.setString(4, USER);
     cst.setString(5, FactoryConnectionDB.detalle_ip());
     cst.execute();
   } catch (SQLException ex) {
     throw new RuntimeException(ex.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("ERROR : " + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
   return true;
 }
  @Override
  public void INSERT_PADRES(
      String AP_NOMBRES_MADRE,
      String AP_NOMBRES_PADRE,
      String ID_TRABAJDOR,
      String US_MODIF,
      String IP_USUARIO) {
    CallableStatement cst;
    try {
      this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
      cst = conn.conex.prepareCall("{CALL RHSP_INSERT_PADRES(  ?, ?, ?, ?, ?)}");
      cst.setString(1, AP_NOMBRES_MADRE);
      cst.setString(2, AP_NOMBRES_PADRE);
      cst.setString(3, ID_TRABAJDOR);
      cst.setString(4, US_MODIF);
      cst.setString(5, IP_USUARIO);

      cst.execute();
    } catch (SQLException ex) {
      throw new RuntimeException(ex.getMessage());
    } catch (Exception e) {
      throw new RuntimeException("ERROR : " + e.getMessage());
    } finally {
      try {
        this.conn.close();
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }
  }
 @Override
 public List<Map<String, ?>> Listar_Padres(String id) {
   List<Map<String, ?>> lista = new ArrayList<Map<String, ?>>();
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     String sql =
         "select  id_trabajador,AP_NOMBRES_PADRE,AP_NOMBRES_MADRE  from RHTM_TRABAJADOR where id_trabajador='"
             + id
             + "'";
     ResultSet rs = this.conn.query(sql);
     while (rs.next()) {
       Map<String, Object> rec = new HashMap<String, Object>();
       rec.put("id", rs.getString("id_trabajador"));
       rec.put("padre", rs.getString("AP_NOMBRES_PADRE"));
       rec.put("madre", rs.getString("AP_NOMBRES_MADRE"));
       lista.add(rec);
     }
     rs.close();
   } catch (SQLException e) {
     throw new RuntimeException(e.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("ERROR");
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
     }
   }
   return lista;
 }
  @Override
  public List<Detalle_Privilegio> List_det_pr_id(String id_pr) {
    this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
    String sql =
        "select * from RHTD_DETALLE_PRIVILEGIO where ID_DETALLE_PRIVILEGIO ='" + id_pr + "'";
    List<Detalle_Privilegio> list = new ArrayList<Detalle_Privilegio>();
    try {
      ResultSet rs = this.conn.query(sql);

      while (rs.next()) {
        Detalle_Privilegio icd = new Detalle_Privilegio();
        icd.setId_detalle_privilegio(rs.getString("id_detalle_privilegio"));
        icd.setId_rol(rs.getString("id_rol"));
        icd.setNu_orden(rs.getInt("nu_orden"));
        icd.setId_privilegio(rs.getString("id_privilegio"));
        icd.setEs_detalle_privilegio(rs.getString("es_detalle_privilegio"));
        list.add(icd);
      }
    } catch (SQLException e) {
      throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
      throw new RuntimeException("Error :" + e.getMessage());
    } finally {
      try {
        this.conn.close();
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }
    return list;
  }
 @Override
 public void Registrar_Detalle_Priv(
     String id_rol, String nu_orden, String id_priv, String es_detalle_priv) {
   CallableStatement cst;
   try {
     String id_det_priv = "";
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_INSERT_DET_PRIV(?,?,?,?,?)}");
     cst.setString(1, id_det_priv.trim());
     cst.setString(2, id_rol.trim());
     cst.setString(3, nu_orden.trim());
     cst.setString(4, id_priv.trim());
     cst.setString(5, es_detalle_priv.trim());
     cst.execute();
   } catch (SQLException e) {
     throw new RuntimeException(e.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("Error :" + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }
  @Override
  public List<X_Detalle_Privilegio> List_det_pri_id(String id_pr) {
    this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
    String sql =
        "select d.*,r.NO_ROL from RHTD_DETALLE_PRIVILEGIO d, RHTR_ROL r where d.ID_ROL=r.ID_ROL and d.ID_DETALLE_PRIVILEGIO ='"
            + id_pr
            + "'";
    List<X_Detalle_Privilegio> list = new ArrayList<X_Detalle_Privilegio>();
    try {
      ResultSet rs = this.conn.query(sql);

      while (rs.next()) {
        X_Detalle_Privilegio x = new X_Detalle_Privilegio();
        x.setId_detalle_privilegio(rs.getString("Id_detalle_privilegio"));
        x.setEs_datalle_privilegio(rs.getString("ES_DETALLE_PRIVILEGIO"));
        x.setNu_orden(rs.getInt("Nu_orden"));
        x.setNo_rol(rs.getString("No_rol"));
        x.setId_rol(rs.getString("Id_rol"));
        x.setId_privilegio(rs.getString("Id_privilegio"));
        list.add(x);
      }
    } catch (SQLException e) {
      throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
      throw new RuntimeException("Error :" + e.getMessage());
    } finally {
      try {
        this.conn.close();
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }
    return list;
  }
 @Override
 public void MOD_PADRE_MADRE_CONYUGUE(
     String AP_NOMBRES_PADRE,
     String AP_NOMBRES_MADRE,
     String ES_TRABAJA_UPEU_CONYUGUE,
     String AP_NOMBRES_C,
     String FE_NAC_C,
     String ID_TIPO_DOC_C,
     String NU_DOC_C,
     String LI_INSCRIPCION_VIG_ESSALUD_C,
     String ID_TRABAJADOR,
     String US_MODIF,
     String IP_USUARIO) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst =
         conn.conex.prepareCall("{CALL RHSP_MOD_PADRE_MAD_CON( ?, ?, ?, ?, ?, ?, ?, ? ,?, ?, ?)}");
     cst.setString(1, AP_NOMBRES_PADRE);
     cst.setString(2, AP_NOMBRES_MADRE);
     cst.setString(3, ES_TRABAJA_UPEU_CONYUGUE);
     cst.setString(4, AP_NOMBRES_C);
     cst.setString(5, FE_NAC_C);
     cst.setString(6, ID_TIPO_DOC_C);
     cst.setString(7, NU_DOC_C);
     cst.setString(8, LI_INSCRIPCION_VIG_ESSALUD_C);
     cst.setString(9, ID_TRABAJADOR);
     cst.setString(10, US_MODIF);
     cst.setString(11, IP_USUARIO);
     cst.execute();
   } catch (SQLException ex) {
     throw new RuntimeException(ex.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("ERROR : " + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }
 @Override
 public void INSERT_CONYUGUE(
     String ES_TRABAJA_UPEU_CONYUGUE,
     String AP_NOMBRES_CONYUGUE,
     String FE_NAC_CONYUGUE,
     String TI_DOC_ID,
     String NU_DOC,
     String LI_INSCRIPCION_VIG_ESSALUD,
     String US_MODIF,
     String IP_USUARIO,
     String ID_TRABAJADOR,
     String ID_CONYUGUE) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_INSERT_CONYUGUE(  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
     cst.setString(1, ES_TRABAJA_UPEU_CONYUGUE);
     cst.setString(2, AP_NOMBRES_CONYUGUE);
     cst.setString(3, c.convertFecha(FE_NAC_CONYUGUE));
     cst.setString(4, TI_DOC_ID);
     cst.setString(5, NU_DOC);
     cst.setString(6, LI_INSCRIPCION_VIG_ESSALUD);
     cst.setString(7, US_MODIF);
     cst.setString(8, InetAddress.getLocalHost().getHostAddress());
     // cst.setString(9, null);
     cst.setString(9, ID_TRABAJADOR);
     cst.setString(10, ID_CONYUGUE);
     cst.execute();
   } catch (SQLException ex) {
     throw new RuntimeException(ex.getMessage());
   } catch (UnknownHostException ex) {
     throw new RuntimeException(ex.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("ERROR : " + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }
 @Override
 public void Elim_Detalle_Priv(String ID_pri_rol) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_ELIMINAR_DET_PRI(?)}");
     cst.setString(1, ID_pri_rol);
     cst.execute();
   } catch (SQLException e) {
     throw new RuntimeException(e.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("Error :" + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }
 @Override
 public void Act_r_pr(String id_pr_r) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_ACTIVAR_DET_PRI(?)}");
     cst.setString(1, id_pr_r);
     cst.execute();
   } catch (SQLException e) {
     throw new RuntimeException(e.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("Error :" + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }
 @Override
 public void Mod_Detalle_Priv(
     String id_det_pri, int nu_orden, String id_priv, String es_detalle_priv) {
   CallableStatement cst;
   try {
     this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
     cst = conn.conex.prepareCall("{CALL RHSP_MOD_DET_PRIV(?,?,?,?)}");
     cst.setString(1, id_det_pri);
     cst.setString(2, id_priv);
     cst.setInt(3, nu_orden);
     cst.setString(4, es_detalle_priv);
     cst.execute();
   } catch (SQLException e) {
     throw new RuntimeException(e.getMessage());
   } catch (Exception e) {
     throw new RuntimeException("Error :" + e.getMessage());
   } finally {
     try {
       this.conn.close();
     } catch (Exception e) {
       throw new RuntimeException(e.getMessage());
     }
   }
 }