RecordStore
table="login"
openRecStore();
if (ns == 0) {
writeRecord("dileepp");
writeRecord("1207sp");
writeRecord("000002");
writeRecord("True");
writeRecord("True");
}
public void openRecStore(){
try{ rs = RecordStore.openRecordStore(table,true );
}catch (Exception e){}
}
public void writeRecord(String str){
byte[] rec = str.getBytes();
try{rs.addRecord(rec, 0, rec.length);
}catch (Exception e){}
}
public void readRecords(){
int ln=0;
mdes = new String[ln];
String[] sArry;
try{
ln = rs.getNumRecords();
}catch (Exception e){}
mdes = new String[ln];
int x=0;
try{
byte[] recData = new byte[rs.getNumRecords()];
int len;
for(int i = 1; i <= rs.getNumRecords(); i++){
recData = new byte[rs.getRecordSize(i)];
len = rs.getRecord(i, recData, 0);
String des = new String(recData, 0, len);
mdes[i] = des ;
}
} // for loop
}catch (Exception e){}
if ( ln == 0) {
Alert error = new Alert ("Status","No Record found in "+table+ " Table",null, AlertType.INFO );
error.setTimeout(Alert.FOREVER);
}
}
Regards
Gopinath
|