Db2ConnectionManager

Class Db2ConnectionManager

Connection manager of a ETLBox connection to a Db2 Server. Uses the official Db2 ADO.NET driver for .NET Core.

Inheritance
DbConnectionManager<DB2Connection, DB2Transaction, DB2Parameter>
Db2ConnectionManager
Implements
IConnectionManager<DB2Connection, DB2Transaction>
Inherited Members
Namespace: ETLBox.Db2
Assembly: ETLBox.Db2.dll
Syntax
    public class Db2ConnectionManager : DbConnectionManager<DB2Connection, DB2Transaction, DB2Parameter>, IConnectionManager<DB2Connection, DB2Transaction>, IConnectionManager, IDisposable
Examples
var db2Connection = new Db2ConnectionManager("Data Source=.;");

Constructors

Db2ConnectionManager()

Declaration
    public Db2ConnectionManager()

Db2ConnectionManager(Db2ConnectionString)

Declaration
    public Db2ConnectionManager(Db2ConnectionString connectionString)
Parameters
TypeNameDescription
Db2ConnectionStringconnectionString

Db2ConnectionManager(string)

Declaration
    public Db2ConnectionManager(string connectionString)
Parameters
TypeNameDescription
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<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.ConnectionType

MaxParameterSizeBulkCopy

Returns the maximum amount of parameters that can be used for bulk inserts.

Declaration
    public override int MaxParameterSizeBulkCopy { get; }
Property Value
TypeDescription
int
Overrides
ETLBox.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.MaxParameterSizeBulkCopy

MaxParameterSizeSql

Returns the maximum amount of parameters that can be passed into a sql query.

Declaration
    public override int MaxParameterSizeSql { get; set; }
Property Value
TypeDescription
int
Overrides
ETLBox.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.MaxParameterSizeSql

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<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.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<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.QE

SupportDatabases

Indicates if database server does support multiple databases. A database in ETLBox means a schema in MySql.

Declaration
    public override bool SupportDatabases { get; protected set; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.SupportDatabases

SupportProcedures

Indicates if the database supports procedures

Declaration
    public override bool SupportProcedures { get; protected set; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.SupportProcedures

UseSqlBulkOperations

By default bulk inserts are done using the DB2BulkCopy. This provides better performance, but it won't support Transactions and foreign key constraints. If you need support for transactions or constraints, set this flag to true.

Declaration
    public bool UseSqlBulkOperations { get; set; }
Property Value
TypeDescription
bool

Methods

BulkDelete(ITableData)

Performs a bulk delete

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

Batch of data

Overrides
ETLBox.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.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<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.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<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.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