public final class MonetDBEmbeddedDatabase extends Object
Modifier and Type | Method and Description |
---|---|
static MonetDBEmbeddedConnection |
createConnection()
Creates a connection on the database, set on the default schema.
|
static JDBCEmbeddedConnection |
createJDBCEmbeddedConnection(String directory)
Creates a JDBC embedded connection on the database, set on the default schema.
|
protected void |
finalize()
Overriding the finalize method to shut down the database.
|
static String |
getDatabaseDirectory()
Gets the database's farm directory.
|
static int |
getNumberOfConnections()
Gets the current total number of connections to the database.
|
static boolean |
isDatabaseRunning()
Check if the database is still running or not.
|
static boolean |
isDatabaseRunningInMemory()
Check if the database is running in-memory.
|
static boolean |
isSequentialFlagSet()
Checks if the Sequential Flag was set while creating the database.
|
static boolean |
isSilentFlagSet()
Checks if the Silent Flag was set while creating the database.
|
static void |
removeConnection(MonetDBEmbeddedConnection con,
boolean toShutDown)
Removes a connection from the database.
|
static void |
startDatabase(String dbDirectory)
Starts a MonetDB database on the given farm.
|
static void |
startDatabase(String dbDirectory,
boolean silentFlag,
boolean sequentialFlag)
Starts a MonetDB database on the given farm with debugging parameters if desired.
|
static void |
stopDatabase()
Stops the database.
|
public static boolean isDatabaseRunning()
public static boolean isDatabaseRunningInMemory() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not runningpublic static void startDatabase(String dbDirectory, boolean silentFlag, boolean sequentialFlag) throws MonetDBEmbeddedException
dbDirectory
- The full path of the farmsilentFlag
- A boolean if silent mode will be turned on or notsequentialFlag
- A boolean indicating if the sequential pipeline will be set or notMonetDBEmbeddedException
- If the JNI library has not been loaded yet or an error in the database occurredpublic static void startDatabase(String dbDirectory) throws MonetDBEmbeddedException
dbDirectory
- The full path of the farmMonetDBEmbeddedException
- If the JNI library has not been loaded yet or an error in the database occurredpublic static String getDatabaseDirectory() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not runningpublic static int getNumberOfConnections() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not runningpublic static boolean isSilentFlagSet() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not runningpublic static boolean isSequentialFlagSet() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not runningpublic static void stopDatabase() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not running or an error in the database occurredpublic static MonetDBEmbeddedConnection createConnection() throws MonetDBEmbeddedException
MonetDBEmbeddedException
- If the database is not running or an error in the database occurredpublic static JDBCEmbeddedConnection createJDBCEmbeddedConnection(String directory) throws MonetDBEmbeddedException
directory
- The desired directory for the JDBC embedded connection.MonetDBEmbeddedException
- If the database is not running or an error in the database occurredpublic static void removeConnection(MonetDBEmbeddedConnection con, boolean toShutDown)
con
- The connection to removetoShutDown
- If true, if there are no more connections in the database after the removal, the database is
shut down.protected void finalize() throws Throwable
Copyright © 2018. All rights reserved.