hi all
i'm doin a school project in j2me
i have develop a address book for the mobile phone
heres where i have got stuck this simple peice of code to browse the address boook is throwing an exception i don't know why..
plz help
public int enumerateContacts(
String [] contacts)//string[] is passed by reference send names in array contacts
{String dummy;
int x=0;
try{
numOfRec=rs.getNumRecords();
contacts=new String[numOfRec];
for( x=1;x<=numOfRec;x++)
{dummy=new String (rs.getRecord(x));
System.out.println("dummy created" + dummy);
contacts[x-1]=getName(dummy);
System.out.println("name added"+contacts[x-1]);
}}
catch(Exception e){ //<-----why is exception being generated
System.out.println("error "+e.getMessage());
}
return x-1;
}
on running the application i get the foll output on the wtk console:
dummy createdname=CATHYcompany=IBMtitle=CFOadd1=BOSTONadd2=FLORIDAphone=78542996email=
name addedCATHY
error null ------->exception
i ideally all the records in the record store should have been shown in the console