Class Db2ConnectionManager

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

Inheritance
System.Object
DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>
Db2ConnectionManager
Implements
IConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction>
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.Connection
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
System.StringconnectionString

Properties

ConnectionManagerType

The database type for the connection manager.

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

MaxParameterAmount

returns the maximum amount of parameters that ca be passed into a sql query.

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

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
System.String
Overrides
ETLBox.Connection.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
System.String
Overrides
ETLBox.Connection.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; }
Property Value
TypeDescription
System.Boolean
Overrides
ETLBox.Connection.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; }
Property Value
TypeDescription
System.Boolean
Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.SupportProcedures

UseSqlBulkInsert

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 UseSqlBulkInsert { get; set; }
Property Value
TypeDescription
System.Boolean

Methods

BulkDelete(ITableData)

Performs a bulk delete

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

Batch of data

Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.BulkDelete(ETLBox.ControlFlow.ITableData)

BulkInsert(ITableData)

Performs a bulk insert

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

Batch of data

Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.BulkInsert(ETLBox.ControlFlow.ITableData)

BulkSelect(ITableData, ICollection<String>, Action, Action, Action<Object>[])

Declaration
    public override void BulkSelect(ITableData data, ICollection<string> selectColumnNames, Action beforeRowReadAction, Action afterRowReadAction, params Action<object>[] rowActions)
Parameters
TypeNameDescription
ITableDatadata
System.Collections.Generic.ICollection<System.String>selectColumnNames
System.ActionbeforeRowReadAction
System.ActionafterRowReadAction
System.Action<System.Object>[]rowActions
Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.BulkSelect(ETLBox.ControlFlow.ITableData, System.Collections.Generic.ICollection<System.String>, System.Action, System.Action, System.Action<System.Object>[])

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

System.Collections.Generic.ICollection<System.String>setColumnNames

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

System.Collections.Generic.ICollection<System.String>joinColumnNames

The column names to join for the update

Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.BulkUpdate(ETLBox.ControlFlow.ITableData, System.Collections.Generic.ICollection<System.String>, System.Collections.Generic.ICollection<System.String>)

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
System.Stringtablename
Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.CleanUpBulkInsert(System.String)

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.Connection.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
System.Stringtablename
Overrides
ETLBox.Connection.DbConnectionManager<IBM.Data.DB2.Core.DB2Connection, IBM.Data.DB2.Core.DB2Transaction, IBM.Data.DB2.Core.DB2Parameter>.PrepareBulkInsert(System.String)

Implements

System.IDisposable