|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eyedb.Object
org.eyedb.Instance
org.eyedb.Agregat
org.eyedb.Struct
org.eyedb.Database
public class Database
This class is used to open a database and to perform operations on it.
For instance :
Database db = new Database("mydatabase"); try { db.open(conn, Database.DBRead); } catch(Exception e) { System.err.println(e); System.exit(1); }
Field Summary | |
---|---|
static int |
DBRead
use the flag DBRead to open the database in ReadOnly mode |
static int |
DBReadAdmin
use the flag DBAdmin to open the database in ReadOnly Admin mode |
static int |
DBRSRead
use the flag DBSRead to open the database in ReadWrite mode |
static int |
DBRW
use the flag DBRW to open the database in ReadWrite mode |
static int |
DBRWAdmin
use the flag DBAdmin to open the database in ReadWrite Admin mode |
Fields inherited from class org.eyedb.Struct |
---|
idbclass |
Fields inherited from class org.eyedb.Object |
---|
CMTimeTrace, CompOidTrace, ContentsTrace, CTimeTrace, MTimeTrace, NativeTrace, PointerTrace |
Constructor Summary | |
---|---|
Database(int dbid)
constructs a database from a database identifier. |
|
Database(int dbid,
java.lang.String dbmfile)
constructs a database from a dbid and a DBMFILE. |
|
Database(java.lang.String dbname)
constructs a database from a name. |
|
Database(java.lang.String dbname,
java.lang.String dbmfile)
constructs a database from a name and a DBMFILE. |
Method Summary | |
---|---|
void |
close()
close the database |
Connection |
getConnection()
returns the connection associated with this database |
Datafile |
getDatafile(short id)
|
Datafile |
getDatafile(short id,
boolean fetch)
|
Datafile |
getDatafile(short id,
boolean fetch,
java.lang.String userauth,
java.lang.String passwdauth)
|
Datafile |
getDatafile(java.lang.String name)
|
Datafile |
getDatafile(java.lang.String name,
boolean fetch)
|
Datafile |
getDatafile(java.lang.String name,
boolean fetch,
java.lang.String userauth,
java.lang.String passwdauth)
|
Datafile[] |
getDatafiles()
|
Datafile[] |
getDatafiles(boolean fetch)
|
Datafile[] |
getDatafiles(boolean fetch,
java.lang.String userauth,
java.lang.String passwdauth)
|
Dataspace |
getDataspace(short id)
|
Dataspace |
getDataspace(short id,
boolean fetch)
|
Dataspace |
getDataspace(short id,
boolean fetch,
java.lang.String user,
java.lang.String passwd)
|
Dataspace |
getDataspace(java.lang.String name)
|
Dataspace |
getDataspace(java.lang.String name,
boolean fetch)
|
Dataspace |
getDataspace(java.lang.String name,
boolean fetch,
java.lang.String userauth,
java.lang.String passwdauth)
|
Dataspace[] |
getDataspaces()
|
Dataspace[] |
getDataspaces(boolean fetch)
|
Dataspace[] |
getDataspaces(boolean fetch,
java.lang.String user,
java.lang.String passwd)
|
int |
getDbid()
returns the database identifier |
java.lang.String |
getDBMFile()
returns the DBMFILE associated with this database |
Dataspace |
getDefaultDataspace()
|
TransactionParams |
getDefaultTransactionParams()
|
int |
getFlags()
returns the opening flags |
TransactionParams |
getGlobalDefaultTransactionParams()
|
DatabaseInfoDescription |
getInfo()
|
DatabaseInfoDescription |
getInfo(Connection conn,
java.lang.String userauth,
java.lang.String passwdauth)
|
DatabaseInfoDescription |
getInfo(java.lang.String userauth,
java.lang.String passwdauth)
|
java.lang.String |
getName()
returns the database name |
Class |
getObjectClass(Oid oid)
|
ObjectLocationArray |
getObjectsLocations(OidArray oid_arr)
|
Schema |
getSchema()
returns the schema associated with this database |
int |
getUid()
|
java.lang.String |
getUserAuth()
returns the user associated with this database |
int |
getVersion()
returns the database version |
boolean |
isInTransaction()
|
Object |
loadObject(Oid oid)
|
Object |
loadObject(Oid oid,
int lockmode,
RecMode rcm)
|
Object |
loadObject(Oid oid,
RecMode rcm)
|
Object |
loadObjectRealize(Oid oid,
int lockmode,
RecMode rcm)
load an object from its oid (Object IDentifier) and according to the recursive mode rcm |
void |
moveObjects(ObjectArray obj_array,
Dataspace dataspace)
|
void |
moveObjects(OidArray oid_arr,
Dataspace dataspace)
|
void |
open(Connection conn,
int flags)
open a database. |
void |
open(Connection conn,
int flags,
java.lang.String userauth,
java.lang.String passwdauth)
open a database. |
void |
removeObject(Oid oid)
|
void |
setDefaultDataspace(Dataspace dataspace)
|
void |
setDefaultTransactionParams(TransactionParams default_params)
|
static void |
setGlobalDefaultTransactionParams(TransactionParams default_params)
|
void |
transactionAbort()
aborts the current transaction |
void |
transactionBegin()
begins a transaction using Root.ReadWriteSharedTRMode as transaction mode and Root.WriteOnCommit as writing mode |
void |
transactionBegin(TransactionParams params)
begins a transaction using trmode transaction mode and Root.WriteOnCommit as writing mode |
void |
transactionCommit()
commits the current transaction |
Methods inherited from class org.eyedb.Instance |
---|
realize, traceRealize |
Methods inherited from class org.eyedb.Object |
---|
getClass, getCTime, getDatabase, getDataspace, getDataspace, getIDR, getIDRSize, getLocation, getMasterObject, getMTime, getOid, getRefCount, getUserData, isGRTObject, loadPerform, move, realize, remove, setClass, setDatabase, setDataspace, setIDR, setMasterObject, setOid, setUserData, store, store, trace, trace, trace, trace, tracePdata, userInitialize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DBRead
public static final int DBRW
public static final int DBRSRead
public static final int DBReadAdmin
public static final int DBRWAdmin
Constructor Detail |
---|
public Database(java.lang.String dbname)
dbname
- The database namepublic Database(int dbid)
dbid
- The database identifierpublic Database(java.lang.String dbname, java.lang.String dbmfile)
dbname
- The database namedbmfile
- The DBM (Database Manager) filepublic Database(int dbid, java.lang.String dbmfile)
dbid
- The database identifierdbmfile
- The DBM (Database Manager) fileMethod Detail |
---|
public void open(Connection conn, int flags, java.lang.String userauth, java.lang.String passwdauth) throws Exception
conn
- The Connectionflags
- The opening flags : DBRW or DBReaduserauth
- The User authenticationpasswdauth
- The Password authentication
DatabaseOpeningException
Exception
public void open(Connection conn, int flags) throws Exception
conn
- The Connectionflags
- The opening flags : DBRW or DBRead
DatabaseOpeningException
Exception
public void transactionBegin() throws Exception
None
-
TransactionException
Exception
Root.DefaultTRMode
,
Root.ReadWriteSharedTRMode
,
Root.WriteExclusiveTRMode
,
Root.ReadWriteExclusiveTRMode
,
Root.DefaultWRMode
,
Root.WriteOnCommit
,
Root.WriteImmediate
public void transactionBegin(TransactionParams params) throws Exception
None
-
TransactionException
Exception
Root.DefaultTRMode
,
Root.ReadWriteSharedTRMode
,
Root.WriteExclusiveTRMode
,
Root.ReadWriteExclusiveTRMode
,
Root.DefaultWRMode
,
Root.WriteOnCommit
,
Root.WriteImmediate
public void transactionCommit() throws Exception
None
-
TransactionException
- is thrown if no transaction
is in course
Exception
public void transactionAbort() throws Exception
None
-
TransactionException
- is thrown if no transaction
is in course
Exception
public boolean isInTransaction()
None
-
public void close() throws Exception
None
-
DatabaseClosingException
- is thrown is the database is not
opened
Exception
public Object loadObjectRealize(Oid oid, int lockmode, RecMode rcm) throws Exception
oid
- The OID of the object to loadrcm
- The Recursive Mode to be used
Exception
public Object loadObject(Oid oid, int lockmode, RecMode rcm) throws Exception
Exception
public Object loadObject(Oid oid, RecMode rcm) throws Exception
Exception
public Object loadObject(Oid oid) throws Exception
Exception
public void removeObject(Oid oid) throws Exception
Exception
public Schema getSchema()
public Connection getConnection()
public java.lang.String getName()
public int getDbid()
public int getVersion()
public int getFlags()
public java.lang.String getDBMFile()
public java.lang.String getUserAuth()
public int getUid()
public Class getObjectClass(Oid oid) throws Exception
Exception
public Datafile[] getDatafiles() throws Exception
Exception
public Datafile[] getDatafiles(boolean fetch) throws Exception
Exception
public Datafile[] getDatafiles(boolean fetch, java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public Datafile getDatafile(short id) throws Exception
Exception
public Datafile getDatafile(short id, boolean fetch) throws Exception
Exception
public Datafile getDatafile(short id, boolean fetch, java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public Datafile getDatafile(java.lang.String name) throws Exception
Exception
public Datafile getDatafile(java.lang.String name, boolean fetch) throws Exception
Exception
public Datafile getDatafile(java.lang.String name, boolean fetch, java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public void moveObjects(OidArray oid_arr, Dataspace dataspace) throws Exception
Exception
public void moveObjects(ObjectArray obj_array, Dataspace dataspace) throws Exception
Exception
public Dataspace[] getDataspaces() throws Exception
Exception
public Dataspace[] getDataspaces(boolean fetch) throws Exception
Exception
public Dataspace[] getDataspaces(boolean fetch, java.lang.String user, java.lang.String passwd) throws Exception
Exception
public Dataspace getDataspace(short id) throws Exception
Exception
public Dataspace getDataspace(short id, boolean fetch) throws Exception
Exception
public Dataspace getDataspace(short id, boolean fetch, java.lang.String user, java.lang.String passwd) throws Exception
Exception
public Dataspace getDataspace(java.lang.String name) throws Exception
Exception
public Dataspace getDataspace(java.lang.String name, boolean fetch) throws Exception
Exception
public Dataspace getDataspace(java.lang.String name, boolean fetch, java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public Dataspace getDefaultDataspace() throws Exception
Exception
public void setDefaultDataspace(Dataspace dataspace) throws Exception
Exception
public void setDefaultTransactionParams(TransactionParams default_params)
public TransactionParams getDefaultTransactionParams()
public static void setGlobalDefaultTransactionParams(TransactionParams default_params)
public TransactionParams getGlobalDefaultTransactionParams()
public DatabaseInfoDescription getInfo() throws Exception
Exception
public DatabaseInfoDescription getInfo(Connection conn, java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public DatabaseInfoDescription getInfo(java.lang.String userauth, java.lang.String passwdauth) throws Exception
Exception
public ObjectLocationArray getObjectsLocations(OidArray oid_arr) throws Exception
Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |