Interesting question,
Its very simple concept. Just using select query to fetch datas from the table.
And store in the resultset.
int n=0;
qry="select * from tablename"
statement st = db.executeQuery(qry);
Resultset rs=st.resultset();
while(rs.next)
{
n++;
}
out.println("The Number of record is"+n++);
here is a simple answer:
int row_count = 0;
rs = st.executeQuery("select count(*) from products where sub_catogery='"+product_catid+"'");
if(rs.next())
{
row_count = rs.getInt(1);
}
rs = st.executeQuery("select company_name, product_description, product_summary, image_path, website from products where sub_catogery='"+product_catid+"'");
//rest of code