EF.DB.ODAC
Devart ODAC-based database access layer (Oracle only).
This unit provides an alternative Oracle back-end based on Devart's Oracle Data Access Components (ODAC), for sites that own an ODAC license and prefer it over the OCI/FireDAC path. It does NOT replace EF.DB.FD: Oracle via FireDAC (DriverID = Ora) keeps working exactly as before and remains the default option for sites without ODAC.
Because ODAC is a third-party commercial library, this unit is NOT part of KittoXCore.dpk (which must compile with a plain Delphi install). To enable the 'ODAC' adapter in an application, add EF.DB.ODAC to the application's UseKitto.pas (or project uses clause) and add the ODAC library path to the project search path. Referencing the unit is enough: the adapter self-registers in the initialization section with the ClassId 'ODAC'.
Config.yaml example: <code> ODAC_Oracle: ODAC Connection:
EZ Connect string: host:port/service_name (Oracle XE 21c PDB = xepdb1)
Server: localhost:1521/xepdb1 User_Name: HELLOKITTO Password: 12345
Direct mode connects over Oracle Net without an installed Oracle
client (requires ODAC Professional). Set to False to use OCI.
Direct: True
Oracle has no native boolean: booleans map to NUMBER(1) (0/1).
Charset: AL32UTF8
ConnectMode: Normal (default), SysDBA or SysOper.
ConnectMode: Normal
Optional: ALTER SESSION SET CURRENT_SCHEMA on connect.
Schema: HELLOKITTO </code>
TEFDBODACParams class
Utility class used to adapt the standard TParams to ODAC's TDAParams.
procedure AssignValuesTo(const ADestination: TDAParams;Sets the value of every parameter in ADestination whose name matches the name of a parameter in the current object to that of the current object's parameter, applying Oracle-specific type coercions.
TEFDBODACInfo class
Retrieves metadata from an Oracle database through ODAC. The Oracle data dictionary (USER_* views) is queried directly with SQL, so no dependency is placed on ODAC's own metadata provider.
constructor Create(const AConnection: TOraSession);Creates the info object bound to the given ODAC session.
property Connection: TOraSession read FConnection write FConnection;The ODAC session used to retrieve database metadata.
TEFDBODACConnection class
ODAC implementation of TEFDBConnection (Oracle only), backed by a Devart TOraSession.
procedure AfterConstruction;Creates the internal TOraSession.
destructor Destroy;Destroys the internal TOraSession.
function IsOpen: Boolean;ODAC implementation of TEFDBConnection.IsOpen.
function ExecuteImmediate(const AStatement: string): Integer;ODAC implementation of TEFDBConnection.ExecuteImmediate.
procedure InternalStartTransaction;ODAC implementation of TEFDBConnection.InternalStartTransaction.
procedure InternalCommitTransaction;ODAC implementation of TEFDBConnection.InternalCommitTransaction.
procedure InternalRollbackTransaction;ODAC implementation of TEFDBConnection.InternalRollbackTransaction.
function IsInTransaction: Boolean;ODAC implementation of TEFDBConnection.IsInTransaction.
function FetchSequenceGeneratorValue(const ASequenceName: string): Int64;Fetches the next value of an Oracle sequence generator (sequence.NEXTVAL).
function GetLastAutoincValue(const ATableName: string = ''): Int64;Not surfaced by this adapter; Oracle apps should use sequences. Always returns 0.
function CreateDBCommand: TEFDBCommand;ODAC implementation of TEFDBConnection.CreateDBCommand.
function CreateDBQuery: TEFDBQuery;ODAC implementation of TEFDBConnection.CreateDBQuery.
function GetConnection: TObject;Returns the underlying TOraSession instance.
TEFDBODACCommand class
ODAC implementation of TEFDBCommand (statements returning no result set), backed by a TOraSQL.
procedure AfterConstruction;Creates the internal TOraSQL and its parameters.
destructor Destroy;Destroys the internal TOraSQL and its parameters.
function Execute: Integer;ODAC implementation of TEFDBCommand.Execute; returns the number of affected rows.
TEFDBODACQuery class
ODAC implementation of TEFDBQuery (statements returning a result set), backed by a TOraQuery.
procedure AfterConstruction;Creates the internal TOraQuery and its parameters.
destructor Destroy;Destroys the internal TOraQuery and its parameters.
function Execute: Integer;Execute and Open are synonims in this class. Execute always returns 0.
procedure Open;ODAC implementation of TEFDBQuery.Open; opens the underlying dataset.
procedure Close;ODAC implementation of TEFDBQuery.Close; closes the underlying dataset.
function IsOpen: Boolean;ODAC implementation of TEFDBQuery.IsOpen.
TEFDBODACConnectionConfig class
Devart ODAC (Oracle) connection parameters. YAML path: DatabaseRouter/DatabaseName/Connection
TEFDBODACAdapter class
Database adapter that creates ODAC (Oracle) connections. Self-registers with the adapter registry under the ClassId 'ODAC'.
