I am trying to build my combo box from getting values from db.db for origin values and I am using set to get unique values any suggestions of what I am doing wrong?
I am trying to return values to client to populate Combo box with origin I use set to keep values unique see code I get database exception.
public
String[] getComboOriginValues(int fieldNum) throws DatabaseException {
invariant();
Set origin = null;
try {
seek(1); String [] values = null;int r;
for (r = 1; r <= recordCount; r++)
{
values = readRecord(); origin.add(values[fieldNum]);
}
}
catch (IOException e)
{
throw new DatabaseException(UNEXPECTED + e);
}
return (String[])origin.toArray();
//return (String[])origin.toArray(new String(0)); //this dont work
}
Thanks Lisa