TDAEConnection
Overview
TDAEConnection manipulates the database and retrieves information about available databases, tables, columns, etc.
TDAEConnection is not used directly. Instead, IDAConnection is used in runtime for working with the TDAEConnection instance.
TDAEConnection also contains references to the TDAEDataset and TDAEStoredProcedure classes.
By default, TDAEConnection supports IDAConnection, IDACustomConnection, IDAConnectionObjectAccess, IDATestableObject and IDAHasMacroProcessor, so that required interfaces can be received as:
//id: IDAConnection
//it: IDATestableObject
if Supports(id, IDATestableObject, it) then it.Test;
Location
- Unit: uDAEConnection.pas
- Ancestry: TDAEngineBaseObject | TDAEConnection
constructor Create virtual
Creates a new instance.
constructor Create(aDriver: TDAEDriver; aName: string)
Parameters:
- aDriver: owner driver.
- aName: name of connection.
ApplyConnectionString protected
Parses connection string via calling of DoApplyConnectionString
procedure ApplyConnectionString(const aConnectionString: string; aConnectionObject: TCustomConnection)
Parameters:
- aConnectionString: Connection string
- aConnectionObject: Connection
AssignCommandEventHandlers protected
Assigns OnBeforeExecute, OnAfterExecute and OnExecuteError events to correspondent events of aCommand
procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)
Parameters:
- aCommand: Command
AssignDatasetEventHandlers protected
Assigns OnBeforeOpen, OnAfterOpen and OnExecuteOpen events to correspondent events of aDataset
procedure AssignDatasetEventHandlers(const aDataset: IDADataset)
Parameters:
- aDataset: Dataset
BeginTransaction protected safecall
Starts transaction via calling of DoBeginTransaction.
function BeginTransaction: Integer
Close protected safecall
Closes a physical connection to the database back-end,
procedure Close
CommitTransaction protected safecall
Commits transaction via calling of DoCommitTransaction.
procedure CommitTransaction
Connected protected
Indicates whether the connection object currently has an active link to the database (true) or not (false). Usually, a Data Abstract connection connects to the database when it is created, and is not closed until discarded and eventually removed from the connection pool.
property Connected: Boolean read write
ConnectionDefinition protected
Holds a reference to the TDAConnection
property ConnectionDefinition: TDAConnection read
ConnectionManager protected
Holds a reference to the IDAConnectionManager.
property ConnectionManager: IDAConnectionManager read
ConnectionName protected
Holds the connection name.
property ConnectionName: string read
ConnectionObject protected
Provides access to the internal connection component and facilitates access to its properties in form of a collection of properties.
property ConnectionObject: TCustomConnection read write
ConnectionPool
Provides access to the IDAConnectionPool.
property ConnectionPool: IDAConnectionPool read write
ConnectionProperties protected
Returns value of given property
property ConnectionProperties[aPropertyName: string]: Variant read write
ConnectionString protected
Sets the database connection string that was used to open this connection. The exact content of this string depends on the driver and database you are using, but it will usually contain information such as the database name, user id and password, as well as additional connection parameters. Please refer to the reference for the specific driver for more details.
property ConnectionString: string read write
ConnectionType protected
Holds the connection type.
property ConnectionType: string read
CreateCustomConnection protected virtual abstract
Creates standard TCustomConnection
function CreateCustomConnection: TCustomConnection
CreateMacroProcessor protected virtual
Creates a macro processor.
function CreateMacroProcessor: TDASQLMacroProcessor
DoApplyConnectionString protected virtual
Parses connection string
procedure DoApplyConnectionString(aConnStrParser: TDAConnectionStringParser; aConnectionObject: TCustomConnection)
Parameters:
- aConnStrParser: Parser
- aConnectionObject: Connection
DoBeginTransaction protected virtual abstract
Starts transaction.
function DoBeginTransaction: Integer
DoCommitTransaction protected virtual abstract
Commits transaction.
procedure DoCommitTransaction
DoGetForeignKeys protected virtual safecall
Fills ForeignKeys with actual foreign keys.
procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)
Parameters:
- ForeignKeys: collection that will be filled.
DoGetInTransaction protected virtual abstract
Returns the transaction state.
function DoGetInTransaction: Boolean
DoGetLastAutoInc protected virtual
Returns last auto increment value.
function DoGetLastAutoInc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
DoGetLastAutoIncValue protected virtual
Returns last auto increment value.
function DoGetLastAutoIncValue(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
DoGetQueryFields protected virtual safecall
Returns the fields of a specified SQL.
procedure DoGetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)
Parameters:
- aSQL: given SQL
- aParamsIfNeeded: optional parameters
- Fields: fields of SQL
DoGetStoredProcedureNames protected virtual safecall
Returns the list of stored procedures names.
procedure DoGetStoredProcedureNames(out List: IROStrings)
Parameters:
- List: Output list with names of stored procedures
DoGetStoredProcedureParams protected virtual safecall
Retrieves the stored procedure params.
procedure DoGetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)
Parameters:
- aStoredProcedureName: Stored procedure name
- Params: Output collection of parameters
DoGetTableFields protected virtual safecall
Returns the fields of a specified table.
procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection)
Parameters:
- aTableName: Specified data table name
- Fields: Output collection of data table fields
DoGetTableNames protected virtual safecall
Returns the list of tables names.
procedure DoGetTableNames(out List: IROStrings)
Parameters:
- List: Output list of data table names
DoGetViewFields protected virtual safecall
Returns the fields of a specified view.
procedure DoGetViewFields(const aViewName: string; out Fields: TDAFieldCollection)
Parameters:
- aViewName: Specified view name
- Fields: Output collection of data table fields
DoGetViewNames protected virtual safecall
Returns the list of view names.
procedure DoGetViewNames(out List: IROStrings)
Parameters:
- List: Output list of views
DoRollbackTransaction protected virtual abstract
Rollbacks the transaction.
procedure DoRollbackTransaction
Driver
Reference to the owner TDAEDriver.
property Driver: TDAEDriver read
GetConnected protected virtual safecall
Returns connection state.
function GetConnected: Boolean
GetDatasetClass protected virtual
Returns the actual TDAEDatasetClass descendant.
function GetDatasetClass: TDAEDatasetClass
GetForeignKeys protected safecall
Fills ForeignKeys with actual foreign keys via calling of DoGetForeignKeys.
procedure GetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)
Parameters:
- ForeignKeys: collection that will be filled.
GetInTransaction protected safecall
Returns the transaction state via calling of DoGetInTransaction.
function GetInTransaction: Boolean
GetLastAutoInc protected safecall
Returns last auto increment value as integer value via calling of DoGetLastAutoInc
function GetLastAutoInc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
GetLastAutoIncValue protected safecall
Returns last auto increment value as variant value via calling of DoGetLastAutoIncValue
function GetLastAutoIncValue(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
GetName protected safecall
Return the connection name.
function GetName: string
GetNextAutoinc protected safecall
Returns the next AutoInc value of a specified generator as integer value.
function GetNextAutoinc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
GetNextAutoinc2 protected virtual safecall
Returns the next value of a specified generator as integer value.
function GetNextAutoinc2(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
GetPassword protected virtual safecall
Returns the password.
function GetPassword: string
GetQueryBuilder protected virtual safecall
Creates an instance of the TDAQueryBuilder.
function GetQueryBuilder: TDAQueryBuilder
GetQueryFields protected safecall
Returns the fields of a specified SQL via calling of DoGetQueryFields
procedure GetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)
Parameters:
- aSQL: given SQL
- aParamsIfNeeded: optional parameters
- Fields: fields of SQL
GetQueryGenerator protected virtual
Returns correspondent TDASQLQueryGenerator instance
function GetQueryGenerator: TDASQLQueryGenerator
GetQuoteChars protected virtual safecall
Returns quote symbols as an array.
function GetQuoteChars: TDAQuoteCharArray
GetSPSelectSyntax protected virtual safecall
Returns the syntax of a stored procedure for usage in a select query.
function GetSPSelectSyntax(HasArguments: Boolean): string
Parameters:
- HasArguments: parameters are present or not
GetStoredProcedureClass protected virtual
Returns the actual TDAEStoredProcedure descendant.
function GetStoredProcedureClass: TDAEStoredProcedureClass
GetStoredProcedureNames protected safecall
Returns the list of stored procedures names via calling of DoGetStoredProcedureNames.
procedure GetStoredProcedureNames(out List: IROStrings)
Parameters:
- List: list of stored procedures names
GetStoredProcedureParams protected safecall
Retrieves the stored procedure params.
procedure GetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)
Parameters:
- aStoredProcedureName: stored procedure's name
- Params: stored procedure params.
GetTableFields protected safecall
Returns the fields of a specified table via calling of DoGetTableFields.
procedure GetTableFields(const aTableName: string; out Fields: TDAFieldCollection)
Parameters:
- aTableName: Specified data table name
- Fields: Output collection of data table fields
GetTableNames protected safecall
Returns the list of tables names via calling of DoGetTableNames.
procedure GetTableNames(out List: IROStrings)
Parameters:
- List: list of tables names.
GetUserID protected virtual safecall
Returns the user ID.
function GetUserID: string
GetViewFields protected safecall
Returns the fields of a specified view via calling of DoGetViewFields.
procedure GetViewFields(const aViewName: string; out Fields: TDAFieldCollection)
Parameters:
- aViewName: view's name
- Fields: fields of a specified view.
GetViewNames protected safecall
Returns the list of view names via calling of DoGetViewNames.
procedure GetViewNames(out List: IROStrings)
Parameters:
- List: list of view names.
GetWhereBuilder protected virtual safecall
Creates an instance of the TDASQL92WhereBuilder.
function GetWhereBuilder: TDASQLWhereBuilder
IdentifierIsQuoted protected virtual safecall
Returns True if the iIdentifier is quoted.
function IdentifierIsQuoted(const iIdentifier: string): Boolean
Parameters:
- iIdentifier: identifier.
IdentifierNeedsQuoting protected virtual safecall
Returns True if the iIdentifier should be quoted.
function IdentifierNeedsQuoting(const iIdentifier: string): Boolean
Parameters:
- iIdentifier: identifier.
InTransaction protected
Returns the transaction state
property InTransaction: Boolean read
isAlive protected virtual safecall
Returns True if connection is alive.
function isAlive: Boolean
MacroProcessor
Returns the correspondent TDASQLMacroProcessor.
property MacroProcessor: TDASQLMacroProcessor read
Name protected
Returns a human-readable name for the connection.
property Name: string read
NewCommand protected virtual safecall
Creates an IDASQLCommand based on CommandType.
function NewCommand(const Text: string; CommandType: TDASQLStatementType; const aCommandName: string): IDASQLCommand
Parameters:
- Text: stored procedure's name or SQL statement (depends on command type)
- CommandType: command type
- aCommandName: command name
NewDataset protected virtual safecall
Returns a new IDADataset implementation that can be used to retrieve records from the database.
function NewDataset(const SQL: string; const aDatasetName: string): IDADataset
Parameters:
- SQL: SQL statement
- aDatasetName: Dataset's name
OnAfterExecuteCommand
Fires right after a command was executed.
property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnAfterOpenDataset
Fires after dataset was opened
property OnAfterOpenDataset: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpenDataset(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnBeforeExecuteCommand
Fires just before a command will be executed.
property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(const Sender: IDASQLCommand)
OnBeforeOpenDataset
Fires before dataset was opened
property OnBeforeOpenDataset: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpenDataset(const Sender: IDADataset)
OnExecuteCommandError
Fires when exception is detected during command execution
property OnExecuteCommandError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteCommandError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)
OnOpenDatasetError
Fired if error was occured duting opening of dataset
property OnOpenDatasetError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenDatasetError(const Sender: IDADataset; ActualSQL: string; Error: Exception)
Open protected safecall
Sets UserID and Password if they are present and opens a physical connection to the database back-end,
procedure Open(const aUserID: string; const aPassword: string)
Parameters:
- aUserID: username
- aPassword: password
Password protected
Defines the Password that was or will be used to open this connection. This value is usually obtained from the connection string.
property Password: string read write
QuoteFieldName protected virtual safecall
Quotes field name.
function QuoteFieldName(const aTableName: string; const aFieldName: string): string
Parameters:
- aTableName: table name.
- aFieldName: field name.
QuoteFieldNameIfNeeded protected virtual safecall
Quotes field name if is required.
function QuoteFieldNameIfNeeded(const aTableName: string; const aFieldName: string): string
Parameters:
- aTableName: table name.
- aFieldName: field name.
QuoteIdentifier protected virtual safecall
Quotes identifier.
function QuoteIdentifier(const iIdentifier: string): string
Parameters:
- iIdentifier: identifier.
QuoteIdentifierIfNeeded protected virtual safecall
Quotes identifier if is required.
function QuoteIdentifierIfNeeded(const iIdentifier: string): string
Parameters:
- iIdentifier: identifier.
RecreateMacroProcessor protected
Creates MacroProcessor from scratch
procedure RecreateMacroProcessor
RollbackTransaction protected safecall
Discards a transaction that was started with a prior call to BeginTransaction, via calling of DoRollbackTransaction. All changes made in the context of the transaction will be be discarded and not applied to the physical database. To persist the changes made, instead of discarding them, call CommitTransaction instead.
procedure RollbackTransaction
SetConnected protected virtual safecall
Opens or closes a physical connection to the database back-end,
procedure SetConnected(Value: Boolean)
Parameters:
- Value: state
SetPassword protected virtual safecall
Sets the password.
procedure SetPassword(const Value: string)
Parameters:
- Value: password
SetUserID protected virtual safecall
Sets the user ID.
procedure SetUserID(const Value: string)
Parameters:
- Value: user ID
Test protected virtual safecall
Tests connections.
procedure Test
UseMacroProcessor protected
Specifies an usage of macro processor.
property UseMacroProcessor: Boolean read write
UserID protected
Holds the User ID that was or will be used to open this connection. This value is usually obtained from the connection string.
property UserID: string read write
Connected protected
Indicates whether the connection object currently has an active link to the database (true) or not (false). Usually, a Data Abstract connection connects to the database when it is created, and is not closed until discarded and eventually removed from the connection pool.
property Connected: Boolean read write
ConnectionDefinition protected
Holds a reference to the TDAConnection
property ConnectionDefinition: TDAConnection read
ConnectionManager protected
Holds a reference to the IDAConnectionManager.
property ConnectionManager: IDAConnectionManager read
ConnectionName protected
Holds the connection name.
property ConnectionName: string read
ConnectionObject protected
Provides access to the internal connection component and facilitates access to its properties in form of a collection of properties.
property ConnectionObject: TCustomConnection read write
ConnectionPool
Provides access to the IDAConnectionPool.
property ConnectionPool: IDAConnectionPool read write
ConnectionProperties protected
Returns value of given property
property ConnectionProperties[aPropertyName: string]: Variant read write
ConnectionString protected
Sets the database connection string that was used to open this connection. The exact content of this string depends on the driver and database you are using, but it will usually contain information such as the database name, user id and password, as well as additional connection parameters. Please refer to the reference for the specific driver for more details.
property ConnectionString: string read write
ConnectionType protected
Holds the connection type.
property ConnectionType: string read
Driver
Reference to the owner TDAEDriver.
property Driver: TDAEDriver read
InTransaction protected
Returns the transaction state
property InTransaction: Boolean read
MacroProcessor
Returns the correspondent TDASQLMacroProcessor.
property MacroProcessor: TDASQLMacroProcessor read
Name protected
Returns a human-readable name for the connection.
property Name: string read
Password protected
Defines the Password that was or will be used to open this connection. This value is usually obtained from the connection string.
property Password: string read write
UseMacroProcessor protected
Specifies an usage of macro processor.
property UseMacroProcessor: Boolean read write
UserID protected
Holds the User ID that was or will be used to open this connection. This value is usually obtained from the connection string.
property UserID: string read write
constructor Create virtual
Creates a new instance.
constructor Create(aDriver: TDAEDriver; aName: string)
Parameters:
- aDriver: owner driver.
- aName: name of connection.
ApplyConnectionString protected
Parses connection string via calling of DoApplyConnectionString
procedure ApplyConnectionString(const aConnectionString: string; aConnectionObject: TCustomConnection)
Parameters:
- aConnectionString: Connection string
- aConnectionObject: Connection
AssignCommandEventHandlers protected
Assigns OnBeforeExecute, OnAfterExecute and OnExecuteError events to correspondent events of aCommand
procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)
Parameters:
- aCommand: Command
AssignDatasetEventHandlers protected
Assigns OnBeforeOpen, OnAfterOpen and OnExecuteOpen events to correspondent events of aDataset
procedure AssignDatasetEventHandlers(const aDataset: IDADataset)
Parameters:
- aDataset: Dataset
BeginTransaction protected safecall
Starts transaction via calling of DoBeginTransaction.
function BeginTransaction: Integer
Close protected safecall
Closes a physical connection to the database back-end,
procedure Close
CommitTransaction protected safecall
Commits transaction via calling of DoCommitTransaction.
procedure CommitTransaction
CreateCustomConnection protected virtual abstract
Creates standard TCustomConnection
function CreateCustomConnection: TCustomConnection
CreateMacroProcessor protected virtual
Creates a macro processor.
function CreateMacroProcessor: TDASQLMacroProcessor
DoApplyConnectionString protected virtual
Parses connection string
procedure DoApplyConnectionString(aConnStrParser: TDAConnectionStringParser; aConnectionObject: TCustomConnection)
Parameters:
- aConnStrParser: Parser
- aConnectionObject: Connection
DoBeginTransaction protected virtual abstract
Starts transaction.
function DoBeginTransaction: Integer
DoCommitTransaction protected virtual abstract
Commits transaction.
procedure DoCommitTransaction
DoGetForeignKeys protected virtual safecall
Fills ForeignKeys with actual foreign keys.
procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)
Parameters:
- ForeignKeys: collection that will be filled.
DoGetInTransaction protected virtual abstract
Returns the transaction state.
function DoGetInTransaction: Boolean
DoGetLastAutoInc protected virtual
Returns last auto increment value.
function DoGetLastAutoInc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
DoGetLastAutoIncValue protected virtual
Returns last auto increment value.
function DoGetLastAutoIncValue(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
DoGetQueryFields protected virtual safecall
Returns the fields of a specified SQL.
procedure DoGetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)
Parameters:
- aSQL: given SQL
- aParamsIfNeeded: optional parameters
- Fields: fields of SQL
DoGetStoredProcedureNames protected virtual safecall
Returns the list of stored procedures names.
procedure DoGetStoredProcedureNames(out List: IROStrings)
Parameters:
- List: Output list with names of stored procedures
DoGetStoredProcedureParams protected virtual safecall
Retrieves the stored procedure params.
procedure DoGetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)
Parameters:
- aStoredProcedureName: Stored procedure name
- Params: Output collection of parameters
DoGetTableFields protected virtual safecall
Returns the fields of a specified table.
procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection)
Parameters:
- aTableName: Specified data table name
- Fields: Output collection of data table fields
DoGetTableNames protected virtual safecall
Returns the list of tables names.
procedure DoGetTableNames(out List: IROStrings)
Parameters:
- List: Output list of data table names
DoGetViewFields protected virtual safecall
Returns the fields of a specified view.
procedure DoGetViewFields(const aViewName: string; out Fields: TDAFieldCollection)
Parameters:
- aViewName: Specified view name
- Fields: Output collection of data table fields
DoGetViewNames protected virtual safecall
Returns the list of view names.
procedure DoGetViewNames(out List: IROStrings)
Parameters:
- List: Output list of views
DoRollbackTransaction protected virtual abstract
Rollbacks the transaction.
procedure DoRollbackTransaction
GetConnected protected virtual safecall
Returns connection state.
function GetConnected: Boolean
GetDatasetClass protected virtual
Returns the actual TDAEDatasetClass descendant.
function GetDatasetClass: TDAEDatasetClass
GetForeignKeys protected safecall
Fills ForeignKeys with actual foreign keys via calling of DoGetForeignKeys.
procedure GetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)
Parameters:
- ForeignKeys: collection that will be filled.
GetInTransaction protected safecall
Returns the transaction state via calling of DoGetInTransaction.
function GetInTransaction: Boolean
GetLastAutoInc protected safecall
Returns last auto increment value as integer value via calling of DoGetLastAutoInc
function GetLastAutoInc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
GetLastAutoIncValue protected safecall
Returns last auto increment value as variant value via calling of DoGetLastAutoIncValue
function GetLastAutoIncValue(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
GetName protected safecall
Return the connection name.
function GetName: string
GetNextAutoinc protected safecall
Returns the next AutoInc value of a specified generator as integer value.
function GetNextAutoinc(const GeneratorName: string): Integer
Parameters:
- GeneratorName: Specified generator name.
GetNextAutoinc2 protected virtual safecall
Returns the next value of a specified generator as integer value.
function GetNextAutoinc2(const GeneratorName: string): Variant
Parameters:
- GeneratorName: Specified generator name.
GetPassword protected virtual safecall
Returns the password.
function GetPassword: string
GetQueryBuilder protected virtual safecall
Creates an instance of the TDAQueryBuilder.
function GetQueryBuilder: TDAQueryBuilder
GetQueryFields protected safecall
Returns the fields of a specified SQL via calling of DoGetQueryFields
procedure GetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)
Parameters:
- aSQL: given SQL
- aParamsIfNeeded: optional parameters
- Fields: fields of SQL
GetQueryGenerator protected virtual
Returns correspondent TDASQLQueryGenerator instance
function GetQueryGenerator: TDASQLQueryGenerator
GetQuoteChars protected virtual safecall
Returns quote symbols as an array.
function GetQuoteChars: TDAQuoteCharArray
GetSPSelectSyntax protected virtual safecall
Returns the syntax of a stored procedure for usage in a select query.
function GetSPSelectSyntax(HasArguments: Boolean): string
Parameters:
- HasArguments: parameters are present or not
GetStoredProcedureClass protected virtual
Returns the actual TDAEStoredProcedure descendant.
function GetStoredProcedureClass: TDAEStoredProcedureClass
GetStoredProcedureNames protected safecall
Returns the list of stored procedures names via calling of DoGetStoredProcedureNames.
procedure GetStoredProcedureNames(out List: IROStrings)
Parameters:
- List: list of stored procedures names
GetStoredProcedureParams protected safecall
Retrieves the stored procedure params.
procedure GetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)
Parameters:
- aStoredProcedureName: stored procedure's name
- Params: stored procedure params.
GetTableFields protected safecall
Returns the fields of a specified table via calling of DoGetTableFields.
procedure GetTableFields(const aTableName: string; out Fields: TDAFieldCollection)
Parameters:
- aTableName: Specified data table name
- Fields: Output collection of data table fields
GetTableNames protected safecall
Returns the list of tables names via calling of DoGetTableNames.
procedure GetTableNames(out List: IROStrings)
Parameters:
- List: list of tables names.
GetUserID protected virtual safecall
Returns the user ID.
function GetUserID: string
GetViewFields protected safecall
Returns the fields of a specified view via calling of DoGetViewFields.
procedure GetViewFields(const aViewName: string; out Fields: TDAFieldCollection)
Parameters:
- aViewName: view's name
- Fields: fields of a specified view.
GetViewNames protected safecall
Returns the list of view names via calling of DoGetViewNames.
procedure GetViewNames(out List: IROStrings)
Parameters:
- List: list of view names.
GetWhereBuilder protected virtual safecall
Creates an instance of the TDASQL92WhereBuilder.
function GetWhereBuilder: TDASQLWhereBuilder
IdentifierIsQuoted protected virtual safecall
Returns True if the iIdentifier is quoted.
function IdentifierIsQuoted(const iIdentifier: string): Boolean
Parameters:
- iIdentifier: identifier.
IdentifierNeedsQuoting protected virtual safecall
Returns True if the iIdentifier should be quoted.
function IdentifierNeedsQuoting(const iIdentifier: string): Boolean
Parameters:
- iIdentifier: identifier.
isAlive protected virtual safecall
Returns True if connection is alive.
function isAlive: Boolean
NewCommand protected virtual safecall
Creates an IDASQLCommand based on CommandType.
function NewCommand(const Text: string; CommandType: TDASQLStatementType; const aCommandName: string): IDASQLCommand
Parameters:
- Text: stored procedure's name or SQL statement (depends on command type)
- CommandType: command type
- aCommandName: command name
NewDataset protected virtual safecall
Returns a new IDADataset implementation that can be used to retrieve records from the database.
function NewDataset(const SQL: string; const aDatasetName: string): IDADataset
Parameters:
- SQL: SQL statement
- aDatasetName: Dataset's name
Open protected safecall
Sets UserID and Password if they are present and opens a physical connection to the database back-end,
procedure Open(const aUserID: string; const aPassword: string)
Parameters:
- aUserID: username
- aPassword: password
QuoteFieldName protected virtual safecall
Quotes field name.
function QuoteFieldName(const aTableName: string; const aFieldName: string): string
Parameters:
- aTableName: table name.
- aFieldName: field name.
QuoteFieldNameIfNeeded protected virtual safecall
Quotes field name if is required.
function QuoteFieldNameIfNeeded(const aTableName: string; const aFieldName: string): string
Parameters:
- aTableName: table name.
- aFieldName: field name.
QuoteIdentifier protected virtual safecall
Quotes identifier.
function QuoteIdentifier(const iIdentifier: string): string
Parameters:
- iIdentifier: identifier.
QuoteIdentifierIfNeeded protected virtual safecall
Quotes identifier if is required.
function QuoteIdentifierIfNeeded(const iIdentifier: string): string
Parameters:
- iIdentifier: identifier.
RecreateMacroProcessor protected
Creates MacroProcessor from scratch
procedure RecreateMacroProcessor
RollbackTransaction protected safecall
Discards a transaction that was started with a prior call to BeginTransaction, via calling of DoRollbackTransaction. All changes made in the context of the transaction will be be discarded and not applied to the physical database. To persist the changes made, instead of discarding them, call CommitTransaction instead.
procedure RollbackTransaction
SetConnected protected virtual safecall
Opens or closes a physical connection to the database back-end,
procedure SetConnected(Value: Boolean)
Parameters:
- Value: state
SetPassword protected virtual safecall
Sets the password.
procedure SetPassword(const Value: string)
Parameters:
- Value: password
SetUserID protected virtual safecall
Sets the user ID.
procedure SetUserID(const Value: string)
Parameters:
- Value: user ID
Test protected virtual safecall
Tests connections.
procedure Test
OnAfterExecuteCommand
Fires right after a command was executed.
property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnAfterOpenDataset
Fires after dataset was opened
property OnAfterOpenDataset: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpenDataset(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnBeforeExecuteCommand
Fires just before a command will be executed.
property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(const Sender: IDASQLCommand)
OnBeforeOpenDataset
Fires before dataset was opened
property OnBeforeOpenDataset: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpenDataset(const Sender: IDADataset)
OnExecuteCommandError
Fires when exception is detected during command execution
property OnExecuteCommandError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteCommandError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)
OnOpenDatasetError
Fired if error was occured duting opening of dataset
property OnOpenDatasetError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenDatasetError(const Sender: IDADataset; ActualSQL: string; Error: Exception)