|
Palm API Beta 2 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.kjava.Database
This class serves as an interface to the PalmOS database manager. It allows the user to create and access PalmOS databases from KJava.
Field Summary | |
static int |
ENDOFDATABASE
End of database (last record indicator). |
static int |
READONLY
Read-only mode. |
static int |
READWRITE
Read and write mode. |
static int |
WRITEONLY
Write-only mode. |
Constructor Summary | |
Database(int typeID,
int creatorID,
int mode)
Open a database. |
Method Summary | |
boolean |
addRecord(byte[] data)
Add a new record to the end of the database. |
void |
close()
Close the current database. |
static boolean |
create(int cardNo,
java.lang.String name,
int creatorID,
int typeID,
boolean resDB)
Create a new database. |
boolean |
deleteRecord(int recordNumber)
Delete an existing record. |
int |
getNumberOfRecords()
Get the number of records in the database. |
byte[] |
getRecord(int recordNumber)
Read a database record into a Java byte array object. |
boolean |
isOpen()
Check if the database is open. |
int |
readRecordToBuffer(int recordNumber,
int readOffset,
int length,
byte[] buffer,
int writeOffset)
Read record to a pre-allocated buffer instead of allocating a new bytearray each time. |
boolean |
setRecord(int recordNumber,
byte[] data)
Set the contents of a PalmOS database record. |
int |
writeRecordFromBuffer(int recordNumber,
int writeOffset,
int length,
byte[] buffer,
int readOffset)
Set the contents of a database record. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int READONLY
public static final int WRITEONLY
public static final int READWRITE
public static final int ENDOFDATABASE
Constructor Detail |
public Database(int typeID, int creatorID, int mode)
Method Detail |
public static boolean create(int cardNo, java.lang.String name, int creatorID, int typeID, boolean resDB)
public boolean isOpen()
public int getNumberOfRecords()
public byte[] getRecord(int recordNumber)
public boolean setRecord(int recordNumber, byte[] data)
public boolean addRecord(byte[] data)
public boolean deleteRecord(int recordNumber)
public int readRecordToBuffer(int recordNumber, int readOffset, int length, byte[] buffer, int writeOffset)
public int writeRecordFromBuffer(int recordNumber, int writeOffset, int length, byte[] buffer, int readOffset)
public void close()
|
Submit a bug or feature The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |