Struct r2d2_oracle::OracleConnectionManager [−][src]
pub struct OracleConnectionManager { /* fields omitted */ }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
impl OracleConnectionManager[src]
impl OracleConnectionManager[src]pub fn new(
    username: &str, 
    password: &str, 
    connect_string: &str
) -> OracleConnectionManager[src]
username: &str,
password: &str,
connect_string: &str
) -> OracleConnectionManager
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");
pub fn from_connector(connector: Connector) -> OracleConnectionManager[src]
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
impl ManageConnection for OracleConnectionManager[src]
impl ManageConnection for OracleConnectionManager[src]type Connection = Connection
The connection type this manager deals with.
type Error = Error
The error type returned by Connections.
fn connect(&self) -> Result<Connection, Error>[src]
fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>[src]
fn has_broken(&self, conn: &mut Connection) -> bool[src]
Auto Trait Implementations
impl RefUnwindSafe for OracleConnectionManager
impl RefUnwindSafe for OracleConnectionManagerimpl Send for OracleConnectionManager
impl Send for OracleConnectionManagerimpl Sync for OracleConnectionManager
impl Sync for OracleConnectionManagerimpl Unpin for OracleConnectionManager
impl Unpin for OracleConnectionManagerimpl UnwindSafe for OracleConnectionManager
impl UnwindSafe for OracleConnectionManager