First Commit from Source Code Reply

This commit is contained in:
vincenzofariello
2024-05-09 17:40:24 +02:00
parent 11e3b57c5b
commit 107a016cb9
35225 changed files with 1111346 additions and 1 deletions

View File

@@ -0,0 +1,166 @@
package it.valueteam.gnpsim.database;
/*
* Created on Feb 23, 2005
*
* MNP [project sim]
* Copyright (c) 2005
*
* @author Giovanni Amici
* @version 1.0
*/
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Properties;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import it.valueteam.gnpsim.utility.SimConfFile;
/**
* @author Giovanni
*
*/
public abstract class BaseDAO {
protected DataSource ds;
protected InitialContext ctx;
//private Connection conn;
/**
* Inizializza il data source
* @throws Exception
*/
protected void initDB() throws Exception{
try
{
Properties properties = SimConfFile.getInstance().ReadSection("JNDI");
System.out.println("java.naming.factory.initial: " + properties.getProperty("java.naming.factory.initial"));
System.out.println("java.naming.provider.url: " + properties.getProperty("java.naming.provider.url"));
System.out.println("java.naming.security.principal: " + properties.getProperty("java.naming.security.principal"));
System.out.println("java.naming.security.credentials: " + properties.getProperty("java.naming.security.credentials"));
System.out.println("datasource.name: " + properties.getProperty("datasource.name"));
System.out.println("Getting initial context.. ");
ctx = new InitialContext(properties);
System.out.println("Getting initial context.. OK");
String dsName = properties.getProperty("datasource.name");
System.out.println("Getting datasource name: " + dsName + " ..");
ds = (DataSource) ctx.lookup(properties.getProperty("datasource.name"));
System.out.println("Getting datasource name: " + dsName + " .. OK");
}
catch (Exception ex)
{
ex.printStackTrace();
throw ex;
}
finally
{
try
{
ctx.close();
}
catch (Exception ex) {}
}
}
/**
* Metodo per ottenere le connessioni dal DB
* Se non è disponibile una connessione ritorna null
*/
public Connection getConnection() throws Exception{
Connection conn = null;
try
{
if (ds==null) initDB();
conn = ds.getConnection();
}
catch (Exception ex)
{
ex.printStackTrace();
throw ex;
}
finally
{
try
{
if( conn != null ) conn.setAutoCommit(false);
}
catch (Exception ex)
{
ex.printStackTrace();
throw ex;
}
}
// se non riesce ad ottenere una connessione per tre volte torna null
return conn;
}
/**
* Metodo per la chiusura del ResultSet,dello Statement e della Connection
* tale metodo non lancia eccezzioni
* @param rs
* @param stmt
* @param c
*/
public void closeAll(ResultSet rs, Statement stmt, Connection c) {
try
{
if(rs!=null) rs.close();
}
catch (Throwable ex) {}
try
{
if(stmt!=null) stmt.close();
}
catch (Throwable ex) {}
try
{
if(c!=null)
c.close();
}
catch (Throwable ex) {}
}
// ******************************************************
// *****UTILITA' PER PAGINAZIONE ************************
// ******************************************************
protected int getRow_page_limit(int page, int row_per_page) throws Exception {
if(page<=0) page=1;
int skipRecords = row_per_page*(page-1);
int row_page_limit = skipRecords + row_per_page;
return row_page_limit;
}
/*
protected int getMaxPage(int totRow, int rows_per_page) {
int pages = -1;
try {
pages = totRow/rows_per_page;
int resto = totRow%rows_per_page;
if(resto!=0) pages++;
if(pages==0) pages = 1;
}
catch (Exception ex) {
}
finally {
return pages;
}
}
*/
public static void main(String[] args) {
//BaseDAO baseDAO1 = new BaseDAO();
}
}

View File

