Hello Everyone
,
I have a problem in this code.I am storing table record in "arrayList" and passing it to another
servlet. But the problem is , arraylist is producing only one record multiple times. If table has 3 records, then this arraylist showing only last record 3 times. Please help to get full table record in the arrayList. Many Thanks
try {
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
String projectName = rs.getString("projectname");
String projectCode = rs.getString("projectcode");
projectVO.setProjectName(projectName);
projectVO.setProjectCode(projectCode);
arrayList.add(projectVO);
}
} catch (Exception e ) {
e.printStackTrace();
}