RE: DynaAction form and ArrayList

2003-11-03 Thread David Friedman
Shouldn't you be adding rs.next() and not repeatedly adding the same teachForm? See: > teachers.add(teacherForm); Shouldn't it be: (?) teachers.add(rs); Regards, David -Original Message- From: Barry Volpe [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 2:36 PM To: Struts Us

Re: DynaAction form and ArrayList

2003-11-03 Thread Mark Lowe
while(rs.next()) { Map teacher = new HashMap(); teacher.put("firstName",rs.getString("firstName")); teacherList.add(teacher); } teacherForm.set("teachers", teacherList); request.setAttribute ("teachers", teacherList.toArray()); Cheers Mark On Monday, November 3, 2003, at

Re: DynaAction form and ArrayList

2003-11-03 Thread Kris Schneider
Per the JavaDoc for RowSetDynaClass: import org.apache.commons.beanutils.RowSetDynaClass; ... Connection conn = ...; // Acquire connection from pool Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT ..."); RowSetDynaClass rsdc = new RowSetDynaClass(rs); rs.close();

Re: DynaAction form and ArrayList

2003-11-03 Thread Mark Lowe
It works alright but last time i played with these beanutil's toys it was understandably slow. A little less slower is getting the resultsetmetadata and using them as your property names. IMO its better to make some beans and populate them with the result set values, until you've time to put a

Re: DynaAction form and ArrayList

2003-11-03 Thread Kris Schneider
That's just what RowSetDynaClass and the implementation of the Result interface in JSTL do (use ResultSetMetaData to grab column names). Quoting Mark Lowe <[EMAIL PROTECTED]>: > It works alright but last time i played with these beanutil's toys it > was understandably slow. A little less slower

Re: DynaAction form and ArrayList

2003-11-03 Thread Barry Volpe
TED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, November 03, 2003 11:42 AM Subject: Re: DynaAction form and ArrayList > > while(rs.next()) { > Map teacher = new HashMap(); > teacher.put("firstName",rs.getString("firstName")); &g