Struct odbc_api::handles::Connection [−][src]
pub struct Connection<'c> { /* fields omitted */ }Expand description
The connection handle references storage of all information about the connection to the data source, including status, transaction state, and error information.
Implementations
Safety
Call this method only with a valid (successfully allocated) ODBC connection handle.
Establishes connections to a driver and a data source.
Arguments
data_source_name- Data source name. The data might be located on the same computer as the program, or on another computer somewhere on a network.user- User identifier.pwd- Authentication string (typically the password).
An alternative to connect. It supports data sources that require more connection
information than the three arguments in connect and data sources that are not defined in
the system information.
pub unsafe fn driver_connect(
&mut self,
connection_string: &U16Str,
parent_window: HWnd,
completed_connection_string: Option<&mut OutputStringBuffer>,
driver_completion: DriverConnectOption
) -> Result<(), Error>
pub unsafe fn driver_connect(
&mut self,
connection_string: &U16Str,
parent_window: HWnd,
completed_connection_string: Option<&mut OutputStringBuffer>,
driver_completion: DriverConnectOption
) -> Result<(), Error>
An alternative to connect for connecting with a connection string. Allows for completing
a connection string with a GUI prompt on windows.
Safety
parent_window must either be a valid window handle or NULL.
Disconnect from an ODBC data source.
Allocate a new statement handle. The Statement must not outlive the Connection.
Specify the transaction mode. By default, ODBC transactions are in auto-commit mode (unless SQLSetConnectAttr and SQLSetConnectOption are not supported, which is unlikely). Switching from manual-commit mode to auto-commit mode automatically commits any open transaction on the connection.
Fetch the name of the database management system used by the connection and store it into
the provided buf.
Maximum length of catalog names in bytes.
Maximum length of schema names in bytes.
Maximum length of table names in bytes.
Maximum length of column names in bytes.
Fetch the name of the current catalog being usd by the connection and store it into the
provided buf.
Indicates the state of the connection. If true the connection has been lost. If false,
the connection is still active.
pub fn columns(
&self,
statement: StatementImpl<'c>,
catalog_name: &U16Str,
schema_name: &U16Str,
table_name: &U16Str,
column_name: &U16Str
) -> Result<Option<CursorImpl<'c, StatementImpl<'c>>>, Error>
pub fn columns(
&self,
statement: StatementImpl<'c>,
catalog_name: &U16Str,
schema_name: &U16Str,
table_name: &U16Str,
column_name: &U16Str
) -> Result<Option<CursorImpl<'c, StatementImpl<'c>>>, Error>
Query all columns that match the provided catalog name, schema pattern, table pattern, and column pattern.
pub fn columns_buffer_description(
&self,
type_name_max_len: usize,
remarks_max_len: usize,
column_default_max_len: usize
) -> Result<Vec<BufferDescription>, Error>
pub fn columns_buffer_description(
&self,
type_name_max_len: usize,
remarks_max_len: usize,
column_default_max_len: usize
) -> Result<Vec<BufferDescription>, Error>
The buffer descriptions for all standard buffers (not including extensions) returned in the
columns query (e.g. Connection::columns).
Arguments
type_name_max_len- The maximum expected length of type names.remarks_max_len- The maximum expected length of remarks.column_default_max_len- The maximum expected length of column defaults.
Trait Implementations
The raw underlying ODBC handle used to talk to the ODBC C API. The handle must be valid.
The type of the ODBC handle returned by as_handle.