Servlets and Searching the Database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shan_bash
Posted On:   Wednesday, March 21, 2001 02:40 AM

Hi I am developing an enterprise application using the >> java servlets >> oracle >> oracle jdbc thin driver problems: >>when i search the millions of records the browser times out >> it took a lot of time to search so many records ***** what i want *** when i made a search query the servlets searches the records and when it founds lets say first 1000 records it should send it to the client to show them and itself keep searching and when the user click the next records hyper link the servlets show them the next records. that is keeping user in touch. *** or ***** I want to handle the millions of   More>>

Hi

I am developing an enterprise application using the

>> java servlets
>> oracle
>> oracle jdbc thin driver

problems:
>>when i search the millions of records the browser times out
>> it took a lot of time to search so many records

***** what i want ***
when i made a search query the servlets searches the records and when it founds lets say first 1000 records it should send it to the client to show them and itself keep searching and when the user
click the next records hyper link the servlets show them the next records.

that is keeping user in touch.

*** or *****

I want to handle the millions of records just like a search engine
that is searching the records and showing in parts

>>> but < < < < how to display first 1000 records out of 100000 records
and then when i give link like search engines of next 1000 records how i will get the resultset and retrieve the next 1000 records
and so on

>>> either search the entire data base and showing it in parts
but how to handle it in servlets

>> or every time making a new query that must start next from the last record displayed



waiting for a nice answer

   <<Less

Re: Servlets and Searching the Database

Posted By:   Troy_Niven  
Posted On:   Friday, March 23, 2001 03:55 PM

Use the SQL command parameter LIMIT.

Here's an example.



SELECT * FROM TABLE_NAME LIMIT 0, 1000



That would pull 1000 results starting at postion 0 (the first , so the next pull would look something like.


SELECT * FROM TABLE_NAME LIMIT 1000, 1000



Which would pull 1000 results starting at result 1000.

Then all you have to do is keep track of wich set you're at, and dynamically generate the next link accordingly.





LOGAN
About | Sitemap | Contact