copyDatabase

fun copyDatabase(sourceDB: Path, dupName: String, directory: Path)

Duplicates the database into a new database with the supplied name and directory. Assumes that the source database has no active connections and performs a file system copy

Parameters

sourceDB

the path to the database that needs duplicating

dupName

the name of the duplicate database

directory

the directory to place the database in


fun copyDatabase(ds: DataSource, sourceDB: Path, dupName: String, directory: Path)

Uses an active database connection and derby system commands to freeze the database, uses system OS commands to copy the database, and then unfreezes the database. The duplicate name and directory path must not already exist

Parameters

ds

a DataSource to the embedded derby database, obviously it must point to the derby database

sourceDB

the path to the source database

dupName

the name of the duplicate database, obviously it must reference the same database that is referenced by the DataSource

directory

the directory to place the database in

Throws

thrown if the derby commands fail

thrown if the system file copy commands fail