Resultset To List

后端 未结 3 1374
别那么骄傲
别那么骄傲 2020-12-05 10:33

I want to convert my Resultset to List in my JSP page. and want to display all the values. This is my query:

SELECT userId, userName 
  FROM user;
         


        
3条回答
  •  盖世英雄少女心
    2020-12-05 10:48

    A ResultSet should never get as far as a JSP. It should be mapping into a data structure or object and closed inside the method scope in which it was created. It's a database cursor, a scarce resource. Your app will run out of them soon if you persist with such a design.

提交回复
热议问题