How do you create html table rows with java when displaying data from a database? Keep in mind I'll never know how many rows I'll need since new data will be entered, so in the future the table may need more rows or maybe less rows in the future. So I can't hard code the rows.
So what I want is the java code to create the rows for a table, display the data in the rows, and also place a delete button at the end of each row? Can somebody give me an example so I can understand the process?
Stevie, Ben's example is a good one. If you copy/paste it, note that the open bracket is missing after the while loop.
Also, note that it is considered bad practice to put too much code in a JSP, especially database code. It's fine when learning, but it's something to be aware of. Long term, you want to do the "real work" in a servlet, put the results in an attribute in the request, forward to a JSP and use tags to display the result.