createCopy (Database - Java)

Creates an empty copy of the current database.

Defined in

Database

Syntax

public Database createCopy(String server, String dbfile)
    throws NotesException
public Database createCopy(String server, String dbfile, int maxsize)
    throws NotesException

Parameters

String server

The name of the server where the new database resides. Specify null or an empty string ("") to create a local copy.

String dbfile

The file name of the new copy.

int maxsize
Note: This parameter is new with Release 5.

The maximum size (in gigabytes) that you would like to assign to the new database. This parameter applies only to Release 4 databases or those created on a server that has not been upgraded to Release 5. Entering an integer greater than 4 generates a run-time error.

Return value


Database

The new copy.

Usage

If a database with the specified file name already exists, an exception is thrown.

The copy contains the design elements of the current database, an identical access control list, and an identical title. It does not contain any documents.

The copy is not a replica.

Programs using remote (IIOP) calls to a server can't create or access databases on other servers. In these cases, the server parameter must correspond to the server the program is running on. There are two ways to do this:

  • Use null or an empty string ("") to indicate the current computer. This is the safer method.
  • Make sure the name of the server that the program runs on matches the name of server.

Programs running on a workstation can access several different servers in a single program.

The ACL of the original database gets copied to the new database, but you may want to modify the copy's ACL. For example, you may want Manager access to the copy for yourself even if you're not a manager of the original. Use the methods grantAccess and revokeAccess to modify the copy's ACL.

Example