Recuperare i dati

Listato 9. Recuperare i dati

public String readString()
{
    String s = "";
    byte[] b = new byte[100];
    RecordStore rs = openRS();
    if (rs != null)
    {
        try
        {
            rs.getRecord(1, b, 0);
            s = new String(b);
            rs.closeRecordStore();
        }
        catch (RecordStoreNotOpenException e)
        {
            e.printStackTrace();
        }
        catch (InvalidRecordIDException e)
        {
            e.printStackTrace();
        }
        catch (RecordStoreException e)
        {
            e.printStackTrace();
        }
    }
    return s;
}