At 11:41 AM 7/19/2000 +0530, you wrote:
>database Search with the servlets.
>Can you please sort my issue.
>
>1. what method is there to count the no. of records in a resultset(
>direct method with out looping).
There is no such method. Either run a second query that returns a count(*)
of results, or loop. The databases don't always provide this data, so JDBC
can't either.
>2. what is the syntax of 'like' in the below line.
>
> String str1="select * from TableInd where Detail like '"+%kw[0]%+"'";
>
>context: I have a search box in a form and visitor can enter keywords in
>the search box(text box). the key word information is tokenized and put
>in an array kw[numtokens] (num Tokens is Number of tokens entered in hte
>search box)
>I want to check the 'Detail' field with the workds matching 'kw[0]';
>the above is giving error.
Try putting the % characters within your string. That should compile.
---
William Crawford + 01 617 577 7844
Invantage, Inc [EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html