|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.db4o.Db4o
public class Db4o
factory class to start db4o database engines.
This class provides static methods to
- open single-user databases openFile(String)
- open db4o servers openServer(String, int)
- connect to db4o servers openClient(String, int, String, String)
- provide access to the global configuration context configure()
- print the version number of this db4o version main(String[])
ExtDb4o for extended functionality.
Constructor Summary | |
---|---|
Db4o()
|
Method Summary | |
---|---|
static Configuration |
cloneConfiguration()
Creates a clone of the global db4o Configuration . |
static Configuration |
configure()
returns the global db4o Configuration context
for the running JVM session. |
static void |
main(java.lang.String[] args)
prints the version name of this db4o version to System.out . |
static Configuration |
newConfiguration()
Creates a fresh Configuration instance. |
static ObjectContainer |
openClient(Configuration config,
java.lang.String hostName,
int port,
java.lang.String user,
java.lang.String password)
opens an ObjectContainer
client and connects it to the specified named server and port. |
static ObjectContainer |
openClient(java.lang.String hostName,
int port,
java.lang.String user,
java.lang.String password)
Operates just like openClient(Configuration, String, int, String, String) , but uses
the global db4o Configuration context. |
static ObjectContainer |
openFile(Configuration config,
java.lang.String databaseFileName)
opens an ObjectContainer
on the specified database file for local use. |
static ObjectContainer |
openFile(java.lang.String databaseFileName)
Operates just like openFile(Configuration, String) , but uses
the global db4o Configuration context. |
static ObjectServer |
openServer(Configuration config,
java.lang.String databaseFileName,
int port)
opens an ObjectServer
on the specified database file and port. |
static ObjectServer |
openServer(java.lang.String databaseFileName,
int port)
Operates just like openServer(Configuration, String, int) , but uses
the global db4o Configuration context. |
static java.lang.String |
version()
returns the version name of the used db4o version. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Db4o()
Method Detail |
---|
public static void main(java.lang.String[] args)
System.out
.
public static Configuration configure()
Configuration
context
for the running JVM session.
Configuration
can be overriden in each
ObjectContainer
.
configuration
contextpublic static Configuration newConfiguration()
Configuration
instance.
public static Configuration cloneConfiguration()
Configuration
.
public static ObjectContainer openClient(java.lang.String hostName, int port, java.lang.String user, java.lang.String password) throws java.io.IOException
openClient(Configuration, String, int, String, String)
, but uses
the global db4o Configuration
context.
opens an ObjectContainer
client and connects it to the specified named server and port.
allow access
for the specified user and password.
ObjectContainer
can be cast to
ExtClient
to use extended
ExtObjectContainer
and ExtClient
methods.
hostName
- the host nameport
- the port the server is usinguser
- the user namepassword
- the user password
ObjectContainer
java.io.IOException
ObjectServer.grantAccess(java.lang.String, java.lang.String)
public static ObjectContainer openClient(Configuration config, java.lang.String hostName, int port, java.lang.String user, java.lang.String password) throws java.io.IOException
ObjectContainer
client and connects it to the specified named server and port.
allow access
for the specified user and password.
ObjectContainer
can be cast to
ExtClient
to use extended
ExtObjectContainer
and ExtClient
methods.
config
- a custom Configuration
instance to be obtained via newConfiguration()
hostName
- the host nameport
- the port the server is usinguser
- the user namepassword
- the user password
ObjectContainer
java.io.IOException
ObjectServer.grantAccess(java.lang.String, java.lang.String)
public static final ObjectContainer openFile(java.lang.String databaseFileName) throws DatabaseFileLockedException
openFile(Configuration, String)
, but uses
the global db4o Configuration
context.
opens an ObjectContainer
on the specified database file for local use.
ObjectContainer
against the same file will result in
a DatabaseFileLockedException
.
databaseFileName
- an absolute or relative path to the database file
ObjectContainer
DatabaseFileLockedException
Configuration.readOnly(boolean)
,
Configuration.encrypt(boolean)
,
Configuration.password(java.lang.String)
public static final ObjectContainer openFile(Configuration config, java.lang.String databaseFileName) throws DatabaseFileLockedException
ObjectContainer
on the specified database file for local use.
ObjectContainer
against the same file will result in
a DatabaseFileLockedException
.
config
- a custom Configuration
instance to be obtained via newConfiguration()
databaseFileName
- an absolute or relative path to the database file
ObjectContainer
DatabaseFileLockedException
Configuration.readOnly(boolean)
,
Configuration.encrypt(boolean)
,
Configuration.password(java.lang.String)
public static final ObjectServer openServer(java.lang.String databaseFileName, int port) throws DatabaseFileLockedException
openServer(Configuration, String, int)
, but uses
the global db4o Configuration
context.
opens an ObjectServer
on the specified database file and port.
ObjectServer.openClient()
, specify '0' as the
port number.
databaseFileName
- an absolute or relative path to the database fileport
- the port to be used, or 0, if the server should not open a port,
because it will only be used with ObjectServer.openClient()
ObjectServer
listening
on the specified port.
DatabaseFileLockedException
Configuration.readOnly(boolean)
,
Configuration.encrypt(boolean)
,
Configuration.password(java.lang.String)
public static final ObjectServer openServer(Configuration config, java.lang.String databaseFileName, int port) throws DatabaseFileLockedException
ObjectServer
on the specified database file and port.
ObjectServer.openClient()
, specify '0' as the
port number.
config
- a custom Configuration
instance to be obtained via newConfiguration()
databaseFileName
- an absolute or relative path to the database fileport
- the port to be used, or 0, if the server should not open a port,
because it will only be used with ObjectServer.openClient()
ObjectServer
listening
on the specified port.
DatabaseFileLockedException
Configuration.readOnly(boolean)
,
Configuration.encrypt(boolean)
,
Configuration.password(java.lang.String)
public static final java.lang.String version()
String
.
|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |