Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public MethodResult getParametriReport(String abi, String filiale) throws DAOException{
- MethodResult ret = null;
- try{
- String query = "SELECT NOME_FILIALE, INDIRIZZO_FILIALE ,CAP ,COMUNE "+
- " FROM filiali_report "+
- " WHERE cod_abi = ? "+
- " AND cod_filiale = ?";
- List<SpParam> params = new ArrayList<SpParam>();
- params.add(new SpParam("cod_abi", Types.VARCHAR, abi));
- params.add(new SpParam("cod_filiale", Types.VARCHAR, filiale));
- Object[] row = this.conn.selectSingleRecord(query, params);
- if(row!=null){
- ret = new MethodResult();
- String[] tmp = new String[row.length];
- int i=0;
- for (Object obj : row)
- tmp[i++] = (String)obj;
- ret.setRetArrStr(tmp);
- }
- }
- catch(Exception ex){
- log.error("Errore in "+className+".getParametriReport: "+ex.getMessage(), ex);
- throw new DAOException(ex);
- }
- finally{
- if(this.mustCloseConn && this.conn!=null)
- this.conn.close();
- }
- return ret;
- }
- ------------------------------------------
- esempio :
- public MethodResult getParametriReport(String abi, String filiale) throws DAOException{
- MethodResult ret = null;
- try{
- String query = "SELECT NOME_FILIALE, INDIRIZZO_FILIALE ,CAP ,COMUNE "+
- " FROM filiali_report "+
- " WHERE cod_abi = ? "+
- " AND cod_filiale = ?";
- List<SpParam> params = new ArrayList<SpParam>();
- params.add(new SpParam("cod_abi", Types.VARCHAR, abi));
- params.add(new SpParam("cod_filiale", Types.VARCHAR, filiale));
- Object[] row = this.conn.selectSingleRecord(query, params);
- if(row!=null){
- ret = new MethodResult();
- String[] tmp = new String[row.length];
- int i=0;
- for (Object obj : row)
- tmp[i++] = (String)obj;
- ret.setRetArrStr(tmp);
- }
- }
- catch(Exception ex){
- log.error("Errore in "+className+".getParametriReport: "+ex.getMessage(), ex);
- throw new DAOException(ex);
- }
- finally{
- if(this.mustCloseConn && this.conn!=null)
- this.conn.close();
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement