Witam
Tak więc, nowy dzień, nowe problemy. Czy jest jakiś sposób, aby poznać indeksy rekordów? Próbowałem tego:
There is no method to get the record ID. To work around this, every time you create a new record, add its record ID to a vector like this:
Vector recordIDs = new Vector();
int lastID = 1;
//Add a record....parameters are missing here
db.addRecord();
// Now add the ID to the vector
recordIDs.addElement(new Integer(++lastID));
ze strony oracla, ale bez skutku. do każdego rekordu przypisuje mi wartość '1'.
Oto mój kod na zapis rekordu.
public void writeRecord(String str, RecordStore type) throws RecordStoreException {
byte[] rec = str.getBytes();
int lastID = 1;
System.out.println("Rec Length "+rec.length);
try {
type.addRecord(rec, 0, rec.length);
recordIDs.addElement(new Integer(++lastID));
} catch (Exception e) {
System.out.println("Write record error: " + e);
}
}