Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






getDatabase method

Creates a Database object that represents the database located at the server and file name you specify, and opens the database, if possible.

Defined in

Session

Syntax

public Database getDatabase(String server, String db)

throws NotesException
public Database getDatabase(String server, String db, boolean createonfail)

throws NotesException

Parameters

String server

The name of the server on which the database resides. Use null to indicate the session's environment, for example, the current computer. Must be null for remote (IIOP) operations.

String db

The file name and location of the database within the Domino data directory. Use a full path name if the database is not within the Domino data directory.

boolean createonfail

If true or omitted, creates a Database object even if the specified database cannot be opened. If false, returns null if the database cannot be opened.

Return value

Database

A Database object that can be used to access the database you have specified, or null if the database cannot be opened and createonfail is false. If the database cannot be opened and createonfail is true or omitted, isOpen is false for the Database object.

Usage

An error is returned if the user does not have access rights to the database or server.

A Java application running on the same machine as a Domino server cannot open a local database from a local session. Use a remote (IIOP) session to access the database.

See the Database class for additional descriptions and examples.

Language cross-reference

GetDatabase method in LotusScript NotesSession class

FileOpenDatabase @command in formula language

See examples

Examples: getDatabase method
Related topics
Locating a database on a server or the local directory




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009