my jsp page
---------------
<logic:equal name="User" property="notify_dept_interview_time" value="1" >
<logic:iterate id="selectionProcess" name="selectionProcess">
<%if (selF.getPlace_interview()==null){%>
<tr>
<th align=left class="type1opp"><bean:message key="sel.place_interview" /></th>
<td width="22%" class="type1"><html:textarea name="selectionProcess" property="place_interview" indexed="true" onkeypress="textareaChars(this, 250)" cols="40" styleClass="textarea"/></td>
<th align=left class="type1opp"><bean:message key="sel.date_interview" /></th>
<td width="22%" class="type1"><html:text property="date_interview" name="selectionProcess"readonly="true" indexed="true" styleClass="input_medium"></html:text><img src="../images/cal.gif" onclick="return showCalendar('selectionProcess[<%=cntLoop++%>].date_interview','%d/%m/%Y %H:%M', '12', true);" style="cursor:hand;" width="16" height="16"/></td>
<th align=left class="type1opp"><bean:message key="sel.userid" /></th>
<td width="22%" class="type1"> <bean:write name="selectionProcess" property="interview_schedule_userid" /></td>
</tr>
<tr>
<td colspan=3 align=middle class="type1"><a href="javascript:void()" onclick="javascript:return resumesearch(<bean:write name="selectionProcess" property="selection_prid" />)"> Candidates for Interview</a></td>
</tr>
<tr>
<%}else{%>
<th align=left class="type1opp"><bean:message key="sel.place_interview" /></th>
<td width="22%" class="type1"><bean:write name="selectionProcess" property="place_interview"/></td>
<th align=left class="type1opp"><bean:message key="sel.date_interview" /></th>
<td width="22%" class="type1"><bean:write name="selectionProcess" property="date_interview"/></td>
<th align=left class="type1opp"><bean:message key="sel.userid" /></th>
<td width="22%" class="type1"> <bean:write name="selectionProcess" property="interview_schedule_userid" /></td>
</tr>
<tr>
<td colspan=3 align=middle class="type1"><a href="javascript:void()" onclick="javascript:return resumesearch()"> Candidates for Interview</a></td>
</tr>
<%}%>
</logic:iterate>
</logic:equal>
<jsp:include page="bottom5.jsp" flush="true" />
<jsp:include page="bottom3.jsp" flush="true" />
my action class
______________
// used to add dynamically
if(submit!=null&&submit.equalsIgnoreCase("Add"))
{
Dml dml=new Dml();
selectionProcess=new ArrayList();
for(int i=0;;i++)
{
String place_interview="selectionProcess["+i+"].place_interview";
String date_interview="selectionProcess["+i+"].date_interview";
if(request.getParameter(place_interview)==null)break;
SelectionDetails details=new SelectionDetails();
details.setVacancy_refno(selForm.getVacancy_refno());
details.setRecycle_no(selForm.getRecycle_no());
details.setPlace_interview(request.getParameter(place_interview));
details.setDate_interview(request.getParameter(date_interview));
selectionProcess.add(details);
}
SelectionDetails sd=new SelectionDetails();
sd.setPlace_interview("");
sd.setDate_interview("");
selectionProcess.add(sd);
dml.populateSelectionForm(selForm,selForm.getVacancy_refno(),selForm.getRecycle_no());
divs=dmlu.getDivision(selForm.getDivision());
depts=dmlu.getDepartment(selForm.getDept(),selForm.getDivision());
sections=dmlu.getSection(selForm.getDept(), selForm.getDivision(), selForm.getSection());
langs=dmlu.getLanguage_only_one(selForm.getLanguage());
grades=dmlu.getGrade_onlyone(selForm.getGrade());
ageranges=dmlu.getAgerange(selForm.getAge_range());
nationality=dmlu.getNationality(Integer.parseInt(selForm.getNation()));
}
// for saving
public SelectionForm approve(SelectionForm selForm,HttpServletRequest request,User user)
{
try
{
Dml dml=new Dml();
if(selForm.getInterview_schedule_userid()==null||selForm.getInterview_schedule_userid().equals(""))
{
selectionProcess=new ArrayList();
for(int i=0;;i++)
{
String place_interview="selectionProcess["+i+"].place_interview";
String date_interview="selectionProcess["+i+"].date_interview";
if(request.getParameter(place_interview)==null)break;
SelectionDetails details=new SelectionDetails();
details.setVacancy_refno(selForm.getVacancy_refno());
System.out.println("VACANCY_REFNO=================="+selForm.getVacancy_refno());
details.setRecycle_no(selForm.getRecycle_no());
System.out.println("RECYCLE_nO=================="+selForm.getRecycle_no());
details.setPlace_interview(request.getParameter(place_interview));
System.out.println("PLACE_INTERVIEW=================="+selForm.getPlace_interview());
details.setDate_interview(request.getParameter(date_interview));
System.out.println("DATE_INTERVIEW=================="+selForm.getDate_interview());
details.setInterview_schedule_userid(user.getUserid());
selectionProcess.add(details);
selForm=dml.selectionList(details.getVacancy_refno(),details.getRecycle_no(),details.getPlace_interview(),details.getDate_interview(),details.getInterview_schedule_userid(),details.getSelection_prid(),selForm);
}
}
______________________________________________________________________________
function to store in the database
__________________________________________________________________________________________
public SelectionForm selectionList(String vacancy_refno,String recycle_no,String place_interview,
String date_interview, String interview_schedule_userid,String selection_prid,SelectionForm selForm)
{
Connection dbConnection = null;
PreparedStatement psmt1 = null;
ResultSet rs1=null;
try
{
OracleServerAccess dbAccess = new OracleServerAccess();
dbConnection = dbAccess.openConnection();
String sq1="insert into ts_selection_details(VACANCY_REFNO,RECYCLE_NO,PLACE_INTERVIEW,DATE_INTERVIEW,SELECTION_PRID,DATE_INTERVIEW_INPUT_DATE,"+
"INTERVIEW_SCHEDULE_USERID) values ('"+vacancy_refno+"','"+recycle_no+"'," +
"'"+place_interview+"'," +
"to_date('"+date_interview+"','dd/mm/yyyy HH24:MI:SS')," +
"SEQ_RECID.NEXTVAL,to_date(sysdate,'dd/mm/yyyy HH24:MI:SS'),"+
"'"+interview_schedule_userid+"')";
logger.info(sq1);
psmt1 =dbConnection.prepareStatement(sq1);
rs1=psmt1.executeQuery();
if(rs1.next())
sq1="select " +
" DATE_INTERVIEW_INPUT_DATE,PLACE_INTERVIEW,DATE_INTERVIEW,interview_schedule_userid from ts_selection_details where " +
" vacancy_refno='"+selForm.getVacancy_refno()+"' and recycle_no='"+selForm.getRecycle_no()+"'";
logger.info(sq1);
psmt1=dbConnection.prepareCall(sq1);
psmt1.executeUpdate();
}
catch(Exception e)
{
logger.info(e.getMessage());
e.printStackTrace();
}
finally
{
try
{
if(rs1!=null)rs1.close();
if(psmt1!=null)psmt1.close();
if(dbConnection!=null)dbConnection.close();
}
catch(Exception e){}
}
return selForm;
}