Example #1
1
 public Collection ejbGetRuoliSicurezza_View() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT "
                 + "COD_RUO_SIC, NOM_RUO_SIC, DES_RUO_SIC "
                 + "FROM "
                 + "ANA_RUO_SIC_TAB "
                 + "ORDER BY "
                 + "NOM_RUO_SIC");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       RuoliSicurezza_View obj = new RuoliSicurezza_View();
       obj.COD_RUO_SIC = rs.getLong(1);
       obj.NOM_RUO_SIC = rs.getString(2);
       obj.DES_RUO_SIC = rs.getString(3);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #2
0
 public Collection ejbGetPresidiByLuogo(long lCOD_LUO_FSC) {
   BMPConnection bmp = getConnection();
   try {
     // ORDER BY NE OTRABATIVAET
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT a.cod_psd_acd, a.cod_cag_psd_acd, a.cod_luo_fsc, a.ide_psd_acd, a.dat_ult_ctl, a.esi_ult_ctl, b.nom_cag_psd_acd FROM  ana_psd_acd_tab a, cag_psd_acd_tab b WHERE a.cod_cag_psd_acd= b.cod_cag_psd_acd AND a.sta_psd_acd != 'S' AND a.cod_luo_fsc =?   ORDER BY  cag_psd_acd_tab.nom_cag_psd_acd ");
     ps.setLong(1, lCOD_LUO_FSC);
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       PresidioView obj = new PresidioView();
       obj.lCOD_PSD_ACD = rs.getLong(1);
       obj.lCOD_CAG_PSD_ACD = rs.getLong(2);
       obj.lCOD_LUO_FSC = rs.getLong(3);
       obj.strIDE_PSD_ACD = rs.getString(4);
       obj.dtDAT_ULT_CTL = rs.getDate(5);
       obj.strESI_ULT_CTL = rs.getString(6);
       obj.strNOM_CAG_PSD_ACD = rs.getString(7);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #3
0
 public Collection ejbGetPresidiAll() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "select a.cod_psd_acd,a.cod_cag_psd_acd,a.cod_luo_fsc,a.ide_psd_acd,  a.dat_ult_ctl,   a.esi_ult_ctl,  b.nom_cag_psd_acd   from  ana_psd_acd_tab  a,    cag_psd_acd_tab  b   where a.cod_cag_psd_acd= b.cod_cag_psd_acd   and a.sta_psd_acd <> 'S' ");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       PresidioView obj = new PresidioView();
       obj.lCOD_PSD_ACD = rs.getLong(1);
       obj.lCOD_CAG_PSD_ACD = rs.getLong(2);
       obj.lCOD_LUO_FSC = rs.getLong(3);
       obj.strIDE_PSD_ACD = rs.getString(4);
       obj.dtDAT_ULT_CTL = rs.getDate(5);
       obj.strESI_ULT_CTL = rs.getString(6);
       obj.strNOM_CAG_PSD_ACD = rs.getString(7);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #4
0
 public void ejbLoad() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT "
                 + "COD_RUO_SIC, NOM_RUO_SIC, DES_RUO_SIC "
                 + "FROM "
                 + "ANA_RUO_SIC_TAB "
                 + "WHERE "
                 + "COD_RUO_SIC=?");
     ps.setLong(1, COD_RUO_SIC);
     ResultSet rs = ps.executeQuery();
     if (rs.next()) {
       this.COD_RUO_SIC = rs.getLong("COD_RUO_SIC");
       this.NOM_RUO_SIC = rs.getString("NOM_RUO_SIC");
       this.DES_RUO_SIC = rs.getString("DES_RUO_SIC");
     } else {
       throw new NoSuchEntityException("Ruolo per la sicurezza con ID= non trovato");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #5
0
 public Collection ejbGetPresidiDocumentiByID_View(long lCOD_PSD_ACD) {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT ana_doc_tab.cod_doc, tit_doc, rsp_doc, dat_rev_doc  FROM  ana_doc_tab, doc_psd_acd_tab WHERE  ana_doc_tab.cod_doc = doc_psd_acd_tab.cod_doc AND doc_psd_acd_tab.cod_psd_acd=? ORDER BY tit_doc");
     ps.setLong(1, lCOD_PSD_ACD);
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       PresidiDocumentiByID_View obj = new PresidiDocumentiByID_View();
       obj.COD_PSD_ACD = lCOD_PSD_ACD;
       obj.COD_DOC = rs.getLong(1);
       obj.TIT_DOC = rs.getString(2);
       obj.RSP_DOC = rs.getString(3);
       obj.DAT_REV_DOC = rs.getDate(4);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #6
0
 public void ejbLoad() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT cod_psd_acd,cod_cag_psd_acd,ide_psd_acd,dat_ult_ctl,esi_ult_ctl,cod_luo_fsc,sta_psd_acd FROM ana_psd_acd_tab WHERE cod_psd_acd=?");
     ps.setLong(1, lCOD_PSD_ACD);
     ResultSet rs = ps.executeQuery();
     if (rs.next()) {
       lCOD_PSD_ACD = rs.getLong(1);
       lCOD_CAG_PSD_ACD = rs.getLong(2);
       strIDE_PSD_ACD = rs.getString(3);
       dtDAT_ULT_CTL = rs.getDate(4);
       strESI_ULT_CTL = rs.getString(5);
       lCOD_LUO_FSC = rs.getLong(6);
       strSTA_PSD_ACD = rs.getString(7);
     } else {
       throw new NoSuchEntityException("Presidi with ID=" + lCOD_PSD_ACD + " not found");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #7
0
  // ------------------------------------------------------------------------------------------------------------
  public Long ejbCreate(
      long lCOD_CAG_PSD_ACD, String strIDE_PSD_ACD, long lCOD_LUO_FSC, String strSTA_PSD_ACD) {
    this.lCOD_PSD_ACD = NEW_ID();
    this.lCOD_CAG_PSD_ACD = lCOD_CAG_PSD_ACD;
    this.strIDE_PSD_ACD = strIDE_PSD_ACD;
    this.lCOD_LUO_FSC = lCOD_LUO_FSC;
    this.strSTA_PSD_ACD = strSTA_PSD_ACD;
    this.unsetModified();

    BMPConnection bmp = getConnection();
    try {

      PreparedStatement ps =
          bmp.prepareStatement(
              "INSERT INTO ana_psd_acd_tab (cod_psd_acd,cod_cag_psd_acd,ide_psd_acd,cod_luo_fsc,sta_psd_acd) VALUES(?,?,?,?,?)");
      ps.setLong(1, lCOD_PSD_ACD);
      ps.setLong(2, lCOD_CAG_PSD_ACD);
      ps.setString(3, strIDE_PSD_ACD);
      ps.setLong(4, lCOD_LUO_FSC);
      ps.setString(5, strSTA_PSD_ACD);
      ps.executeUpdate();
      return new Long(lCOD_PSD_ACD);
    } catch (Exception ex) {
      throw new EJBException(ex);
    } finally {
      bmp.close();
    }
  }
Example #8
0
 public void ejbStore() {
   if (!isModified()) {
     return;
   }
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "UPDATE "
                 + "ANA_RUO_SIC_TAB "
                 + "SET "
                 + "COD_RUO_SIC=?, "
                 + "NOM_RUO_SIC=?, "
                 + "DES_RUO_SIC=? "
                 + "WHERE "
                 + "COD_RUO_SIC=?");
     ps.setLong(1, COD_RUO_SIC);
     ps.setString(2, NOM_RUO_SIC);
     ps.setString(3, DES_RUO_SIC);
     ps.setLong(4, COD_RUO_SIC);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("Ruolo per la sicurezza con ID= non trovato");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #9
0
 public Collection ejbFindEx(
     java.sql.Date dtDAT_ULT_CTL,
     String strIDE_PSD_ACD,
     String strESI_ULT_CTL,
     Long lCOD_CAG_PSD_ACD,
     Long lCOD_LUO_FSC,
     int iOrderParameter // not used for now
     ) {
   String strSql =
       "SELECT a.cod_psd_acd, a.cod_cag_psd_acd, a.cod_luo_fsc, a.ide_psd_acd, a.dat_ult_ctl, a.esi_ult_ctl, b.nom_cag_psd_acd  FROM  ana_psd_acd_tab a, cag_psd_acd_tab  b WHERE  a.cod_cag_psd_acd= b.cod_cag_psd_acd AND a.sta_psd_acd != 'S'   ";
   if (dtDAT_ULT_CTL != null) {
     strSql += " AND a.dat_ult_ctl=? ";
   }
   if (strIDE_PSD_ACD != null) {
     strSql += " AND UPPER(a.ide_psd_acd) LIKE ? ";
   }
   if (strESI_ULT_CTL != null) {
     strSql += " AND UPPER(a.esi_ult_ctl) LIKE ? ";
   }
   if (lCOD_CAG_PSD_ACD != null) {
     strSql += " AND a.cod_cag_psd_acd=? ";
   }
   if (lCOD_LUO_FSC != null) {
     strSql += " AND a.cod_luo_fsc=? ";
   }
   strSql += " ORDER BY UPPER(b.nom_cag_psd_acd), UPPER(a.ide_psd_acd)";
   int i = 1;
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement(strSql);
     if (dtDAT_ULT_CTL != null) ps.setDate(i++, dtDAT_ULT_CTL);
     if (strIDE_PSD_ACD != null) ps.setString(i++, strIDE_PSD_ACD.toUpperCase());
     if (strESI_ULT_CTL != null) ps.setString(i++, strESI_ULT_CTL.toUpperCase());
     if (lCOD_CAG_PSD_ACD != null) ps.setLong(i++, lCOD_CAG_PSD_ACD.longValue());
     if (lCOD_LUO_FSC != null) ps.setLong(i++, lCOD_LUO_FSC.longValue());
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList ar = new java.util.ArrayList();
     while (rs.next()) {
       PresidioView obj = new PresidioView();
       obj.lCOD_PSD_ACD = rs.getLong(1);
       obj.lCOD_CAG_PSD_ACD = rs.getLong(2);
       obj.lCOD_LUO_FSC = rs.getLong(3);
       obj.strIDE_PSD_ACD = rs.getString(4);
       obj.dtDAT_ULT_CTL = rs.getDate(5);
       obj.strESI_ULT_CTL = rs.getString(6);
       obj.strNOM_CAG_PSD_ACD = rs.getString(7);
       ar.add(obj);
     }
     return ar;
     // ----------------------------------------------------------------------
   } catch (Exception ex) {
     throw new EJBException(strSql + "/n" + ex);
   } finally {
     bmp.close();
   }
 }
Example #10
0
 // -----------------------------#############################################
 // %%%Link%%% Table DOC_PSD_ACD_TAB
 public void addCOD_DOC(long newCOD_DOC) {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("INSERT INTO doc_psd_acd_tab (cod_doc,cod_psd_acd) VALUES(?,?)");
     ps.setLong(1, newCOD_DOC);
     ps.setLong(2, lCOD_PSD_ACD);
     ps.executeUpdate();
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #11
0
 public void ejbRemove() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("DELETE FROM ana_psd_acd_tab WHERE cod_psd_acd=?");
     ps.setLong(1, lCOD_PSD_ACD);
     if (ps.executeUpdate() == 0)
       throw new NoSuchEntityException("Presidi with ID=" + lCOD_PSD_ACD + " not found");
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #12
0
 public void ejbRemove() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement("DELETE FROM ana_sim_tab WHERE cod_sim=?");
     ps.setLong(1, lCOD_SIM);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("Simbolo with ID=" + lCOD_SIM + " not found");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
 public void ejbRemove() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement("DELETE FROM TPL_CON_tab  WHERE cod_TPL_CON=?");
     ps.setLong(1, COD_TPL_CON);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("TipologiaContratti con ID= non è trovata");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #14
0
 // %%%UNLink%%% Table DOC_PSD_ACD_TAB
 public void removeCOD_DOC(long newCOD_DOC) {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("DELETE FROM doc_psd_acd_tab  WHERE cod_doc=? AND cod_psd_acd=?");
     ps.setLong(1, newCOD_DOC);
     ps.setLong(2, lCOD_PSD_ACD);
     if (ps.executeUpdate() == 0)
       throw new NoSuchEntityException("Sezioni con ID=" + newCOD_DOC + " non &egrave trovata");
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #15
0
 public void ejbRemove() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("DELETE FROM ANA_RUO_SIC_TAB  WHERE COD_RUO_SIC=?");
     ps.setLong(1, COD_RUO_SIC);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("Ruolo per la sicurezza con ID= non trovato");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #16
0
 public Collection ejbFindAll() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement("SELECT COD_RUO_SIC FROM ANA_RUO_SIC_TAB ");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       al.add(new Long(rs.getLong(1)));
     }
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #17
0
 public Collection ejbfindEx(String NOM_RUO_SIC, String DES_RUO_SIC, long iOrderBy) {
   String Sql =
       "SELECT " + "COD_RUO_SIC, NOM_RUO_SIC, DES_RUO_SIC " + "FROM " + "ANA_RUO_SIC_TAB ";
   int i = 1;
   int desIndex = 0;
   int nomIndex = 0;
   if (!"".equals(NOM_RUO_SIC)) {
     Sql += " WHERE ";
     Sql += " UPPER(NOM_RUO_SIC) LIKE ? ";
     nomIndex = i++;
   }
   if (!"".equals(DES_RUO_SIC)) {
     if (nomIndex != 0) {
       Sql += " AND ";
     } else {
       Sql += " WHERE ";
     }
     Sql += " UPPER(DES_RUO_SIC) LIKE ? ";
     desIndex = i++;
   }
   Sql += " ORDER BY NOM_RUO_SIC "; // + (iOrderBy>0?" ASC": "DESC");
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement(Sql);
     if (nomIndex != 0) {
       ps.setString(nomIndex, (NOM_RUO_SIC + "%").toUpperCase());
     }
     if (desIndex != 0) {
       ps.setString(desIndex, (DES_RUO_SIC + "%").toUpperCase());
     }
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       RuoliSicurezza_View obj = new RuoliSicurezza_View();
       obj.COD_RUO_SIC = rs.getLong(1);
       obj.NOM_RUO_SIC = rs.getString(2);
       obj.DES_RUO_SIC = rs.getString(3);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
 /////////////////////
 // ATTENTION!!////////////////////////////////////////////////////////////////////////////
 // <comment description="Zdes opredeliayutsia metody home intefeisa kotorie budut rabotat v EJB
 // Containere"/>
 // </ITipologiaContrattiHome-implementation>
 public Long ejbCreate(String strNOM_TPL_CON) {
   this.NOM_TPL_CON = strNOM_TPL_CON;
   this.COD_TPL_CON = NEW_ID(); // unic ID
   this.unsetModified();
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("INSERT INTO TPL_CON_tab (cod_TPL_CON,nom_TPL_CON) VALUES(?,?)");
     ps.setLong(1, COD_TPL_CON);
     ps.setString(2, NOM_TPL_CON);
     ps.executeUpdate();
     return new Long(COD_TPL_CON);
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #19
0
 public void ejbStore() {
   if (!isModified()) {
     return;
   }
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("UPDATE ana_sim_tab SET des_sim=? WHERE cod_sim=?");
     ps.setString(1, strDES_SIM);
     ps.setLong(2, lCOD_SIM);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("Simbolo with ID=" + lCOD_SIM + " not found");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #20
0
 public void ejbLoad() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement("SELECT cod_sim,des_sim FROM ana_sim_tab WHERE cod_sim=?");
     ps.setLong(1, lCOD_SIM);
     ResultSet rs = ps.executeQuery();
     if (rs.next()) {
       lCOD_SIM = rs.getLong(1);
       strDES_SIM = rs.getString(2);
     } else {
       throw new NoSuchEntityException("Simbolo with ID=" + lCOD_SIM + " not found");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #21
0
 // </IAziendaHome-implementation>
 public Long ejbCreate(String strNOM_RUO_SIC) {
   this.COD_RUO_SIC = NEW_ID();
   this.NOM_RUO_SIC = strNOM_RUO_SIC;
   this.unsetModified();
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "INSERT INTO " + "ANA_RUO_SIC_TAB (COD_RUO_SIC, NOM_RUO_SIC) " + "VALUES " + "(?,?)");
     ps.setLong(1, COD_RUO_SIC);
     ps.setString(2, NOM_RUO_SIC);
     ps.executeUpdate();
     return new Long(COD_RUO_SIC);
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
  public Collection ejbFindEx(String NOM_TPL_CON, String DES_TPL_CON, int iOrderBy) {
    String strSql = "SELECT cod_TPL_CON, nom_TPL_CON, des_TPL_CON FROM TPL_CON_tab ";
    if (NOM_TPL_CON != null) {
      strSql += " WHERE UPPER(NOM_TPL_CON) LIKE ?";
    }
    if (DES_TPL_CON != null) {
      if (NOM_TPL_CON != null) {
        strSql += " AND ";
      } else {
        strSql += " WHERE ";
      }
      strSql += " UPPER(DES_TPL_CON) LIKE ?";
    }

    strSql += " ORDER BY " + Math.abs(iOrderBy) + (iOrderBy > 0 ? " ASC" : "DESC");
    int i = 1;
    BMPConnection bmp = getConnection();
    try {
      PreparedStatement ps = bmp.prepareStatement(strSql);

      if (NOM_TPL_CON != null) {
        ps.setString(i++, NOM_TPL_CON.toUpperCase());
      }
      if (DES_TPL_CON != null) {
        ps.setString(i++, DES_TPL_CON.toUpperCase());
      }

      ResultSet rs = ps.executeQuery();
      java.util.ArrayList ar = new java.util.ArrayList();
      while (rs.next()) {
        TipologiaContratti_View w = new TipologiaContratti_View();
        w.lCOD_TPL_CON = rs.getLong("COD_TPL_CON");
        w.strNOM_TPL_CON = rs.getString("NOM_TPL_CON");
        w.strDES_TPL_CON = rs.getString("DES_TPL_CON");
        ar.add(w);
      }
      return ar;
    } catch (Exception ex) {
      throw new EJBException(ex);
    } finally {
      bmp.close();
    }
  }
 public void ejbLoad() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement("SELECT * FROM TPL_CON_tab  WHERE cod_TPL_CON=?");
     ps.setLong(1, COD_TPL_CON);
     ResultSet rs = ps.executeQuery();
     if (rs.next()) {
       this.COD_TPL_CON = rs.getLong("COD_TPL_CON");
       this.NOM_TPL_CON = rs.getString("NOM_TPL_CON");
       this.DES_TPL_CON = rs.getString("DES_TPL_CON");
     } else {
       throw new NoSuchEntityException("TipologiaContratti con ID= non è trovata");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #24
0
  public Long ejbCreate(String strDES_SIM) {
    this.lCOD_SIM = NEW_ID();
    this.strDES_SIM = strDES_SIM;

    this.unsetModified();

    BMPConnection bmp = getConnection();
    try {
      PreparedStatement ps =
          bmp.prepareStatement("INSERT INTO ana_sim_tab (cod_sim,des_sim) VALUES(?,?)");
      ps.setLong(1, lCOD_SIM);
      ps.setString(2, strDES_SIM);
      ps.executeUpdate();
      return new Long(lCOD_SIM);
    } catch (Exception ex) {
      throw new EJBException(ex);
    } finally {
      bmp.close();
    }
  }
Example #25
0
 // </setter-getters>
 public Collection ejbGetSimbolo_View() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps = bmp.prepareStatement("SELECT cod_sim,des_sim FROM ana_sim_tab");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       Simbolo_View obj = new Simbolo_View();
       obj.lCOD_SIM = rs.getLong(1);
       obj.strDES_SIM = rs.getString(2);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
 public Collection ejbGetComboView() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "SELECT cod_TPL_CON, nom_TPL_CON, des_TPL_CON FROM TPL_CON_tab ORDER BY nom_TPL_CON");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList ar = new java.util.ArrayList();
     while (rs.next()) {
       TipologiaContratti_View w = new TipologiaContratti_View();
       w.lCOD_TPL_CON = rs.getLong("COD_TPL_CON");
       w.strNOM_TPL_CON = rs.getString("NOM_TPL_CON");
       w.strDES_TPL_CON = rs.getString("DES_TPL_CON");
       ar.add(w);
     }
     return ar;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
 public void ejbStore() {
   if (!isModified()) {
     return;
   }
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "UPDATE TPL_CON_tab  SET cod_TPL_CON=?, nom_TPL_CON=?, des_TPL_CON=?	 WHERE cod_TPL_CON=?");
     ps.setLong(1, COD_TPL_CON);
     ps.setString(2, NOM_TPL_CON);
     ps.setString(3, DES_TPL_CON);
     ps.setLong(4, COD_TPL_CON);
     if (ps.executeUpdate() == 0) {
       throw new NoSuchEntityException("TipologiaContratti con ID= non è trovata");
     }
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #28
0
 public void ejbStore() {
   if (!isModified()) return;
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "UPDATE ana_psd_acd_tab SET cod_psd_acd=?, cod_cag_psd_acd=?, ide_psd_acd=?, dat_ult_ctl=?, esi_ult_ctl=?, cod_luo_fsc=?, sta_psd_acd=? WHERE cod_psd_acd=?");
     ps.setLong(1, lCOD_PSD_ACD);
     ps.setLong(2, lCOD_CAG_PSD_ACD);
     ps.setString(3, strIDE_PSD_ACD);
     ps.setDate(4, dtDAT_ULT_CTL);
     ps.setString(5, strESI_ULT_CTL);
     ps.setLong(6, lCOD_LUO_FSC);
     ps.setString(7, strSTA_PSD_ACD);
     ps.setLong(8, lCOD_PSD_ACD);
     if (ps.executeUpdate() == 0)
       throw new NoSuchEntityException("Presidi with ID=" + lCOD_PSD_ACD + " not found");
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
Example #29
0
 // --<ALEX>--
 public PresidioView ejbGetPresidio(long lCOD_PSD_ACD) {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             " select   a.ide_psd_acd, b.nom_cag_psd_acd, a.dat_ult_ctl , a.esi_ult_ctl   from ana_psd_acd_tab a, cag_psd_acd_tab b where a.cod_cag_psd_acd = b.cod_cag_psd_acd and a.cod_psd_acd=?  ");
     ps.setLong(1, lCOD_PSD_ACD);
     ResultSet rs = ps.executeQuery();
     PresidioView w = new PresidioView();
     if (rs.next()) {
       w.lCOD_PSD_ACD = lCOD_PSD_ACD;
       w.strIDE_PSD_ACD = rs.getString(1);
       w.strNOM_CAG_PSD_ACD = rs.getString(2);
       w.dtDAT_ULT_CTL = rs.getDate(3);
       w.strESI_ULT_CTL = rs.getString(4);
     }
     return w;
   } catch (Exception ex) {
     throw new EJBException(ex);
   } finally {
     bmp.close();
   }
 }
 public Collection ejbGetTipologia_View() {
   BMPConnection bmp = getConnection();
   try {
     PreparedStatement ps =
         bmp.prepareStatement(
             "select cod_tpl_con, nom_tpl_con, des_tpl_con from tpl_con_tab  order by  nom_tpl_con ");
     ResultSet rs = ps.executeQuery();
     java.util.ArrayList al = new java.util.ArrayList();
     while (rs.next()) {
       TipologiaContratti_View obj = new TipologiaContratti_View();
       obj.lCOD_TPL_CON = rs.getLong(1);
       obj.strNOM_TPL_CON = rs.getString(2);
       obj.strDES_TPL_CON = rs.getString(3);
       al.add(obj);
     }
     bmp.close();
     return al;
   } catch (Exception ex1) {
     throw new EJBException(ex1);
   } finally {
     bmp.close();
   }
 }