TSqlDatabaseConnector

Abstract base class for facilities that can create connections to an SQL database.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TBaseObjectA base class for objects that can be used instead of TObject.
3TSqlDatabaseConnector

Source

Sql.Database.Connector.pas (31)

Description

Use OpenConnection to aquire a connection to an SQL database. Every call to OpenConnection should be matched with a call to CloseConnection to allow specific implementations to properly keep track of the connections that have been published and not have been returned. Please use the following skeleton to protect database connections in case of an exception:

1 2 3 4 5 6 7 Connection := Connector.OpenConnection(); try DoSomethingWith(Connection); finally Connector.CloseConnection(Connection); end;

Implementations of TSqlDatabaseConnector are free to reuse existing connections as long as those connections have been properly returned using a call to CloseConnection.

Methods

ScopeVisibilityResultNameDescription
InstanceprotectedTSqlConnectionSettingsGetSettings()
InstancepublicTTextToText()
InstancepublicTSqlDatabaseOpenConnection()
InstancepublicCloseConnection(Database: TSqlDatabase)
InstancepublicTBooleanIsFileBased()
InstancepublicTBooleanCanConnect()
TypepublicTSqlDatabaseConnectorCreateFor(Settings: TSqlConnectionSettings; Pooling: TBoolean)