* Add configconnection to TSQLDBRestConnection

git-svn-id: trunk@41630 -
This commit is contained in:
michael 2019-03-07 13:35:01 +00:00
parent b0535d8d0f
commit b9abb510b8

View File

@ -56,6 +56,7 @@ Type
constructor Create(ACollection: TCollection); override;
Destructor Destroy; override;
Procedure Assign(Source: TPersistent); override;
Procedure ConfigConnection(aConn : TSQLConnection); virtual;
Published
// Always use this connection instance
Property SingleConnection : TSQLConnection Read FConnection Write SetConnection;
@ -879,14 +880,7 @@ begin
if (Result=Nil) then
begin
Result:=CreateConnection;
Result.CharSet:=aConnection.CharSet;
Result.HostName:=aConnection.HostName;
Result.DatabaseName:=aConnection.DatabaseName;
Result.UserName:=aConnection.UserName;
Result.Password:=aConnection.Password;
Result.Params:=Aconnection.Params;
if Result is TRestSQLConnector then
TRestSQLConnector(Result).ConnectorType:=aConnection.ConnectionType;
aConnection.ConfigConnection(Result);
aConnection.SingleConnection:=Result;
end;
end;
@ -1861,6 +1855,18 @@ begin
inherited Assign(Source);
end;
procedure TSQLDBRestConnection.ConfigConnection(aConn: TSQLConnection);
begin
aConn.CharSet:=Self.CharSet;
aConn.HostName:=Self.HostName;
aConn.DatabaseName:=Self.DatabaseName;
aConn.UserName:=Self.UserName;
aConn.Password:=Self.Password;
aConn.Params:=Self.Params;
if aConn is TSQLConnector then
TSQLConnector(aConn).ConnectorType:=Self.ConnectionType;
end;
Procedure InitSQLDBRest;