pub struct OracleConnectionManager { /* private fields */ }
Expand description

An r2d2::ManageConnection for oracle::Connections.

Example

use std::thread;
use r2d2_oracle::OracleConnectionManager;

let manager = OracleConnectionManager::new("user", "password", "localhost");
let pool = r2d2::Pool::builder()
     .max_size(15)
     .build(manager)
     .unwrap();

for _ in 0..20 {
    let pool = pool.clone();
    thread::spawn(move || {
        let conn = pool.get().unwrap();
        // use the connection
        // it will be returned to the pool when it falls out of scope.
    });
}

Implementations§

Initialise the connection manager with the data needed to create new connections. Refer to the documentation of oracle::Connection for further details on the parameters.

Example
let manager = OracleConnectionManager::new("user", "password", "localhost");

Initialise the connection manager with the data needed to create new connections using oracle::Connector. This allows setting additional connection data.

If a connection can be established only with a username, password and connect string, use new instead.

Example
// connect system/manager as sysdba
let mut connector = oracle::Connector::new("system", "manager", "");
connector.privilege(oracle::Privilege::Sysdba);
let manager = OracleConnectionManager::from_connector(connector);

Trait Implementations§

Formats the value using the given formatter. Read more
The connection type this manager deals with.
The error type returned by Connections.
Attempts to create a new connection.
Determines if the connection is still connected to the database. Read more
Quickly determines if the connection is no longer usable. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.