OdbcConnectionManager

Class OdbcConnectionManager

Generic OdbcConnectionManager - try this connection manager if no particular connection manager for your database exists. E.g. for MySql use the MySqlOdbcConnectionManager. Make sure to set the ConnectionType to fit with your database when creating an instance. If you leave the ConnectionManagerType.Unknown (which is the default), there might be some limitations when you use this ConnectionManager:

  • Most ControlFlow Tasks won't work properly, depending on your database
  • SqlTask will work
  • If you use special characters, you need to set the quotation begin / quotation end properties QB and QE that fit to your database (e.g. "[" and "]" for Sql Server or "`" for MySql)
  • DbDestination and DbSource will only work if you provide a TableDefinition that at least define the table and the columns names
Inherited Members
Namespace: ETLBox.Odbc
Assembly: ETLBox.Odbc.dll
Syntax
    public class OdbcConnectionManager : DbConnectionManager<OdbcConnection, OdbcTransaction, OdbcParameter>, IConnectionManager<OdbcConnection, OdbcTransaction>, IConnectionManager, IDisposable

Constructors

OdbcConnectionManager()

Declaration
    public OdbcConnectionManager()

OdbcConnectionManager(ConnectionType)

Declaration
    public OdbcConnectionManager(ConnectionType connectionType)
Parameters
TypeNameDescription
ConnectionTypeconnectionType

OdbcConnectionManager(ConnectionType, OdbcConnectionString)

Declaration
    public OdbcConnectionManager(ConnectionType connectionType, OdbcConnectionString connectionString)
Parameters
TypeNameDescription
ConnectionTypeconnectionType
OdbcConnectionStringconnectionString

OdbcConnectionManager(ConnectionType, string)

Declaration
    public OdbcConnectionManager(ConnectionType connectionType, string connectionString)
Parameters
TypeNameDescription
ConnectionTypeconnectionType
stringconnectionString

Properties

ConnectionType

The database type for the connection manager.

Declaration
    public override ConnectionType ConnectionType { get; protected set; }
Property Value
TypeDescription
ConnectionType
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.ConnectionType

IsOdbcOrOleDbConnection

Indicates if the current connection manager is used as a OleDb or Odbc Connection.

Declaration
    public override bool IsOdbcOrOleDbConnection { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.IsOdbcOrOleDbConnection

QB

The quotation begin character that is used in the database. E.g. SqlServer uses: '[' and Postgres: '"'

Declaration
    public override string QB { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.QB

QE

The quotation end character that is used in the database. E.g. SqlServer uses: ']' and Postgres: '"'

Declaration
    public override string QE { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.QE

Methods

BulkDelete(ITableData)

Performs a bulk delete

Declaration
    public override void BulkDelete(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.BulkDelete(ETLBox.ITableData)

BulkInsert(ITableData)

Performs a bulk insert

Declaration
    public override void BulkInsert(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.BulkInsert(ETLBox.ITableData)

BulkSelect(ITableData, ICollection<string>, Action, Action, params Action<object>[])

Performs a bulk select

Declaration
    public override void BulkSelect(ITableData data, ICollection<string> selectColumnNames, Action beforeRowReadAction, Action afterRowReadAction, params Action<object>[] rowActions)
Parameters
TypeNameDescription
ITableDatadata

Batch of data needed for the where condition

ICollection<string>selectColumnNames

Column names included in the select

ActionbeforeRowReadAction

Action invoked before any data is read

ActionafterRowReadAction

Action invoked after all data is read

Action<object>[]rowActions
Overrides

BulkUpdate(ITableData, ICollection<string>, ICollection<string>)

Performs a bulk update

Declaration
    public override void BulkUpdate(ITableData data, ICollection<string> setColumnNames, ICollection<string> joinColumnNames)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

ICollection<string>setColumnNames

The column names used in the set part of the update statement

ICollection<string>joinColumnNames

The column names to join for the update

Overrides

CleanUpBulkInsert(string)

Called after the whole bulk insert operation to change back settings made to improve bulk insert performance

Declaration
    public override void CleanUpBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides

Clone()

Cretes a clone of the current connection manager

Declaration
    public override IConnectionManager Clone()
Returns
TypeDescription
IConnectionManager

A instance copy of the current connection manager

Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.Clone()

PrepareBulkInsert(string)

Performs preparations needed to improved performance of a bulk insert operation

Declaration
    public override void PrepareBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides

Implements