User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 426,476 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,235 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 655 | Replies: 7
Reply
Join Date: Jul 2007
Posts: 10
Reputation: sunithamcsit is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
sunithamcsit sunithamcsit is offline Offline
Newbie Poster

plzzzzzzzzz urgent

  #1  
Jul 25th, 2007
<%
int currentRow = 0;
int startingRow = ParamUtils.getIntParameter(request, "startingRow", 0);
int row_to_display = 200 ;
String errcode = null ;
try{
FPSProdMap[] oProdMap= dbFpsProdMap.getProdMap(sLang,1,200);
if (oProdMap != null) {
for (int i = 0; i < oProdMap.length; i++) {
currentRow++;
out.println("<TR><TD class='xRight' width='5%'>"+currentRow+"</TD>");
-------


}
}




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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: India-Tamilnadu-Chennai
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: plzzzzzzzzz urgent

  #2  
Jul 25th, 2007
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 5:41 am.
Adios,

Vinod......
Reply With Quote  
Join Date: Feb 2007
Location: India-Tamilnadu-Chennai
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: plzzzzzzzzz urgent

  #3  
Jul 25th, 2007
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.
Adios,

Vinod......
Reply With Quote  
Join Date: Jul 2007
Posts: 10
Reputation: sunithamcsit is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
sunithamcsit sunithamcsit is offline Offline
Newbie Poster

Re: plzzzzzzzzz urgent

  #4  
Jul 25th, 2007
I want to display records dynamically, means without limit
Reply With Quote  
Join Date: Feb 2007
Location: India-Tamilnadu-Chennai
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: plzzzzzzzzz urgent

  #5  
Jul 25th, 2007
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()
Adios,

Vinod......
Reply With Quote  
Join Date: Feb 2007
Posts: 14
Reputation: Thendral is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Thendral Thendral is offline Offline
Newbie Poster

Re: plzzzzzzzzz urgent

  #6  
Jul 26th, 2007
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).
Reply With Quote  
Join Date: Jul 2007
Posts: 10
Reputation: sunithamcsit is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
sunithamcsit sunithamcsit is offline Offline
Newbie Poster

Re: plzzzzzzzzz urgent

  #7  
Jul 26th, 2007
thank you very much,
I tried like this and I got it.

thank q
Reply With Quote  
Join Date: Feb 2006
Posts: 1,460
Reputation: masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice 
Rep Power: 9
Solved Threads: 131
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: plzzzzzzzzz urgent

  #8  
Jul 26th, 2007
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 7:12 am. Reason: typo
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:03 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC