RE: Newbie question on Database and struts

2005-01-04 Thread Phillip Qin
In the controller, read form values, query the database, store result in Collection and save it to session or request-scope. On jsp, use iterate tag to display elements in Collection. -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: December 23, 2004 10:25 PM To:

Re: Newbie question on Database and struts

2004-12-27 Thread Dustin
This isn't exactly answering your question but... Check out iBATIS SQL Maps: http://www.ibatis.com/common/sqlmaps.html I won't go into how to use it. They have an excellent manual and tutorial. It is ridiculously easy to learn and use. Especially with Struts. Basically, you set up a query in

RE: Newbie question on Database and struts

2004-12-27 Thread Amit Gupta
I tried SQLMaps. It is wonderful but is there any easy manual (except PDF that come with ibatis) available on net? Amit Gupta -Original Message- From: Dustin [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 28, 2004 1:28 AM To: Tomcat Users List Subject: Re: Newbie question

RE: Newbie question on Database and struts

2004-12-23 Thread John Najarian
Hi Manisa, I'm not sure what you mean by 'create array of databeans'. Your result set contains multiple rows, your bean should be able to return the entire result set. Why do you need an array of a bean? -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent:

RE: Newbie question on Database and struts

2004-12-23 Thread Amit Gupta
Hi Manisha, I was also struggling with problem similar to you. I came you with following: package forklifts; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import

RE: Newbie question on Database and struts

2004-12-23 Thread Amit Gupta
Following code fetch records from database table , populate them to hastable and create vector of these hashtables . Then we pass this vector to JSP through request attribute. Action class import org.apache.struts.action.*; import javax.servlet.http.*; import java.sql.*; import java.util.*;

RE: Newbie question on Database and struts

2004-12-23 Thread Manisha Sathe
what i mean to array of databeans means - I have created employee data bean and for each row of result set i am creating one object of bean. So in a way i will get array of databeans. regards Manisha John Najarian [EMAIL PROTECTED] wrote: Hi Manisa, I'm not sure what you mean by 'create

Re: Newbie question on Database and struts

2004-12-23 Thread Sharad Ramadas
You dont need an array of data beans. Store your data bean in an ArrayList or in a Vector. e.g ArrayList empList = new ArrayList(); Employee emp = null; while(rst.next()) { emp = new Employee(); /* Fill the employee object with the records from the database. */

RE: Newbie question on Database and struts

2004-12-23 Thread Goel, Manish Kumar
, December 24, 2004 9:40 AM To: Tomcat Users List Subject: RE: Newbie question on Database and struts what i mean to array of databeans means - I have created employee data bean and for each row of result set i am creating one object of bean. So in a way i will get array of databeans. regards