@@ -24,6 +24,8 @@ interface
24
24
procedure SetLogEvent (const ALogEvent: TLogEvent);
25
25
function GetServerHostName : string;
26
26
procedure SetServerHostName (const AServerHostName: string);
27
+ function GetServerPort : Integer;
28
+ procedure SetServerPort (const AServerPort: Integer);
27
29
end ;
28
30
29
31
TMiniRESTSQLConnectionParamsSQLDb = class (TMiniRESTSQLConnectionFactoryParams, IMiniRESTSQLConnectionFactoryParamsSQLDb)
@@ -35,6 +37,7 @@ TMiniRESTSQLConnectionParamsSQLDb = class(TMiniRESTSQLConnectionFactoryParams,
35
37
FDatabaseName: string;
36
38
FLogEvent: TLogEvent;
37
39
FServerHostName: string;
40
+ FPort: Integer;
38
41
public
39
42
function GetConnectionString : string;
40
43
procedure SetConnectionString (const AConnectionString: string);
@@ -50,6 +53,8 @@ TMiniRESTSQLConnectionParamsSQLDb = class(TMiniRESTSQLConnectionFactoryParams,
50
53
procedure SetLogEvent (const ALogEvent: TLogEvent);
51
54
function GetServerHostName : string;
52
55
procedure SetServerHostName (const AServerHostName: string);
56
+ function GetServerPort : Integer;
57
+ procedure SetServerPort (const AServerPort: Integer);
53
58
end ;
54
59
55
60
TMiniRESTSQLConnectionFactorySQLDb = class (TMiniRESTSQLConnectionFactoryBase)
@@ -568,6 +573,12 @@ procedure TMiniRESTSQLConnectionSQLDb.SetConnectionParams;
568
573
FSQLConnection.Password := FConnectionParams.GetPassword;
569
574
FSQLConnection.DatabaseName := FConnectionParams.GetDatabaseName;
570
575
FSQLConnection.HostName := FConnectionParams.GetServerHostName;
576
+ if (FConnectionParams.GetServerPort > 0 ) and (FConnectionParams.GetDatabaseType = dbtFirebird) then
577
+ begin
578
+ FSQLConnection.HostName := ' ' ;
579
+ FSQLConnection.DatabaseName := FConnectionParams.GetServerHostName + ' /' + IntToStr(FConnectionParams.GetServerPort) + ' :' +
580
+ FConnectionParams.GetDatabaseName;
581
+ end ;
571
582
LStringList.Text := FConnectionParams.GetConnectionString;
572
583
for I := 0 to LStringList.Count - 1 do
573
584
begin
@@ -589,4 +600,14 @@ procedure TMiniRESTSQLConnectionParamsSQLDb.SetServerHostName(const AServerHostN
589
600
FServerHostName := AServerHostName;
590
601
end ;
591
602
603
+ function TMiniRESTSQLConnectionParamsSQLDb.GetServerPort : Integer;
604
+ begin
605
+ Result := FPort;
606
+ end ;
607
+
608
+ procedure TMiniRESTSQLConnectionParamsSQLDb.SetServerPort (const AServerPort: Integer);
609
+ begin
610
+ FPort := AServerPort;
611
+ end ;
612
+
592
613
end .
0 commit comments