Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in displaying rows of the column in jsp

 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made a simple application using java bean, and jsp and database using Access.
There are 5 rows in database (db) i.e. employeeID, Name and Salary. I call this db through java bean with ResultSet after making proper Connection and Statment and then display it using jsp file.
But problem is this that it is only displaying 1 line of record even though i want to have all the records of database using 'select * from empData'.
Could you please give an example or suggestion that how can i get all the records of my database through jsp.
Thanks/regards
Rashid Ali
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to iterane through the result set until you hit the end of it.
Assuning rs is your resultset...
while(rs.next())
{
print out each column in it...
do whatever...
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic