Database (Java)

Represents a Notes® database.

Syntax

public class Database extends Base

Containment

Contained by: AgentContext, DbDirectory, and Session

Can contain: ACL, Agent, DateTime, Document, DocumentCollection, Form, Outline, Replication, View

Properties

ACL through getACL

ACLActivityLog through getACLActivityLog

Agents through getAgents

AllDocuments through getAllDocuments

Categories through getCategories and setCategories

Created through getCreated

CurrentAccessLevel through getCurrentAccessLevel

DesignTemplateName through getDesignTemplateName

FileFormat through getFileFormat

FileName through getFileName

FilePath through getFilePath

FolderReferencesEnabled through getFolderReferences and setFolderReferences

Forms through getForms

FTIndexFrequency through getFTIndexFrequency and setFTIndexFrequency

HttpURL through getHttpURL

IsDelayUpdates through isDelayUpdates and setDelayUpdates

IsClusterReplication through isClusterReplication and setClusterReplication

IsConfigurationDirectory through isConfigurationDirectory

IsCurrentAccessPublicReader through isCurrentAccessPublicReader

IsCurrentAccessPublicWriter through isCurrentAccessPublicReader

IsDesignLockingEnabled through isDesignLockingEnabled and setDesignLockingEnabled

IsDirectoryCatalog through isDirectoryyCatalog

IsDocumentLockingEnabled through isDocumentLockingEnabled and setDocumentLockingEnabled

IsFTIndexed through isFTIndexed

IsInMultiDbIndexing through isInMultiDbIndexing and setInMultiDbIndexing

IsInService through isInService and setInService

IsLink through isLink

IsMultiDbSearch through isMultiDbSearch

IsOpen through isOpen

IsPendingDelete through isPendingDelete

IsPrivateAddressBook through isPrivateAddressBook

IsPublicAddressBook through isPublicAddressBook

LastFixup through getLastFixup

LastFTIndexed through getLastFTIndexed

LastModified through getLastModified

LimitRevisions through getLimitRevisions and setLimitRevisions

LimitUpdatedBy through getLimitUpdatedBy and setLimitUpdatedBy

ListInDbCatalog through getListInDbCatalog and setListInDbCatalog

Managers through getManagers

MaxSize through getMaxSize

NotesURL through getHttpURL

Parent through getParent

PercentUsed through getPercentUsed

ReplicaID through getReplicaID

ReplicationInfo through getReplicationInfo

Server through getServer

Size through getSize

SizeQuota through getSizeQuota and setSizeQuota

SizeWarning through getSizeWarning and setSizeWarning

TemplateName through getTemplateName

Title through getTitle and setTitle

Type through getType

UndeleteExpireTime through getUndeleteExpireTime and setUndeleteExpireTime

Views through getViews

Methods

compact

compactWithOptions

createCopy

createDocument

createFromTemplate

createFTIndex

createNoteCollection

createOutline

createReplica

createView

enableFolder

fixup

FTDomainSearch

FTSearch

FTSearchRange

getAgent

getAllReadDocuments method

getAllUnreadDocuments method

getDocumentByID

getDocumentByUNID

getDocumentByURL

getForm

getModifiedDocuments

getModifiedDocumentsWithOptions

getOption

getOutline

getProfileDocCollection

getProfileDocument

getURL

getURLHeaderInfo

getView

grantAccess

markForDelete

open

openByReplicaID

openIfModified

openWithFailover

queryAccess

queryAccessPrivileges

queryAccessRoles

recycle

remove

removeFTIndex

replicate

revokeAccess

search

setOption

setUserIDForDecrypt

sign

toString

updateFTIndex

Creation and access

There are several ways you can use the Database class to access existing databases and to create new ones.

  • To access the current database if you are running as an agent, use getCurrentDatabase in AgentContext.
  • To access an existing database when you know its server and file name, use getDatabase in Session.
  • To access an existing database when you know its server and replica ID, use openDatabaseByReplicaID in DbDirectory.
  • To locate an existing database when you know its server but not its file name, use the DbDirectory class.
  • To access the current user's mail database, use openMailDatabase in DbDirectory.
  • To open the default Web Navigator database, use getURLDatabase in Session.
  • To access the available Domino® Directories and Personal Address Books, use getAddressBooks in Session.
  • To test for the existence of a database with a specific server and file name before accessing it, use openDatabase or openDatabaseIfModified in DbDirectory.
  • To create a new database from an existing database, use createCopy, createFromTemplate, or createReplica.
  • To create a new database from scratch, use createDatabase in DbDirectory.
  • To access a database when you have a contained object such as View, Document, DocumentCollection, ACL, or Agent, use the appropriate Parent (or ParentDatabase) property.

Usage

A database must be open before you can use all the properties and methods in the corresponding Database object. In most cases, the class library automatically opens a database for you. But see isOpen for the exceptions.

Access levels

Notes® throws an exception when you attempt to perform an operation for which the user does not have appropriate access. The properties and methods that you can successfully use on a Database object are determined by these factors:

  • The user's access level to the database, as determined by the database access control list. The ACL determines if the user can open a database, add documents to it, remove documents from it, modify the ACL, and so on.
  • The user's access level to the server on which the database resides, as determined by the Server document in the Domino® Directory.

Example