• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

not returning all rows frm the resultset..

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have the foll method....

public List getSearchResults(MatterSearchBean oSearchBean)
throws LawPackException {
SearchResults srchRstBean = new SearchResults();

-----------------------------------------------
i have stmts here for connecting to the database
gets the connection
executes the query
returns the result set and then i do the following...
----------------------------------------------
if(resultSet != null) {
while(resultSet.next()){
String matterIdVal = resultSet.getString (LawPackConstants.COLUMN_MATTER_ID);
String matterNameVal = resultSet.getString(LawPackConstants.COLUMN_MATTER_NAME);
searchResults.add(searchMatterString.toString());
srchRstBean.setMatterId(matterIdVal);
srchRstBean.setMatterName(matterNameVal);

}//if
}//while

return searchResults;
}

now in my actionform i have:

List l_results = genMatterSearchDAO.getSearchResults(oSearchBean);
l_pageForm.setSearchResults(l_results);
request.setAttribute("hSearchList",l_results);

and then in my jsp i have....

<bean efine id="HSearchList" name="Matter_Search_Bean" property="HSearchList" scope="request" />
<logic:iterate id="currentResult" name = "HSearchList" >
<tr class='off'>
<td nowrap>
<a href="javascript penLink('<bean:write name="currentResult" property="matterId"/>','_blank');" >
<bean:write name="currentResult" property="matterId"/>
</a>
</td>
<td nowrap><bean:write name="currentResult" property="matterName"/></td>
<td nowrap><bean:write name="currentResult" property="personInChargeList"/></td>
<td nowrap><bean:write name="currentResult" property="businessUnitList"/></td>
</tr>
</logic:iterate>

This code is returning me only the last row in the resultset...
it has to return all the rows

i thnik i am doing wrong in the place where i am getting the resultset and putting it in searchresults...

any pointers/help?

thankyou
 
sue jacob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok fixed it myself!...

i did the foll...

searchResults.add(
new SearchResults(matterIdVal,matterNameVal,personInChargeVal,businessUnitVal));
 
reply
    Bookmark Topic Watch Topic
  • New Topic