944,116 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 1192
  • JSP RSS
Jul 25th, 2007
0

plzzzzzzzzz urgent

Expand Post »
<%
int currentRow = 0;
JSP Syntax (Toggle Plain Text)
  1. int startingRow = ParamUtils.getIntParameter(request, "startingRow", 0);
  2. int row_to_display = 200 ;
  3. String errcode = null ;
  4. try{
  5. FPSProdMap[] oProdMap= dbFpsProdMap.getProdMap(sLang,1,200);
  6. if (oProdMap != null) {
  7. for (int i = 0; i < oProdMap.length; i++) {
  8. currentRow++;
  9. out.println("<TR><TD class='xRight' width='5%'>"+currentRow+"</TD>");
  10. -------
  11.  
  12.  
  13. }
  14. }




here is my code contain in a jsp.
here records are displayed upto 200 only.
and one thing that more than 200 records are successfully added to the database
but Iam getting record display upto 200 only.
now can any one suggest that in a way
that i have to make my jsp to display
any number of records that I add. i.e dynamically.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sunithamcsit is offline Offline
10 posts
since Jul 2007
Jul 25th, 2007
0

Re: plzzzzzzzzz urgent

int row_to_display = 200 ;
FPSProdMap[] oProdMap= dbFpsProdMap.getProdMap(sLang,1,200);


change that value 200 to your number of records like if it is 1000 means change it in to 1000
Last edited by vinod_javas; Jul 25th, 2007 at 6:41 am.
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Jul 25th, 2007
0

Re: plzzzzzzzzz urgent

hi sunitha its no need to make new thread like this you could have added this code in your previous thread itself.... so you can get continuity for your problem solving.
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Jul 25th, 2007
0

Re: plzzzzzzzzz urgent

I want to display records dynamically, means without limit
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sunithamcsit is offline Offline
10 posts
since Jul 2007
Jul 25th, 2007
0

Re: plzzzzzzzzz urgent

for that you have to get the rowcount value for that particular table and then keep that value in that place of int row_to_display =

i dont know the exact method for getting row count value..

just search in google for getting Rowcount value... i think it may be getRowCount()
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Jul 26th, 2007
0

Re: plzzzzzzzzz urgent

hai sunitha,

Just write a query like the following.

select count(*) as total from test;

while(rs.next())
{
int tot=rs.getInt("total");
}


now substitute this value(tot) in that place(instead of 200).
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Thendral is offline Offline
14 posts
since Feb 2007
Jul 26th, 2007
0

Re: plzzzzzzzzz urgent

thank you very much,
I tried like this and I got it.

thank q
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sunithamcsit is offline Offline
10 posts
since Jul 2007
Jul 26th, 2007
0

Re: plzzzzzzzzz urgent

Of course, be forewarned, that unless you have locked the table you're using (and if you don't know how then just forget I mentioned that as I am not going to explain it), then between the time that you get the total with that query, and then actually pull the records from the database, the number of records could have changed (i.e. records added and/or deleted).

You would be much better off rewriting the dbFpsProdMap.getProdMap(sLang,1,200); method to internally produce an ArrayList, that can be grown dynamically and simply returning an array created from that ArrayList. (I'm assuming that sLang is the resultSet, if not pass it the resultSet and let it populate itself.) Then it will probably look like either dbFpsProdMap.getProdMap(sLang); (If sLang is a resultSet) or dbFpsProdMap.getProdMap(sLang, rs); (If it is not.)

The method can then, simply cycle through the resultSet adding FPSProdMap Objects to the ArrayList as it goes, and then, as mentioned, return an array created from this ArrayList.
Last edited by masijade; Jul 26th, 2007 at 8:12 am. Reason: typo
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: how to make dynamic
Next Thread in JSP Forum Timeline: How to run iReport jrxml from a jsp page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC