Hi,
I am new to java.Can u Plz help me.I have a JcomboBox. I want to display all the ItemId from the database in that JComboBox. I don't know how to do that.Can any one plz help me.Can anybody give some sample code

The code is:-
public Iterator selectItemID(){
Iterator itemNo;
ArrayList itemNumber = null;
try {
statement = dbConnection.prepareStatement("select ItemId from ItemDetails");
ResultSet itemNumberResult = statement.executeQuery();
while(itemNumberResult.next())
{
itemNo = (Iterator) itemNumberResult.getString(1);
System.out.println("itemNo " +itemNo);
return (Iterator) itemNo ;
}
} catch (SQLException e) {
e.printStackTrace();
}
return (Iterator) itemNumber;

}

itemno=new JComboBox();
DbActivity dbconnection = new DbActivity();

Iterator result= dbconnection.selectItemID();
itemno.addItem(result);


Regards
Diana