Reputation: 35
ArrayList<Object[]> custInfo = new ArrayList<Object[]>();
while(rs.next()){
String loginId = rs.getString("LOGIN_ID");
String customerId = rs.getString("CUSTOMER_ID") ;
String requestDate = rs.getString("REQUEST_DATE") ;
Object[] custInfo123 = {loginId, customerId, requestDate};
custInfo.add(custInfo123);
}
session.setAttribute("custInfo", custInfo);
in one jsp retreivedata.jsp im using arraylist to store values of result set and set session.setAttribute. and in other jsp downloaddata.jsp im using,
ArrayList<Object[]> custInfo = (ArrayList<Object[]>)session.getAttribute("custInfo");
but it has given me error ArrayList can not be resolved to a type.
Upvotes: 0
Views: 82
Reputation: 529
Add import statement for ArrayList.
import java.util.ArrayList;
Update
For importing ArrayList in jsp, use following syntax:
<%@ page import="java.util.ArrayList" %>
Upvotes: 1