----- Original Message -----
From: Kaushik <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 19, 2000 9:11 AM
Subject: database Search with the servlets and sql.


> 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).
------------------------------------------------------
I dont know a direct method but you can do like this
   rs.last();
   int ks=rs.getRow();
   rs.first();
but you have to use JDBC2 driver and Java2
------------------------------------------------------
> 2. what is the syntax of 'like' in the below line.
>
>    String str1="select * from TableInd where Detail like '"+%kw[0]%+"'";
-------------------------------------------------------
There is a small mistake :)

       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.
>
> bye
> Kaushik
>
>
___________________________________________________________________________
> 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
Murat Can Ganiz
Selcuk University

___________________________________________________________________________
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

Reply via email to