|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjnicli.DatabaseJNI
public class DatabaseJNI
Interface to database using Java native interface. This class should be used by applications accessing database locally
| Field Summary |
|---|
| Fields inherited from interface jnicli.Database |
|---|
AUTOCOMMIT, CLI_DETACH_COMMIT, CLI_DETACH_DEFAULT, CLI_DETACH_DESTROY_CONTEXT, CONCURRENT_READ, CONCURRENT_UPDATE, FOR_UPDATE, READ_ONLY, READ_WRITE |
| Constructor Summary | |
|---|---|
DatabaseJNI()
|
|
DatabaseJNI(boolean remote)
|
|
| Method Summary | |
|---|---|
void |
attach()
Attach thread to the database. |
void |
close()
Close database |
void |
commit()
Commit current transaction. |
int |
delete(java.lang.Class table,
java.lang.String condition)
Delete all objects from the table matching specified condition |
void |
detach(int flags)
Detach thread to the database. |
long |
getThreadContext()
|
long |
insert(java.lang.Object obj)
Insert new object in the database. |
void |
lock()
Lock database in exclusive mode. |
void |
open(int accessType,
java.lang.String databaseName,
java.lang.String databasePath,
long initSize,
int transactionCommitDelay)
Open database |
void |
rollback()
Commit current transaction Transaction is implicitly started when any database operation is perfromed. |
Cursor |
select(java.lang.Class table,
java.lang.String condition,
int flags)
Select objects from table matching condition |
void |
setThreadContext(long ctx)
|
void |
update(long oid,
java.lang.Object obj)
Update object with soecified OID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseJNI()
public DatabaseJNI(boolean remote)
| Method Detail |
|---|
public void open(int accessType,
java.lang.String databaseName,
java.lang.String databasePath,
long initSize,
int transactionCommitDelay)
Database
open in interface DatabaseaccessType - database access type: one of READ_ONLY, READ_WRITE, CONCURRENT_READ or CONCURRENT_UPDATEdatabaseName - database namedatabasePath - path to the database fileinitSize - initial size of databasetransactionCommitDelay - transaction commit delay (specify 0 to disable)public void close()
Database
close in interface Database
public Cursor select(java.lang.Class table,
java.lang.String condition,
int flags)
Database
select in interface Databasetable - class corresponding to the tablecondition - SubSQL condition (to select all records pass empty string)flags - combination of FOR_UPDATE and AUTOCOMMIT flags
public void update(long oid,
java.lang.Object obj)
Database
update in interface Databaseoid - OID of updated objectobj - updated objectpublic long insert(java.lang.Object obj)
Database
insert in interface Databaseobj - inserted object
public int delete(java.lang.Class table,
java.lang.String condition)
Database
delete in interface Databasetable - class corresponding to the tablecondition - SubSQL condition (to delete all records pass empty string)
public void commit()
Database
commit in interface Databasepublic void rollback()
Database
rollback in interface Databasepublic void lock()
Database
lock in interface Databasepublic void attach()
Database
attach in interface Databasepublic void detach(int flags)
Database
detach in interface Databaseflags - combination of CLI_DETACH_COMMIT and CLI_DETACH_DESTROY_CONTEXT flagspublic void setThreadContext(long ctx)
public long getThreadContext()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||