This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
i have a servlet that connects to sql database and gets the info and then i print it to the browser the only problem is that when it prints it takes a long time to print like 3 to 4 minutes may be because there are too many records or may be i am outputting the data in a table. So i want the table to display the every field one by one instead of displaying it all together. thank you guys in advance. i heard of this method called flush but i don know what that is
if u can't impress people with ur intelligence , confuse them with ur bullshit
you mean to say that it is taking 3-4 mins to render the page or does the server side process takes 3-4 mins??? Regarding flush, I think you want something like HTTP streaming. Well, simply flushing the stream while keeping the connection open, I think is browser dependent. It did not work in my browser(IE 5) when I tried it and you should not use this concept. If there are too many records, then one way is to display the records in batches of say 15 records per page and then let the user request for the next set of records. Regards.
Joined: Nov 20, 2003
what i want it to do is display the each row one by one like we see in sql. cuz that is how my work wants and it also occured to me to use the batches but they don't want it that way. so any other suggestions???
I have just added a live demo page that allows you to type in a query and have the results returned as an HTML table with Sortable/clickable column headers. You can just hit submit when the default query comes up or you can enter your own query. The demo is at http://www.ssouza.com/fdsapi/sortdemo.jsp steve - http://www.fdsapi.com - the easiest way to generate dynamic xml and html.
I think one of your main problems is that browsers usually wait until the end of a table before displaying it, so even if you were to flush each row before moving to the next one, you still wouldn't see the table until it was complete. To solve this you could try sending each row of the table as a whole table. To ensure that the columns match, you will need to set explicit widths for the columns, though. Try something like: