I have a databse table called article with three fields(Id, Title, Text). I am using servlet. I have got a query to select the id and titles from the table. What I’d like to do is showing the list of the titles as hyperlinks and linking each of the titles to their texts from the databse table
this is my code
String SQL_QUERY ="Select article.title , article.articleId from article where article.title like '% "+searchWord+"%'";
Query query = session.createSQLQuery(SQL_QUERY);
List result = query.list();
for(Iterator it=result.iterator();it.hasNext();){
Object[] row = (Object[]) it.next();
String title = ((String) row[0]);
int id = ((Integer) row[1]);
out.println("<a Link to the text> title </a>")
}
Please Help.
Thanks
You need a hyper link which in turn calls Servlet with it.
e.g.
This will call
doGet()method of associatedServlet. Then rest is the known story.