+--------+-------+-----+
| Name |number |qty |
+--------+-------+-----+
| ab | 5 | 7 |
+--------+-------+-----+
| cd | 1 | 6 |
+--------+-------+-----+
| ef | 0 | 9 |
+--------+-------+-----+
| gh | 8 | 2 |
+--------+-------+-----+
I'm showing this example product table. I need to get this all table date into one jsp without using resultset. I tried to do up to this part:
public Product search(){
Product p = null;
ResultSet rs = DAO.fetch("SELECT * FROM Products");
if (rs.next()) {
p = new Product();
p.setNumber(rs.getString("ProductNumber"));
p.setName(rs.getString("ProductName"));
p.setQty(rs.getString("ProductQty"));
}
return p;
}
I need to add all table data in to list or ?? and return it using method how do i do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…