[−][src]Struct oracle::Connector
Builder data type to create Connection.
When a connection can be established only with username, password and connect string, use Connection.connect instead.
Implementations
impl Connector
[src]
pub fn new<U, P, C>(username: U, password: P, connect_string: C) -> Connector where
U: Into<String>,
P: Into<String>,
C: Into<String>,
[src]
U: Into<String>,
P: Into<String>,
C: Into<String>,
Create a connector
pub fn privilege(&mut self, privilege: Privilege) -> &mut Connector
[src]
Examples
// connect system/manager as sysdba let conn = Connector::new("system", "manager", "") .privilege(Privilege::Sysdba) .connect()?;
pub fn external_auth(&mut self, b: bool) -> &mut Connector
[src]
Uses external authentication such as OS authentication.
Examples
let conn = Connector::new("", "", "") .external_auth(true) .connect()?;
pub fn prelim_auth(&mut self, b: bool) -> &mut Connector
[src]
Sets prelim auth mode to connect to an idle instance.
pub fn new_password<P>(&mut self, password: P) -> &mut Connector where
P: Into<String>,
[src]
P: Into<String>,
Sets new password during establishing a connection.
When a password is expired, you cannot connect to the user. A new password must be set by other user or set during establishing a connection.
Examples
Connect to user scott
with password tiger
. If the password
is expired, set a new password jaguar
.
let conn = match Connection::connect("scott", "tiger", "") { Ok(conn) => conn, Err(Error::OciError(ref dberr)) if dberr.code() == 28001 => { // ORA-28001: the password has expired Connector::new("scott", "tiger", "") .new_password("jaguar") .connect()? }, Err(err) => panic!(err.to_string()), };
pub fn purity(&mut self, purity: Purity) -> &mut Connector
[src]
Sets session purity specifying whether an application can reuse a pooled session (Purity::Self_
) or must use a new session (Purity::New
) from DRCP pooled sessions.
pub fn connection_class<S>(&mut self, connection_class: S) -> &mut Connector where
S: Into<String>,
[src]
S: Into<String>,
pub fn app_context<T1, T2, T3>(
&mut self,
namespace: T1,
name: T2,
value: T3
) -> &mut Connector where
T1: Into<String>,
T2: Into<String>,
T3: Into<String>,
[src]
&mut self,
namespace: T1,
name: T2,
value: T3
) -> &mut Connector where
T1: Into<String>,
T2: Into<String>,
T3: Into<String>,
Appends an application context.
See Oracle manual
This is same with DBMS_SESSION.SET_CONTEXT but this can set application contexts before a connection is established.
Examples
let conn = Connector::new("scott", "tiger", "") .app_context("CLIENTCONTEXT", "foo", "bar") .app_context("CLIENTCONTEXT", "baz", "qux") .connect()?; let val = conn.query_row_as::<String>("select sys_context('CLIENTCONTEXT', 'foo') from dual", &[])?; assert_eq!(val, "bar"); let val = conn.query_row_as::<String>("select sys_context('CLIENTCONTEXT', 'baz') from dual", &[])?; assert_eq!(val, "qux");
pub fn tag<S>(&mut self, tag: S) -> &mut Connector where
S: Into<String>,
[src]
S: Into<String>,
Reserved for when connection pooling is supported.
pub fn match_any_tag(&mut self, b: bool) -> &mut Connector
[src]
Reserved for when connection pooling is supported.
pub fn events(&mut self, b: bool) -> &mut Connector
[src]
Reserved for when advanced queuing (AQ) or continuous query notification (CQN) is supported.
pub fn edition<S>(&mut self, edition: S) -> &mut Connector where
S: Into<String>,
[src]
S: Into<String>,
Specifies edition of Edition-Based Redefinition.
pub fn driver_name<S>(&mut self, driver_name: S) -> &mut Connector where
S: Into<String>,
[src]
S: Into<String>,
Sets the driver name displayed in V$SESSION_CONNECT_INFO.CLIENT_DRIVER.
The default value is "rust-oracle : version number". Only the first 8 chracters "rust-ora" are displayed when the Oracle server version is lower than 12.0.1.2.
pub fn connect(&self) -> Result<Connection>
[src]
Connect an Oracle server using specified parameters
Trait Implementations
impl Clone for Connector
[src]
impl Debug for Connector
[src]
impl PartialEq<Connector> for Connector
[src]
impl StructuralPartialEq for Connector
[src]
Auto Trait Implementations
impl RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl UnwindSafe for Connector
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,