I am creating an application with J2ME. for connecting with database i am using RecordStore.
so to get a record i need to write as follow:
public boolean SearchRecord(String Rec, int pos )
{
String [] data = getRecordData();
Rec = Rec.substring(0,pos);
for ( int i = 0 ; i < data.length ; i++ )
{
data[i] = data[i].substring(0, pos );
if ( Rec.toString().trim().equals(data[i].toString().trim()) )
{
data = null; // System.gc();
return true;
}
}
data = null; // System.gc();
return false;
}
This is first get all records and traverse through it to search a record. But i have thousands of records and i just need some based on criteria is there any way to resolve this problem ? I do not want to traverse through thousands of records to get ten records.
One more thing i am confused about UI part that LWUIT is better or JSR is better to implement ?