OServer - openDatabase()

This method opens a database on the OrientDB Server.

Opening Databases

In order to operate on databases on a given OServer instance, you first need to open the database. Databases have separate login credentials from the OrientDB Server.

Syntax

There are several methods available, depending on which arguments you want to use in opening the given database and what you would like the method to return.

public ODatabase<T> OServer().openDatabase(String iDbURL,
		OToken iToken)

public ODatabase<T> OServer().openDatabase(String iDbURL,
		String user, String passwd)

public ODatabase<T> OServer().openDatabase(String iDbURL,
		String user, String passwd, ONetworkProtocolData data)

public ODatabaseDocumentTx OServer().openDatabase(String iDbURL,
		String user, String passwd, ONetworkProtocolData data,
		Boolean iBypassAccess)

public ODatabaseDocumentTx OServer().openDatabase(ODatabaseDocumentTx database,
		String user, String passwd, ONetworkProtocolData data,
		Boolean iBypassAccess)
ArgumentTypeDescription
iDbURLjava.lang.StringDefines the URL to the database.
userjava.lang.StringDefines the user to open the database.
passwdjava.lang.StringDefines the password for the user.
dataONetworkProtocolDataDefines the network protocol for the connection.
iBypassAccessjava.lang.BooleanDefines whether to bypass authentication in opening the database.
databaseODatabaseDocumentDefines the database to open.

Return Value

This method returns an ODatabase<T> value, where T is a generic for any OrientDB database types.

  • ODatabaseDocumentTx
  • OrientGraph
  • OObjectDatabaseTx