ServiceName = $serviceName; $config->ServiceURL = GetMSSQLValue($result, 0, 1); //Get the url of the service } return $config; } /** * gets connection between client and BS * @param $client client name for which we have to find config details * @return if successful, ClientToBS object filled with information. NULL otherwise */ function getClientToBS($client) { $query = "Set NOCOUNT ON; SELECT CLIENT, BS FROM CLIENTTOBS WHERE CLIENT = '$client'"; $result = ExecuteQuery($query); if (($result) && (GetMSSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new ClientToBS(); $config->Client = $client; $config->BS = GetMSSQLValue($result, 0, 1); //Get the BS name connected to client } return $config; } /** * gets connection between BS and OPS * @param $BS business service name for which we have to find config details * @return if successful, BSToOPS object filled with information. NULL otherwise */ function getBSToOPS($BS) { $query = "Set NOCOUNT ON; SELECT BS, OPS FROM BSTOOPS WHERE BS = '$BS'"; $result = ExecuteQuery($query); if (($result) && (GetMSSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new BSToOPS(); $config->BS = $BS; $config->OPS = GetMSSQLValue($result, 0, 1); //Get the OPS name connected to BS } return $config; } /** * gets DBConfig of given database * @param $DBName database name for which we have to find config details * @return if successful, DBConfig object filled with information. NULL otherwise */ function getDBConfig($DBName) { $query = "Set NOCOUNT ON; SELECT DBNAME, HOSTNAME, PORT FROM DBCONFIG WHERE DBNAME = '$DBName'"; $result = ExecuteQuery($query); if (($result) && (GetMSSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new DBConfig(); $config->DBName = $DBName; $config->DBHostName = GetMSSQLValue($result, 0, 1); //Get the host name. $config->DBPort = GetMSSQLValue($result, 0, 2); //Get the port } return $config; } /** * gets DBConfig of active database * @return if successful, DBConfig object filled with information. NULL otherwise */ function getActiveDBConfig() { $query = "Set NOCOUNT ON; SELECT DBNAME, HOSTNAME, PORT FROM DBCONFIG WHERE ACTIVE = 'Y'"; $result = ExecuteQuery($query); if (($result) && (GetMSSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new DBConfig(); $config->DBName = GetMSSQLValue($result, 0, 0); //Get the db name. $config->DBHostName = GetMSSQLValue($result, 0, 1); //Get the host name. $config->DBPort = GetMSSQLValue($result, 0, 2); //Get the port } return $config; } ?>