I've been doing that with Strut's MVC, but I was hoping to set the filter up like
//do some processing try { request.setAttribute("PEOPLE",resultSet); //pass request response up the chain } catch (Exception e) { } finally { resultSet.close(); pStmt.close(); connection.close(); } This way, with the use of JSTL at the JSP, I can prevent newing multiple objects that are request scoped (ojb, persistence layers, dao's aside ;-). Regards, Jacob -----Original Message----- From: German Augusto Niebles Alvarez [mailto:GERMNIAL@;susalud.com.co] Sent: Mon 10/28/2002 5:01 PM To: [EMAIL PROTECTED] Cc: Hookom, Jacob John Subject: Re: Filters, MVC, ResultSets I suggest you use vectors and beans (collection of beans) to poblate rs and then close de resultset, and use a class to connect to database (jdbchelper class), i send you an example: ================================================ // Obtiene la informacion acerca de la empresa public Vector obtenerInformacionOrganizacion() // throws SQLException,javax.naming.NamingException { Vector contenedorRazonSocial = new Vector(); Connection connection = null; String selectRazonSocialStr = "SELECT * FROM tblRazonSocial"; PreparedStatement selectStatement = null; try { // Obtiene una conexion a la base de datos, requiere Try connection = jdbcAccess.getConnection(); // Prepara la sentencia de Busqueda selectStatement = connection.prepareStatement(selectRazonSocialStr); // Obtiene el resultset ResultSet rs = selectStatement.executeQuery(); // Si el rs tiene next es que tiene un registro con la informacion acerca de la empresa FachadaRazonSocialBean facRazonSocialBean; if (rs.next()) { facRazonSocialBean = new FachadaRazonSocialBean(); facRazonSocialBean.setNit(rs.getString("nit")); facRazonSocialBean.setNombre(rs.getString("nombre")); facRazonSocialBean.setDireccion(rs.getString("direccion")); facRazonSocialBean.setTelefono(rs.getString("telefono")); facRazonSocialBean.setEMail(rs.getString("email")); facRazonSocialBean.setDireccionWeb(rs.getString("direccionWeb")); facRazonSocialBean.setCodigoIAC(rs.getString("codigoIAC")); contenedorRazonSocial.add(facRazonSocialBean); } contenedorRazonSocial.trimToSize(); // Cierra el Resultset rs.close(); jdbcAccess.cleanup(connection, selectStatement,null); } // Area de obtencion de Excepciones catch(NamingException ne) { System.out.println("NamingException in JDBCAccess :" + ne); } catch (SQLException sqle) { System.out.println("SQLException in JDBCAccess:" + sqle); } catch (Exception e) { System.out.println("Exception In JDBCAccess:" + e); } finally { return contenedorRazonSocial; } } ====================================================== Atentamente, Germán Niebles Analista de Información Tel 4-93-86-00 Ext 7053 >>> [EMAIL PROTECTED] 10/28 4:39 p.m. >>> Hey All, Everyone says for performance purposes, working directly with the resultset is optimal. But, with MVC, we can't just push the RS to the JSP to display and ignore closing. Is it possible with Filters to do a M->C1->V->C2 where C1 sets resultsets in the request, then pushes the response up to the JSP to render the content and then closes the resultset after rendering. I know 'programatically' it would work, but, I'm wondering about exceptions and making sure that the resultsets get closed. An example would be passing the request/response to the JSP, but then an exception occurs up the chain, does the exception trickle back down through the filters no matter what to catch and close my JDBC items? Best Regards, Jacob Hookom
<<winmail.dat>>
-- To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>