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
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
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();
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
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
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
6 matches
Mail list logo