pub struct Connection<'c> { /* private fields */ }
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.

Directly acces the underlying ODBC 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.

An alternative to connect for connecting with a connection string. Allows for completing a connection string with a GUI prompt on windows.

Return

None in case the prompt completing the connection string has been aborted.

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.

To commit a transaction in manual-commit mode.

Roll back a transaction in manual-commit mode.

Fetch the name of the database management system used by the connection and store it into the provided buf.

Maximum length of catalog names.

Maximum length of schema names.

Maximum length of table names.

Maximum length of column names.

Fetch the name of the current catalog being used 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.

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. This is a method rather than a constant in order to make the type object safe. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.