@@ -0,0 +1,536 @@
package it.valueteam.gnpsim.database;
import it.valueteam.gnp.dao.db.hb.GnpRichiesteRec;
import it.valueteam.gnp.dao.db.hb.GnpRichiesteRecExt;
import it.valueteam.gnp.obj.ProcessMapper;
import it.valueteam.gnp.obj.StatoRichiestaRec;
import it.valueteam.gnpsim.obj.CausaliRifiutoOloDTO;
import it.valueteam.gnpsim.obj.OloReplyDto;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
public class SimDAO extends BaseDAO{
// private static final int TIPO_RICH_STANDARD=1;
private static final int TIPO_RICH_DOPPIO_DONATING=2;
public static int ALL_STATES_PITAGORA_XDSL = -1;
private static String sqlGetAllOlo="select * from GNP_ANAG_OLO where FLAG_ATTIVO=1";
private static String sqlGetRequestToReply = "select OLO.CODICE_ORDINE_RECIPIENT AS CODICE_ORDINE_RECIPIENT,REC.COR AS COR, REC.COR2 AS COR2 from GNP_RICHIESTE_REC REC, " +
"GNP_OLO_RICHIESTE_OUT OLO WHERE REC.COW=? AND REC.PROCESSO IN ('"+ProcessMapper.proc_RIENTRO_ADSL+"','"+ProcessMapper.proc_RIENTRO_FONIA+"','"+ProcessMapper.proc_RIENTRO_NAKED+"') " +
"AND OLO.ID_RICHIESTA=REC.ID_RICHIESTA AND REC.STATO=? AND ROWNUM<100 AND DATA_CREAZIONE=(select MAX(DATA_CREAZIONE) from GNP_OLO_RICHIESTE_OUT WHERE ID_RICHIESTA = OLO.ID_RICHIESTA)";
private static String sqlGetRequestToReplyDoppioDonating =
"SELECT OLO.CODICE_ORDINE_RECIPIENT AS CODICE_ORDINE_RECIPIENT," +
"REC.COR AS COR, REC.COR AS COR2 " +
"FROM GNP_OLO_RICHIESTE_OUT OLO, GNP_DOPPIO_DONATING_OLO_BRIDGE REC " +
"WHERE REC.COW = ? " +
"AND OLO.id_richiesta_dd = REC.unique_id " +
"AND REC.STATO = ? " +
"AND ROWNUM < 100 " +
"AND OLO.CODICE_ORDINE_RECIPIENT = (SELECT MAX(CODICE_ORDINE_RECIPIENT) " +
" FROM GNP_OLO_RICHIESTE_OUT " +
" WHERE ID_RICHIESTA_DD = OLO.ID_RICHIESTA_DD)";
private static String sqlGetRequestToReplyFromAllStates = "select OLO.CODICE_ORDINE_RECIPIENT AS CODICE_ORDINE_RECIPIENT,REC.COR AS COR, REC.COR2 AS COR2 from GNP_RICHIESTE_REC REC, " +
"GNP_OLO_RICHIESTE_OUT OLO WHERE REC.COW=? AND REC.PROCESSO IN ('"+ProcessMapper.proc_RIENTRO_ADSL+"','"+ProcessMapper.proc_RIENTRO_FONIA+"','"+ProcessMapper.proc_RIENTRO_NAKED+"') " +
"AND OLO.ID_RICHIESTA=REC.ID_RICHIESTA AND REC.STATO IN (13,2) AND ROWNUM<100 AND DATA_CREAZIONE=(select MAX(DATA_CREAZIONE) from GNP_OLO_RICHIESTE_OUT WHERE ID_RICHIESTA = OLO.ID_RICHIESTA)";
private static String sqlGetRequestToReplyFromAllStatesDoppioDonating =
"SELECT OLO.CODICE_ORDINE_RECIPIENT AS CODICE_ORDINE_RECIPIENT," +
"REC.COR AS COR, REC.COR AS COR2 " +
"FROM GNP_OLO_RICHIESTE_OUT OLO, GNP_DOPPIO_DONATING_OLO_BRIDGE REC " +
"WHERE REC.COW = ? " +
"AND OLO.id_richiesta_dd = REC.unique_id " +
"AND REC.STATO IN(2, 3, 5) " +
"AND ROWNUM < 100 " +
"AND OLO.CODICE_ORDINE_RECIPIENT = (SELECT MAX(CODICE_ORDINE_RECIPIENT) " +
" FROM GNP_OLO_RICHIESTE_OUT " +
" WHERE ID_RICHIESTA_DD = OLO.ID_RICHIESTA_DD)";
private static String sqlGetAll_TO_SEND_PITAGORA_XDSL = "select * from GNP_RICHIESTE_REC where stato in (6,15) and processo IN ('"+ProcessMapper.proc_RIENTRO_ADSL+"','"+ProcessMapper.proc_RIENTRO_ADSL_BKL+"','"+ProcessMapper.proc_RIENTRO_NAKED+"','"+ProcessMapper.proc_RIENTRO_NAKED_BKL+"') and da_inviare=0 and ROWNUM<100";
private static String sqlGetByStato_TO_SEND_PITAGORA_XDSL = "select * from GNP_RICHIESTE_REC where (STATO=? OR STATO=6) and processo IN ('"+ProcessMapper.proc_RIENTRO_ADSL+"','"+ProcessMapper.proc_RIENTRO_ADSL_BKL+"','"+ProcessMapper.proc_RIENTRO_NAKED+"','"+ProcessMapper.proc_RIENTRO_NAKED_BKL+"') and da_inviare=0 and ROWNUM<100";
private static String sqlGetAll_TO_SEND_PITAGORA = "select * from GNP_RICHIESTE_REC where stato="+StatoRichiestaRec.INVIATAPITAGORA+" and processo IN ('"+ProcessMapper.proc_RIENTRO_FONIA+"','"+ProcessMapper.proc_RIENTRO_FONIA_BKL+"','"+ProcessMapper.proc_RIENTRO_NPg+"') and da_inviare=0 and ROWNUM<100";
private static String sqlGetAll_ATTESA_ESITO_A375 = "SELECT * FROM GNP_RICHIESTE_REC WHERE stato IN (" + StatoRichiestaRec.ATTESAVERIFICA + "," + StatoRichiestaRec.ATTESAVERIFICA_FONIA + "," + StatoRichiestaRec.ATTESAVERIFICA_DATI +")";
private static String sqlGetCausaliOloByTipoComunicazione = "select TC.CODICE AS TIPO_COMUNICAZIONE," +
" CF.CODICE AS CAUSALE_RIFIUTO, MR.CODICE AS CODICE_MOTIVO_RIFIUTO," +
" MR.DESCRIZIONE AS MOTIVO_RIFIUTO" +
" from GNP_ANAG_OLO_TIPO_COM TC," +
" GNP_ANAG_OLO_COD_MOTIVO_RIF MR," +
" GNP_ANAG_OLO_CAUSALE_RIFIUTO CF," +
" GNP_ANAG_OLO_CAUSALE_MOT_RIF CMR" +
" WHERE TC.CODICE = ?" +
" AND TC.CODICE=CF.CODICE_TIPO_COM" +
" AND CF.CODICE = CMR.CODICE_RIFIUTO" +
" AND CMR.ID_MOTIVO_RIFIUTO = MR.PROG_ID";
private static String sqlGetRichiestaByIdEsigenza = "SELECT * FROM GNP_RICHIESTE_REC WHERE ID_ESIGENZA = ?";
private static String sqlGetRichiestaExtById = "SELECT * FROM GNP_RICHIESTE_REC_EXT WHERE ID_RICHIESTA = ?";
private static String sqlGetValidCos="select COS from GNP_ANAGRAFICA_COS";
private static String sqlGetValidMarcaggio="select CODICE from GNP_ANAG_MARCAGGIO";
private static String sqlGetValidCnalaeVendita="select CODICE from GNP_ANAG_CANALE_VENDITA";
public SimDAO() {
}
@SuppressWarnings("unchecked")
public String[] getAllOlo() throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String[] result = null;
Vector _res = new Vector();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetAllOlo);
rs = pstmt.executeQuery();
while (rs.next())
_res.add(rs.getString("COD_OLO"));
if (! (_res == null || _res.size() == 0)) {
result = new String[_res.size()];
result = (String[]) _res.toArray(result);
}
}
catch (Exception ex) {
ex.printStackTrace();
throw ex;
}
finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public OloReplyDto[] getRequestToReply(String olo, int stato, int tipoRichieste) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
OloReplyDto[] result = null;
Vector _res = new Vector();
try {
conn = getConnection();
if(stato==-1){
if(tipoRichieste == TIPO_RICH_DOPPIO_DONATING)
pstmt = conn.prepareStatement(sqlGetRequestToReplyFromAllStatesDoppioDonating);
else
pstmt = conn.prepareStatement(sqlGetRequestToReplyFromAllStates);
pstmt.setString(1,olo);
}else{
if(tipoRichieste == TIPO_RICH_DOPPIO_DONATING)
pstmt = conn.prepareStatement(sqlGetRequestToReplyDoppioDonating);
else
pstmt = conn.prepareStatement(sqlGetRequestToReply);
pstmt.setString(1,olo);
pstmt.setInt(2, stato);
}
rs = pstmt.executeQuery();
while (rs.next()){
OloReplyDto rec = new OloReplyDto();
rec.setIdEsigenza(rs.getString("CODICE_ORDINE_RECIPIENT"));
rec.setCor(rs.getString("COR"));
rec.setCor2(rs.getString("COR2"));
_res.add(rec);
}
if (! (_res == null || _res.size() == 0)) {
result = new OloReplyDto[_res.size()];
result = (OloReplyDto[]) _res.toArray(result);
}
}
catch (Exception ex) {
throw ex;
}
finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public GnpRichiesteRec[] getAll_TO_SEND_PITAGORA_XDSL(int stato) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
GnpRichiesteRec[] result = null;
List resultList = new ArrayList();
try {
conn = getConnection();
if(stato==ALL_STATES_PITAGORA_XDSL){
pstmt = conn.prepareStatement(sqlGetAll_TO_SEND_PITAGORA_XDSL);
}else{
pstmt = conn.prepareStatement(sqlGetByStato_TO_SEND_PITAGORA_XDSL);
pstmt.setInt(1, stato);
}
rs = pstmt.executeQuery();
while (rs.next()) {
resultList.add(createRichiesteRec(rs));
}
result = new GnpRichiesteRec[resultList.size()];
if (resultList.size() > 0) {
result = (GnpRichiesteRec[]) resultList.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public GnpRichiesteRec[] getAll_ATTESA_ESITO_A375(int maxNum) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
GnpRichiesteRec[] result = null;
List resultList = new ArrayList();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetAll_ATTESA_ESITO_A375);
rs = pstmt.executeQuery();
int num = 0;
while (rs.next() && (maxNum == -1 || maxNum > num++)) {
resultList.add(createRichiesteRec(rs));
}
result = new GnpRichiesteRec[resultList.size()];
if (resultList.size() > 0) {
result = (GnpRichiesteRec[]) resultList.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public CausaliRifiutoOloDTO[] getCausaliRifiutoOloByTipoComunicazione(int tipoComunicazione) throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
CausaliRifiutoOloDTO[] result = null;
Vector _res = new Vector();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetCausaliOloByTipoComunicazione);
pstmt.setInt(1, tipoComunicazione);
rs = pstmt.executeQuery();
while (rs.next()){
CausaliRifiutoOloDTO causaliRifiutoOlo = new CausaliRifiutoOloDTO();
causaliRifiutoOlo.setTipoComunicazione(String.valueOf(rs.getLong("TIPO_COMUNICAZIONE")));
causaliRifiutoOlo.setCodiceMotivo_rifiuto(String.valueOf(rs.getLong("CODICE_MOTIVO_RIFIUTO")));
causaliRifiutoOlo.setCausaleRifiuto(String.valueOf(rs.getLong("CAUSALE_RIFIUTO")));
causaliRifiutoOlo.setMotivoRifiuto(rs.getString("MOTIVO_RIFIUTO"));
_res.add(causaliRifiutoOlo);
}
if (! (_res == null || _res.size() == 0)) {
result = new CausaliRifiutoOloDTO[_res.size()];
result = (CausaliRifiutoOloDTO[]) _res.toArray(result);
}
}
catch (Exception ex) {
throw ex;
}
finally {
closeAll(rs, pstmt, conn);
}
return result;
}
public GnpRichiesteRec getByIdEsigenza(String idEsigenza)
throws Exception
{
GnpRichiesteRec richiesta = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetRichiestaByIdEsigenza);
pstmt.setString(1, idEsigenza);
rs = pstmt.executeQuery();
if (rs.next()){
richiesta = createRichiesteRec(rs);
}
}
catch (Exception ex) {
throw ex;
}
finally {
closeAll(rs, pstmt, conn);
}
return richiesta;
}
public GnpRichiesteRecExt getRichiestaExtById(Long idRichiesta)
throws Exception
{
GnpRichiesteRecExt richiestaExt = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetRichiestaExtById);
pstmt.setLong(1, idRichiesta);
rs = pstmt.executeQuery();
if (rs.next()){
richiestaExt = createRichiestaRecExt(rs);
}
}
catch (Exception ex) {
throw ex;
}
finally {
closeAll(rs, pstmt, conn);
}
return richiestaExt;
}
@SuppressWarnings("unchecked")
public String[] getValidCos() throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String[] result = null;
Vector _res = new Vector();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetValidCos);
rs = pstmt.executeQuery();
while (rs.next())
_res.add(rs.getString("COS"));
if (!(_res == null || _res.size() == 0)) {
result = new String[_res.size()];
result = (String[]) _res.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
private GnpRichiesteRec createRichiesteRec(ResultSet rs) throws Exception{
GnpRichiesteRec richiestaRec = new GnpRichiesteRec();
richiestaRec.setIdEsigenza(rs.getString("ID_ESIGENZA"));
richiestaRec.setIdRichiesta(rs.getLong("ID_RICHIESTA"));
richiestaRec.setDaInviare(new Long(rs.getInt("DA_INVIARE")));
richiestaRec.setDataRicezioneRichiesta(rs.getDate("DATA_RICEZIONE_RICHIESTA"));
richiestaRec.setProcesso(rs.getString("PROCESSO"));
richiestaRec.setPiattaformaProvenienza(rs.getString("PIATTAFORMA_PROVENIENZA"));
richiestaRec.setCanaleProvenienza(rs.getString("CANALE_PROVENIENZA"));
richiestaRec.setDac(rs.getDate("DAC"));
richiestaRec.setDfw(rs.getDate("DFW"));
richiestaRec.setCos(rs.getString("COS"));
richiestaRec.setStato(new Long(rs.getInt(3)));
richiestaRec.setSla(new Long(rs.getInt("SLA")));
richiestaRec.setDet(rs.getDate("DET"));
richiestaRec.setCodiceOperatoreRecipient(rs.getString("CODICE_OPERATORE_RECIPIENT"));
richiestaRec.setCodiceSessioneOlo(rs.getString("CODICE_SESSIONE_OLO"));
richiestaRec.setCow(rs.getString("COW"));
richiestaRec.setNumeroTelefono(rs.getString("NUMERO_TELEFONO"));
richiestaRec.setRecapitoAlternativo(rs.getString("RECAPITO_ALTERNATIVO"));
richiestaRec.setCodiceFiscalePartitaIva(rs.getString("CODICE_FISCALE_PARTITA_IVA"));
richiestaRec.setNominativoCliente(rs.getString("NOMINATIVO_CLIENTE"));
richiestaRec.setCor(rs.getString("COR"));
richiestaRec.setCos2(rs.getString("COS2"));
richiestaRec.setCor2(rs.getString("COR2"));
richiestaRec.setDn1(rs.getString("DN1"));
richiestaRec.setDn2(rs.getString("DN2"));
richiestaRec.setDn3(rs.getString("DN3"));
richiestaRec.setDn4(rs.getString("DN4"));
richiestaRec.setDn5(rs.getString("DN5"));
richiestaRec.setDn6(rs.getString("DN6"));
richiestaRec.setDn7(rs.getString("DN7"));
richiestaRec.setDn8(rs.getString("DN8"));
richiestaRec.setDn9(rs.getString("DN9"));
richiestaRec.setDn10(rs.getString("DN10"));
richiestaRec.setMutataVolonta(new Long(rs.getInt("MUTATA_VOLONTA")));
richiestaRec.setAtterraggio(rs.getString("ATTERRAGGIO"));
richiestaRec.setDataCheck(rs.getDate("DATA_CHECK"));
return richiestaRec;
}
private GnpRichiesteRecExt createRichiestaRecExt(ResultSet rs)
throws Exception
{
GnpRichiesteRecExt richiestaExt = new GnpRichiesteRecExt();
richiestaExt.setCanaleVendita(rs.getString("CANALE_VENDITA"));
richiestaExt.setCodiceRifiutoOlo(rs.getLong("CODICE_RIFIUTO_OLO"));
richiestaExt.setDataInvioOlo(rs.getDate("DATA_INVIO_OLO"));
richiestaExt.setDataInvioPitagora(rs.getDate("DATA_INVIO_PITAGORA"));
richiestaExt.setDataRicezioneKoOlo(rs.getDate("DATA_RICEZIONE_KO_OLO"));
richiestaExt.setDataRicezioneKoPitagora(rs.getDate("DATA_RICEZIONE_KO_PITAGORA"));
richiestaExt.setDataRicezionePic(rs.getDate("DATA_RICEZIONE_PIC"));
richiestaExt.setDataVariazioneStato(rs.getDate("DATA_VARIAZIONE_STATO"));
richiestaExt.setIdRichiesta(rs.getLong("ID_RICHIESTA"));
richiestaExt.setMarcaggio(rs.getString("MARCAGGIO"));
richiestaExt.setMotivoRifiutoOlo(rs.getString("MOTIVO_RIFIUTO_OLO"));
richiestaExt.setMotivoRifiutoPitagora(rs.getString("MOTIVO_RIFIUTO_PITAGORA"));
richiestaExt.setNomeFileOlo(rs.getString("NOME_FILE_OLO"));
richiestaExt.setNomeFilePitagora(rs.getString("NOME_FILE_PITAGORA"));
richiestaExt.setNroInviiPitagora(rs.getLong("NRO_INVII_PITAGORA"));
return richiestaExt;
}
@SuppressWarnings("unchecked")
public String[] getValidCanaleVendita() throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String[] result = null;
List _res = new ArrayList();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetValidCnalaeVendita);
rs = pstmt.executeQuery();
while (rs.next())
_res.add(rs.getString("CODICE"));
if (!(_res == null || _res.size() == 0)) {
result = new String[_res.size()];
result = (String[])_res.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public String[] getValidMarcaggio() throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String[] result = null;
List _res = new ArrayList();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetValidMarcaggio);
rs = pstmt.executeQuery();
while (rs.next())
_res.add(rs.getString("CODICE"));
if (!(_res == null || _res.size() == 0)) {
result = new String[_res.size()];
result = (String[])_res.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
@SuppressWarnings("unchecked")
public GnpRichiesteRec[] getAll_TO_SEND_PITAGORA_REGOLATORIO() throws Exception {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
GnpRichiesteRec[] result = null;
List resultList = new ArrayList();
try {
conn = getConnection();
pstmt = conn.prepareStatement(sqlGetAll_TO_SEND_PITAGORA);
rs = pstmt.executeQuery();
while (rs.next()) {
resultList.add(createRichiesteRec(rs));
}
result = new GnpRichiesteRec[resultList.size()];
if (resultList.size() > 0) {
result = (GnpRichiesteRec[]) resultList.toArray(result);
}
} catch (Exception ex) {
throw ex;
} finally {
closeAll(rs, pstmt, conn);
}
return result;
}
}