Of course there is copying, or you'll never could be disconnected :-) And actually, jxutil uses an ArrayList... better than a Vector, as it isn't synchronized, but If you don't need unordered readings, an LinkedList would be much faster, IMHO
On Tue, 2002-10-29 at 10:09, V. Cekvenich wrote: > Or a disconected rowset, so no copying. > > >Ex:http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/src/basicWebLib/org/commons/DAO/BasicDAOImpl.java?rev=1.2&content-type=text/vnd.viewcvs-markup > > .v > > > Felipe Schnack wrote: > > I think a LinkedList would be better performance-wise, wouldn't it? > > > > On Mon, 2002-10-28 at 21:01, German Augusto Niebles Alvarez wrote: > > > >>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 > > > > > > > -- > To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org> > -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Faculdade Ritter dos Reis www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303328 -- To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>
