Opening a database using Java

Use the getDatabase method of Session or the openDatabase method of DbDirectory to open a specified database.

Use getDatabase(null, null) to instantiate an empty Database object.

Use the CurrentDatabase property of AgentContext to open the current database, if your program is an agent.


  • openDatabaseByReplicaID of DbDirectory or openByReplicaID of Database opens a database whose server and replica ID are known. You can obtain the replica ID from a database that is already open with the ReplicaID property of Database.

  • openDatabaseIfModified of DbDirectory or openIfModified of Database opens a database only if it was modified after a specified date.

  • openWithFailover of Database opens a database on a server and fails over to another server if the requested server is in a cluster.

  • openMailDatabase of DbDirectory opens the user's mail database.
  • getURLDatabase of Session opens the default Web Navigator database.

Use the open method of Database to open a database whose object you set, for example, with getFirstDatabase, getNextDatabase, or getAddressBooks. You can access a subset of the Database methods on a closed database, but must explicitly open the database to access all methods. See isOpen for details.

The AddressBooks property of Session accesses the Domino® Directories and Personal Address Books available to the current session. The isPrivateAddressBook and isPublicAddressBook properties of Database distinguish between Domino® Directories and Private Address Books.

For remote sessions only, the resolve method of Session returns the Database, View, Form, Document, or Agent object that a URL addresses.

Databases can be accessed through the Parent or ParentDatabase property of objects that the database contains.