Kaushik 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).
Depends on the driver if it's JDBC 1.0, you can't. In JDBC 2 you can:
resultSet.last();
resultSet.getRow();

In any case you can do "SELECT COUNT(*) FROM MYTABLE"

> 2. what is the syntax of 'like' in the below line.
>
>    String str1="select * from TableInd where Detail like '"+%kw[0]%+"'";
>
> I want to check the 'Detail' field with the workds matching 'kw[0]';
> the above is giving error.
>
Jep, you just can't do that. Should be like:
<snip>Detail like '%" + kw[0] + "%' [or Detail like '%" + kw[0] + "%']
etc.

sven

--
======================================================================================
Sven van 't Veer                                              http://www.cachoeiro.net
Java Developer                                                      [EMAIL PROTECTED]
                                        _/_
The answer                             /   \
    to the ultimate question        nnn|.
.|nnn                                     42
=========================================U============================================

___________________________________________________________________________
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