
public class ODatabasePool extends Object implements AutoCloseable
Example of usage with an OrientDB context:
OrientDB orientDb= new OrientDB("remote:localhost","root","password");
//...
ODatabasePool pool = new ODatabasePool(orientDb,"myDb","admin","adminpwd");
ODatabaseDocument session = pool.acquire();
//....
session.close();
pool.close();
orientDb.close();
Example of usage as simple access to a specific database without a context:
ODatabasePool pool = new ODatabasePool("remote:localhost/myDb","admin","adminpwd");
ODatabaseDocument session = pool.acquire();
//....
session.close();
pool.close();
Created by tglman on 08/02/17.
| Constructor and Description |
|---|
ODatabasePool(OrientDB environment,
String database,
String user,
String password)
Open a new database pool on a specific environment.
|
ODatabasePool(OrientDB environment,
String database,
String user,
String password,
OrientDBConfig configuration)
Open a new database pool on a specific environment, with a specific configuration for this pool.
|
ODatabasePool(String url,
String user,
String password)
Open a new database pool from a url, useful in case the application access to only a database or do not manipulate databases.
|
ODatabasePool(String url,
String user,
String password,
OrientDBConfig configuration)
Open a new database pool from a url and additional configuration, useful in case the application access to only a database or
do not manipulate databases.
|
ODatabasePool(String environment,
String database,
String user,
String password)
Open a new database pool from a environment and a database name, useful in case the application access to only a database or
do not manipulate databases.
|
ODatabasePool(String environment,
String database,
String user,
String password,
OrientDBConfig configuration)
Open a new database pool from a environment and a database name with a custom configuration, useful in case the application
access to only a database or do not manipulate databases.
|
public ODatabasePool(OrientDB environment, String database, String user, String password)
environment - the starting environment.database - the database nameuser - the database user for the current pool of databases.password - the password relative to the user namepublic ODatabasePool(OrientDB environment, String database, String user, String password, OrientDBConfig configuration)
environment - the starting environment.database - the database nameuser - the database user for the current pool of databases.password - the password relative to the user nameconfiguration - the configuration relative for the current pool.public ODatabasePool(String url, String user, String password)
url - the full url for a database, like "embedded:/full/path/to/database" or "remote:localhost/database"user - the database user for the current pool of databases.password - the password relative to the userpublic ODatabasePool(String url, String user, String password, OrientDBConfig configuration)
url - the full url for a database, like "embedded:/full/path/to/database" or "remote:localhost/database"user - the database user for the current pool of databases.password - the password relative to the userconfiguration - the configuration relative to the current pool.public ODatabasePool(String environment, String database, String user, String password)
environment - the url for an environemnt, like "embedded:/the/environment/path/" or "remote:localhost"database - the database for the current url.user - the database user for the current pool of databases.password - the password relative to the userpublic ODatabasePool(String environment, String database, String user, String password, OrientDBConfig configuration)
environment - the url for an environemnt, like "embedded:/the/environment/path/" or "remote:localhost"database - the database for the current url.user - the database user for the current pool of databases.password - the password relative to the userconfiguration - the configuration relative to the current pool.public ODatabaseSession acquire()
public void close()
close in interface AutoCloseableCopyright © 2009–2025 OrientDB. All rights reserved.