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]
fn new(params: ConnectParams) -> HdbResult<Connection>
[src]
Factory method for authenticated connections.
fn get_major_and_minor_product_version(&self) -> (i8, i16)
[src]
Returns the HANA's product version info.
fn set_auto_commit(&mut self, ac: bool)
[src]
Sets the connection's auto-commit behavior for future calls.
fn set_fetch_size(&mut self, fetch_size: u32) -> HdbResult<()>
[src]
Configures the connection's fetch size for future calls.
fn get_lob_read_length(&self) -> HdbResult<i32>
[src]
Configures the connection's lob read length for future calls.
fn set_lob_read_length(&mut self, lob_read_length: i32) -> HdbResult<()>
[src]
Configures the connection's lob read length for future calls.
fn get_call_count(&self) -> HdbResult<i32>
[src]
Returns the number of roundtrips to the database that have been done through this connection.
fn statement(&mut self, stmt: &str) -> HdbResult<HdbResponse>
[src]
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.
fn query(&mut self, stmt: &str) -> HdbResult<ResultSet>
[src]
Executes a statement and expects a single ResultSet.
fn dml(&mut self, stmt: &str) -> HdbResult<usize>
[src]
Executes a statement and expects a single number of affected rows.
fn exec(&mut self, stmt: &str) -> HdbResult<()>
[src]
Executes a statement and expects a plain success.
fn prepare(&self, stmt: &str) -> HdbResult<PreparedStatement>
[src]
Prepares a statement and returns a handle to it. Note that the handle keeps using the same connection.
fn commit(&mut self) -> HdbResult<()>
[src]
Commits the current transaction.
fn rollback(&mut self) -> HdbResult<()>
[src]
Rolls back the current transaction.
fn spawn(&self) -> HdbResult<Connection>
[src]
Creates a new connection object with the same settings and authentication.
fn multiple_statements_ignore_err(&mut self, stmts: Vec<&str>)
[src]
Utility method to fire a couple of statements, ignoring errors and return values
fn multiple_statements(&mut self, stmts: Vec<&str>) -> HdbResult<()>
[src]
Utility method to fire a couple of statements, ignoring their return values; the method returns with the first error, or with ()