I have an ArrayList itemNameList. It is supposed to contain many different ITEM_NAME which I get them from a database.
On the code shown above i try to allocate the items of an order to the corresponding ORDER_ID. This means I need to access the ITEM_NAME column many times for only one ORDER_ID. (arrayOrdersId contains all the ORDER_ID).
When I try to display the content instead of getting the item names I get something that looks like a memory address.
Thanks in advance
st = conn.createStatement();
rs = st.executeQuery("SELECT ITEM_NAME FROM ORDER_DETAIL WHERE ORDER_ID = " + arrayOrdersId[rowIndex]);
orderIdList.add(arrayOrdersId[rowIndex]);
Item itemName;
while(rs.next())
{
itemName = new Item(rs.getString("ITEM_NAME"));
itemNameList.add(itemName);
}