this is my jdbc program which is called by a servlet. in this program table records are retrieved correctly. my question is " how can i add the beans(CourseStudents) to an ArrayList for all the records of a table. please help me in this problem.
Thanks in advance.
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
res.next() will iterate over the rows (one row per loop) . in the loop a new bean will be created and will be added in the list.
try it. you haven't imported the util package . i have done it for you.