📄 bolddatabaseadaptermysql.pas
字号:
/////////////////////////////////////////////////////////
// //
// Bold for Delphi //
// Copyright (c) 2003 Borland //
// //
/////////////////////////////////////////////////////////
{ Global compiler directives }
{$include bold.inc}
unit BoldDatabaseAdapterMYSQL;
interface
uses
mySQLDbTables,
BoldAbstractDataBaseAdapter,
BoldDBInterfaces,
BoldMYSQLInterfaces;
type
{ forward declarations }
TBoldDatabaseAdapterMYSQL = class;
{ TBoldDatabaseAdapterMYSQL }
TBoldDatabaseAdapterMYSQL = class(TBoldAbstractDatabaseAdapter)
private
fBoldDatabase: TBoldMYSQLDataBase;
procedure SetDataBase(const Value: TmySQLDatabase);
function GetDataBase: TmySQLDatabase;
protected
procedure ReleaseBoldDatabase; override;
function GetDataBaseInterface: IBoldDatabase; override;
public
destructor destroy; override;
published
property DataBase: TmySQLDatabase read GetDataBase write SetDataBase;
{$IFNDEF T2H}
property DatabaseEngine;
{$ENDIF}
end;
{$R *.dcr}
implementation
uses
SysUtils,
BoldDefs,
BoldRev;
{ TBoldDatabaseAdapterMYSQL }
destructor TBoldDatabaseAdapterMYSQL.destroy;
begin
Changed;
FreePublisher;
FreeAndNil(fBoldDatabase);
inherited;
end;
function TBoldDatabaseAdapterMYSQL.GetDataBase: TmySQLDatabase;
begin
result := InternalDatabase as TmySQLDatabase;
end;
function TBoldDatabaseAdapterMYSQL.GetDataBaseInterface: IBoldDatabase;
begin
if not assigned(Database) then
raise EBold.CreateFmt('%s.GetDatabaseInterface: The adapter is not connected to a database', [classname]);
if not assigned(fBoldDatabase) then
fBoldDatabase := TBoldMYSQLDataBase.create(Database, SQLDataBaseConfig);
result := fBoldDatabase;
end;
procedure TBoldDatabaseAdapterMYSQL.ReleaseBoldDatabase;
begin
FreeAndNil(fBoldDatabase);
end;
procedure TBoldDatabaseAdapterMYSQL.SetDataBase(const Value: TmySQLDatabase);
begin
InternalDatabase := value;
end;
initialization
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -