tags:

views:

61

answers:

2

hi,

select name from suggest where name like 'aero%' and rownum<=10;

I am getting only 8 keywords ( database has 8 keywords) but I want to count the number of keywords from database to my JSP program.

This gives 8 keywords:

 rs.getparameter("name");   

But I want to count the keywords. Can you give me any sample program?

thanks, Murali

A: 

Try looking up information on JDBC, here are some good ones to get you started:

To answer the question, I would either iterate on the ResultSets returned incrementing a counter, or just have query return count(name) and get that answer.

Ed Griebel
+3  A: 

Learn SQL :) There is a SELECT COUNT(*) FROM .. which returns only one row containing the number of rows you would normally fetch (it is a bit more complicated, but this will do for now).

ZeissS