TDADriverManager

Overview

The TDADriverManager component manages the database drivers available in a server application, whether they are statically linked in or dynamically loaded from .dad files.

Every server application must contain one (and not more than one) TDADriverManager instance, and it must be referenced from the TDAConnectionManager DriverManager property.

Location

Implements

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AutoLoad

Toggles whether the driver manager will automatically try to load all .dad driver files located in the DriverDirectory on startup. Default is false.

property AutoLoad: boolean read write

DriverByDriverID

Returns the IDADriver reference for specified driver.

function DriverByDriverID(const aDriverID: string): IDADriver

Parameters:

  • aDriverID: given DriverID

DriverCount

Returns the number of drivers currently available, including both statically linked and dynamically loaded drivers.

property DriverCount: integer read write

DriverDirectory

Defines the directory that AutoLoad will look in for drivers to automatically load at startup.

property DriverDirectory: string read write

DriverInfo

Gives information about the specified driver, including the Filename and DLL Handle (for dynamically loaded drivers) and the IDADriver reference.

property DriverInfo[Index: integer]: TDADriverInfo read write

Drivers

Returns the the IDADriver reference for the specified driver.

property Drivers[Index: integer]: IDADriver read write

FindDriver

Returns the IDADriver reference for the specified driver.

function FindDriver(const aDriverID: string; out Driver: IDADriver): boolean

Parameters:

  • aDriverID: given DriverID
  • Driver: found driver

FindDriverIndex

Returns the current index for the specified driver.

function FindDriverIndex(const aDriverID: string): integer

Parameters:

  • aDriverID: given DriverID

ListDrivers

Returns list of loaded drivers.

function ListDrivers(const aDirectory: string; out FileNames: IROStrings): integer

Parameters:

  • aDirectory: specified directory
  • FileNames: list of found drivers

LoadDriver

Dynamically loads the driver from the specified .dad file.

procedure LoadDriver(const aFileName: string)

Parameters:

  • aFileName: specified filename

LoadDrivers  overload

Dynamically loads all the drivers from the specified list of .dad files.

procedure LoadDrivers

LoadDrivers (IROStrings, boolean, boolean)  overload

Dynamically loads all the drivers from the specified list of .dad files.

procedure LoadDrivers(const aDriverList: IROStrings; aIgnoreDuplicates: boolean; aIgnoreErrors: boolean)

Parameters:

  • aDriverList: the specified list of .dad files
  • aIgnoreDuplicates: ignore duplicates
  • aIgnoreErrors: ignore errors

LoadStaticDrivers  protected virtual

Loads statically linked drivers

procedure LoadStaticDrivers

OnDriverLoaded

Fires after a new driver has been dynamically loaded.

property OnDriverLoaded: TDADriverLoadNotification read write
delegate: procedure OnDriverLoaded(DriverInfo: TDADriverInfo)

OnDriverUnloaded

Fires after a dynamic driver has been unloaded.

property OnDriverUnloaded: TDADriverLoadNotification read write
delegate: procedure OnDriverUnloaded(DriverInfo: TDADriverInfo)

OnTraceEvent

Alloes to process trace

property OnTraceEvent: TDALogTraceEvent read write
delegate: procedure OnTraceEvent(Sender: TObject; const Text: string; Tag: integer)

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

TraceActive

Trace state

property TraceActive: boolean read write

TraceFlags

trace flags

property TraceFlags: TDATraceOptions read write

UnloadAllDrivers  overload

Unloads all dynamically loaded drivers. Before calling this method, make sure that there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadAllDrivers

UnloadAllDrivers (boolean)  protected overload

Unloads all static and dynamically loaded drivers. Before calling this method, make sure that there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadAllDrivers(aForceUnloadForStaticDriver: boolean)

Parameters:

  • aForceUnloadForStaticDriver: unload static drivers

UnloadDriver (integer)  overload

Unloads the specified driver, if it was dynamically loaded. Before calling this method, make sure there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadDriver(anIndex: integer)

Parameters:

  • anIndex: specified index

UnloadDriver (integer, boolean)  protected overload

Unloads the specified driver. Before calling this method, make sure there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadDriver(anIndex: integer; aForceUnloadForStaticDriver: boolean)

