@@ -24,6 +24,8 @@ interface
2424 procedure SetLogEvent (const ALogEvent: TLogEvent);
2525 function GetServerHostName : string;
2626 procedure SetServerHostName (const AServerHostName: string);
27+ function GetServerPort : Integer;
28+ procedure SetServerPort (const AServerPort: Integer);
2729 end ;
2830
2931 TMiniRESTSQLConnectionParamsSQLDb = class (TMiniRESTSQLConnectionFactoryParams, IMiniRESTSQLConnectionFactoryParamsSQLDb)
@@ -35,6 +37,7 @@ TMiniRESTSQLConnectionParamsSQLDb = class(TMiniRESTSQLConnectionFactoryParams,
3537 FDatabaseName: string;
3638 FLogEvent: TLogEvent;
3739 FServerHostName: string;
40+ FPort: Integer;
3841 public
3942 function GetConnectionString : string;
4043 procedure SetConnectionString (const AConnectionString: string);
@@ -50,6 +53,8 @@ TMiniRESTSQLConnectionParamsSQLDb = class(TMiniRESTSQLConnectionFactoryParams,
5053 procedure SetLogEvent (const ALogEvent: TLogEvent);
5154 function GetServerHostName : string;
5255 procedure SetServerHostName (const AServerHostName: string);
56+ function GetServerPort : Integer;
57+ procedure SetServerPort (const AServerPort: Integer);
5358 end ;
5459
5560 TMiniRESTSQLConnectionFactorySQLDb = class (TMiniRESTSQLConnectionFactoryBase)
@@ -568,6 +573,12 @@ procedure TMiniRESTSQLConnectionSQLDb.SetConnectionParams;
568573 FSQLConnection.Password := FConnectionParams.GetPassword;
569574 FSQLConnection.DatabaseName := FConnectionParams.GetDatabaseName;
570575 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 ;
571582 LStringList.Text := FConnectionParams.GetConnectionString;
572583 for I := 0 to LStringList.Count - 1 do
573584 begin
@@ -589,4 +600,14 @@ procedure TMiniRESTSQLConnectionParamsSQLDb.SetServerHostName(const AServerHostN
589600 FServerHostName := AServerHostName;
590601end ;
591602
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+
592613end .
0 commit comments