IDalConnection2.Clone

Fore Syntax

Clone(Type: DalConnectionType): IDalConnection;

Fore.NET Syntax

Clone(Type: Prognoz.Platform.Interop.Dal.DalConnectionType): Prognoz.Platform.Interop.Dal.IDalConnection;

Parameters

Type. Connection type.

Description

The Clone method creates a specialized copy of the connection.

Fore Example

To connect the example, connect the Metabase and Dal system assemblies to the module.

Sub UserProc;
Var
    Driver: IDalDriver;
    SchemeName: string;
    Connect: IDalConnection;
    CloneConnect: IDalConnection;
    Connect2: IDalConnection2;
    ConnectDesc: IDalConnectionDescriptor;
    ConnectDesc2: IDalConnectionDescriptor2;
    Params: IDalConnectionDescriptorParams;
Begin
    driver := New DalOrcl8Driver.Create;
    SchemeName := "Schema";
    ConnectDesc := Driver.CreateDescriptor;
    Params := ConnectDesc.Params;
    Params.Find("User Name").Value := "PPRepository";
    Params.Find("Password").Value := "PPRepository";
    Params.Find("Host BSTR").Value := "TestServer";
    Params.Find(SchemeName).Value := "PPRepository";
    Connect := ConnectDesc.CreateConnection As IDalConnection;
    ConnectDesc2 := ConnectDesc As IDalConnectiondescriptor2;
    Connect2 := Connect As IDalConnection2;
    CloneConnect := Connect2.Clone(DalConnectionType.FastInsert);
End Sub UserProc;

On executing the example the connection is established to the specified repository. After that the connection copy is created, which is used to quickly insert data.

Fore.NET Example

To execute the example, add a link to the Dal system assembly.

Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    Driver: IDalDriver;
    SchemeName: string;
    Connect: IDalConnection;
    CloneConnect: IDalConnection;
    Connect2: IDalConnection2;
    ConnectDesc: IDalConnectionDescriptor;
    ConnectDesc2: IDalConnectionDescriptor2;
    Param: IDalConnectionDescriptorParams;
Begin
    driver := New DalOrcl8Driver.Create();
    SchemeName := "Schema";
    ConnectDesc := Driver.CreateDescriptor();
    Param := ConnectDesc.Params;
    Param.Find("User Name").Value := "PPRepository";
    Param.Find("Password").Value := "PPRepository";
    Param.Find("Host BSTR").Value := "TestServer";
    Param.Find(SchemeName).Value := "PPRepository";
    Connect := ConnectDesc.CreateConnection() As IDalConnection;
    ConnectDesc2 := ConnectDesc As IDalConnectiondescriptor2;
    Connect2 := Connect As IDalConnection2;
    CloneConnect := Connect2.Clone(DalConnectionType.dctFastInsert);
End Sub;

On executing the example the connection is established to the specified repository. After that the connection copy is created, which is used to quickly insert data.

See also:

IDalConnection2