Struct hdbconnect::Connection [−][src]
pub struct Connection { /* fields omitted */ }
Connection object.
The connection to the database.
Example
use hdbconnect::{Connection, IntoConnectParams}; let params = "hdbsql://my_user:my_passwd@the_host:2222" .into_connect_params() .unwrap(); let mut connection = Connection::new(params).unwrap();
Methods
impl Connection
[src]
impl Connection
pub fn new(params: ConnectParams) -> HdbResult<Connection>
[src]
pub fn new(params: ConnectParams) -> HdbResult<Connection>
Factory method for authenticated connections.
pub fn set_auto_commit(&mut self, ac: bool) -> HdbResult<()>
[src]
pub fn set_auto_commit(&mut self, ac: bool) -> HdbResult<()>
Sets the connection's auto-commit behavior for future calls.
pub fn is_auto_commit(&self) -> HdbResult<bool>
[src]
pub fn is_auto_commit(&self) -> HdbResult<bool>
Returns the connection's auto-commit behavior.
pub fn set_fetch_size(&mut self, fetch_size: u32) -> HdbResult<()>
[src]
pub fn set_fetch_size(&mut self, fetch_size: u32) -> HdbResult<()>
Configures the connection's fetch size for future calls.
pub fn get_lob_read_length(&self) -> HdbResult<i32>
[src]
pub fn get_lob_read_length(&self) -> HdbResult<i32>
Configures the connection's lob read length for future calls.
pub fn set_lob_read_length(&mut self, lob_read_length: i32) -> HdbResult<()>
[src]
pub fn set_lob_read_length(&mut self, lob_read_length: i32) -> HdbResult<()>
Configures the connection's lob read length for future calls.
pub fn get_server_resource_consumption_info(
&self
) -> HdbResult<ServerResourceConsumptionInfo>
[src]
pub fn get_server_resource_consumption_info(
&self
) -> HdbResult<ServerResourceConsumptionInfo>
pub fn get_call_count(&self) -> HdbResult<i32>
[src]
pub fn get_call_count(&self) -> HdbResult<i32>
Returns the number of roundtrips to the database that have been done through this connection.
pub fn set_client_info(
&self,
application: &str,
application_version: &str,
application_source: &str,
application_user: &str
) -> HdbResult<()>
[src]
pub fn set_client_info(
&self,
application: &str,
application_version: &str,
application_source: &str,
application_user: &str
) -> HdbResult<()>
Sets client information into session variables on the server.
Example:
connection.set_client_info( "MyApp", "5.3.23", "update_customer.rs", "K2209657" )?;
pub fn statement(&mut self, stmt: &str) -> HdbResult<HdbResponse>
[src]
pub fn statement(&mut self, stmt: &str) -> HdbResult<HdbResponse>
Executes a statement on the database.
This generic method can handle all kinds of calls, and thus has the most complex return type. In many cases it will be more appropriate to use one of the methods query(), dml(), exec(), which have the adequate simple result type you usually want.
pub fn query(&mut self, stmt: &str) -> HdbResult<ResultSet>
[src]
pub fn query(&mut self, stmt: &str) -> HdbResult<ResultSet>
Executes a statement and expects a single ResultSet.
pub fn dml(&mut self, stmt: &str) -> HdbResult<usize>
[src]
pub fn dml(&mut self, stmt: &str) -> HdbResult<usize>
Executes a statement and expects a single number of affected rows.
pub fn exec(&mut self, stmt: &str) -> HdbResult<()>
[src]
pub fn exec(&mut self, stmt: &str) -> HdbResult<()>
Executes a statement and expects a plain success.
pub fn prepare(&self, stmt: &str) -> HdbResult<PreparedStatement>
[src]
pub fn prepare(&self, stmt: &str) -> HdbResult<PreparedStatement>
Prepares a statement and returns a handle to it. Note that the handle keeps using the same connection.
pub fn commit(&mut self) -> HdbResult<()>
[src]
pub fn commit(&mut self) -> HdbResult<()>
Commits the current transaction.
pub fn rollback(&mut self) -> HdbResult<()>
[src]
pub fn rollback(&mut self) -> HdbResult<()>
Rolls back the current transaction.
pub fn spawn(&self) -> HdbResult<Connection>
[src]
pub fn spawn(&self) -> HdbResult<Connection>
Creates a new connection object with the same settings and authentication.
pub fn multiple_statements_ignore_err<S: AsRef<str>>(&mut self, stmts: Vec<S>)
[src]
pub fn multiple_statements_ignore_err<S: AsRef<str>>(&mut self, stmts: Vec<S>)
Utility method to fire a couple of statements, ignoring errors and return values
pub fn multiple_statements<S: AsRef<str>>(
&mut self,
stmts: Vec<S>
) -> HdbResult<()>
[src]
pub fn multiple_statements<S: AsRef<str>>(
&mut self,
stmts: Vec<S>
) -> HdbResult<()>
Utility method to fire a couple of statements, ignoring their return values; the method returns with the first error, or with ()
pub fn pop_warnings(&self) -> HdbResult<Option<Vec<ServerError>>>
[src]
pub fn pop_warnings(&self) -> HdbResult<Option<Vec<ServerError>>>
Returns warnings that were returned from the server since the last call to this method.
pub fn get_resource_manager(&self) -> Box<ResourceManager>
[src]
pub fn get_resource_manager(&self) -> Box<ResourceManager>
Returns an implementation of dist_tx::rm::ResourceManager
that is
based on this connection.
pub fn execute_with_debuginfo(
&mut self,
stmt: &str,
module: &str,
line: i32
) -> HdbResult<HdbResponse>
[src]
pub fn execute_with_debuginfo(
&mut self,
stmt: &str,
module: &str,
line: i32
) -> HdbResult<HdbResponse>
Tools like debuggers can provide additional information while stepping through a source
Trait Implementations
impl Debug for Connection
[src]
impl Debug for Connection
Auto Trait Implementations
impl Send for Connection
impl Send for Connection
impl Sync for Connection
impl Sync for Connection