Parameters:

  • anIndex: specified index
  • aForceUnloadForStaticDriver: unload static drivers

 

AutoLoad

Toggles whether the driver manager will automatically try to load all .dad driver files located in the DriverDirectory on startup. Default is false.

property AutoLoad: boolean read write

DriverCount

Returns the number of drivers currently available, including both statically linked and dynamically loaded drivers.

property DriverCount: integer read write

DriverDirectory

Defines the directory that AutoLoad will look in for drivers to automatically load at startup.

property DriverDirectory: string read write

DriverInfo

Gives information about the specified driver, including the Filename and DLL Handle (for dynamically loaded drivers) and the IDADriver reference.

property DriverInfo[Index: integer]: TDADriverInfo read write

Drivers

Returns the the IDADriver reference for the specified driver.

property Drivers[Index: integer]: IDADriver read write

TraceActive

Trace state

property TraceActive: boolean read write

TraceFlags

trace flags

property TraceFlags: TDATraceOptions read write

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

DriverByDriverID

Returns the IDADriver reference for specified driver.

function DriverByDriverID(const aDriverID: string): IDADriver

Parameters:

  • aDriverID: given DriverID

FindDriver

Returns the IDADriver reference for the specified driver.

function FindDriver(const aDriverID: string; out Driver: IDADriver): boolean

Parameters:

  • aDriverID: given DriverID
  • Driver: found driver

FindDriverIndex

Returns the current index for the specified driver.

function FindDriverIndex(const aDriverID: string): integer

Parameters:

  • aDriverID: given DriverID

ListDrivers

Returns list of loaded drivers.

function ListDrivers(const aDirectory: string; out FileNames: IROStrings): integer

Parameters:

  • aDirectory: specified directory
  • FileNames: list of found drivers

LoadDriver

Dynamically loads the driver from the specified .dad file.

procedure LoadDriver(const aFileName: string)

Parameters:

  • aFileName: specified filename

LoadDrivers  overload

Dynamically loads all the drivers from the specified list of .dad files.

procedure LoadDrivers

LoadDrivers (IROStrings, boolean, boolean)  overload

Dynamically loads all the drivers from the specified list of .dad files.

procedure LoadDrivers(const aDriverList: IROStrings; aIgnoreDuplicates: boolean; aIgnoreErrors: boolean)

Parameters:

  • aDriverList: the specified list of .dad files
  • aIgnoreDuplicates: ignore duplicates
  • aIgnoreErrors: ignore errors

LoadStaticDrivers  protected virtual

Loads statically linked drivers

procedure LoadStaticDrivers

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

UnloadAllDrivers  overload

Unloads all dynamically loaded drivers. Before calling this method, make sure that there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadAllDrivers

UnloadAllDrivers (boolean)  protected overload

Unloads all static and dynamically loaded drivers. Before calling this method, make sure that there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadAllDrivers(aForceUnloadForStaticDriver: boolean)

Parameters:

  • aForceUnloadForStaticDriver: unload static drivers

UnloadDriver (integer)  overload

Unloads the specified driver, if it was dynamically loaded. Before calling this method, make sure there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadDriver(anIndex: integer)

Parameters:

  • anIndex: specified index

UnloadDriver (integer, boolean)  protected overload

Unloads the specified driver. Before calling this method, make sure there are no active or pooled connections using the driver(s) about to be unloaded. You can ensure all pooled connections are closed by calling the TDAConnectionManager.ClearPool method.

procedure UnloadDriver(anIndex: integer; aForceUnloadForStaticDriver: boolean)

Parameters:

  • anIndex: specified index
  • aForceUnloadForStaticDriver: unload static drivers

 

OnDriverLoaded

Fires after a new driver has been dynamically loaded.

property OnDriverLoaded: TDADriverLoadNotification read write
delegate: procedure OnDriverLoaded(DriverInfo: TDADriverInfo)

OnDriverUnloaded

Fires after a dynamic driver has been unloaded.

property OnDriverUnloaded: TDADriverLoadNotification read write
delegate: procedure OnDriverUnloaded(DriverInfo: TDADriverInfo)

OnTraceEvent

Alloes to process trace

property OnTraceEvent: TDALogTraceEvent read write
delegate: procedure OnTraceEvent(Sender: TObject; const Text: string; Tag: integer)

See Also