Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need urgent help with ResultSet

 
Othmar Stehlik
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a servlet, that inserts parameters in a database.
Its a kind of guestbook, I Select the entreis from the table and want to print them out, an entry, an HR, the next entry.
Here�s a code snippet:
Vector entries = new Vector();
entries.add(rs;
rs.executeQuery("SELECT name FROM actor");
for(int i=0; i<entries.size(); i++){>
while(rs.next(){
out.println(name)
}
}

The problem is, that I don�t know, how to get every entry, and after the entry a HR printed.
I tried different way, but nothing worked.
Perhaps, there is a method to count the number of entries, and use this in a for loop?
I really appreciate any suggestion!
Othmar
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/jdbc/basics/retrieving.html
I can't make any sense of your code snippet! This leads me to believe that you might want to look at the tutorial. It has the information you were asking for as well.
Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic