Class TkmDBS
- java.lang.Object
-
- com.h2tcoin.takamakachain.db.embedded.TkmDBS
-
public class TkmDBS extends Object
- Author:
- giovanni.antino@h2tcoin.com
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cloneDatabase(int sourceEpoch, int sourceSlot, String sourceName, int destEpoch, int destSlot, String destName, boolean overwrite)
static void
createZeroDatabase()
Connection
getConnection()
static TkmDBS
i()
static boolean
isInitialized()
void
shutdownDatabase()
soft close then try to kill current databasevoid
switchConnection(Integer epoch, Integer slot, String dbName)
switch the connection to existing database
-
-
-
Method Detail
-
i
public static TkmDBS i()
-
isInitialized
public static boolean isInitialized()
- Returns:
- true if the database is current and can be used
-
createZeroDatabase
public static void createZeroDatabase() throws DatabaseDriverInitiaizzationException, DatabaseConnectionException, DatabasePathException
-
cloneDatabase
public void cloneDatabase(int sourceEpoch, int sourceSlot, String sourceName, int destEpoch, int destSlot, String destName, boolean overwrite) throws InvalidDatabaseParametersException, DatabaseOverwriteException, DatabasePathException, DatabaseNotFoundException, DatabaseDriverInitiaizzationException, DatabaseConnectionException
-
switchConnection
public void switchConnection(Integer epoch, Integer slot, String dbName) throws InvalidDatabaseStateException, InvalidDatabaseParametersException, DatabasePathException, DatabaseNotFoundException, DatabaseDriverInitiaizzationException, DatabaseConnectionException
switch the connection to existing database- Parameters:
epoch
-slot
-dbName
-- Throws:
InvalidDatabaseStateException
InvalidDatabaseParametersException
DatabasePathException
DatabaseNotFoundException
- target database does not existsDatabaseDriverInitiaizzationException
DatabaseConnectionException
-
getConnection
public Connection getConnection() throws DatabaseNotInitializedException, InvalidDatabaseStateException
-
shutdownDatabase
public void shutdownDatabase() throws DatabaseDriverInitiaizzationException, DatabaseConnectionException, InvalidDatabaseParametersException, DatabasePathException
soft close then try to kill current database
-
-