thanks ben, that was important (imp) not "emp" and viz means for example.
anyways..... ;)
Here is my small part of DAO code which return customer (cust) array list:
public static ArrayList <
String> getCustomerList()
{
ArrayList <String> custList= new ArrayList();
ArrayList <String> custHeader= new ArrayList();
// DB connection code goes here ....
sql = "SELECT sCustId AS CustId,sCustName AS CustName,sCustCity AS CustCity FROM cust_master";
ResultSetMetaData meta = pStmt.getMetaData();
for(int j=1;j<=meta.getColumnCount();j++)
{
custList.add(meta.getColumnLabel(j));
}
if(totalRecords > 0)
{
while(rs.next())
{
CustomerTO custTO = new CustomerTO(); // Transfer Objects or Value Objects
custTO.setCustLoginId(rs.getString("CustId"));
custTO.setCustName(rs.getString("CustomerName"));
custTO.setCustCity(rs.getString("CustCity"));
custList.add(custTO);
}
}
return custList
}
Now I want to know how to add the metadata as a column header in the list or other collection with all customer details. In Short:
One Collection (custCollection) = Column Names + Customer Data
and in jsp by using "custCollection" I must be able to print the column headers and the customer data.