ExecuteQuery($query); if (($result) && ($db->GetSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new ServiceLocation(); $config->ServiceName = $serviceName; $config->ServiceURL = $db->GetSQLValue($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 * @param $db database object * @return if successful, ClientToBS object filled with information. NULL otherwise */ function getClientToBS($client, $db) { $query = "SELECT client, bs FROM clienttobs WHERE client = '$client'"; $result = $db->ExecuteQuery($query); if (($result) && ($db->GetSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new ClientToBS(); $config->Client = $client; $config->BS = $db->GetSQLValue($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 * @param $db database object * @return if successful, BSToOPS object filled with information. NULL otherwise */ function getBSToOPS($BS, $db) { $query = "SELECT bs, ops FROM bstoops WHERE bs = '$BS'"; $result = $db->ExecuteQuery($query); if (($result) && ($db->GetSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new BSToOPS(); $config->BS = $BS; $config->OPS = $db->GetSQLValue($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 * @param $db database object * @return if successful, DBConfig object filled with information. NULL otherwise */ function getDBConfig($DBName, $db) { $query = "SELECT dbname, hostname, port FROM dbconfig WHERE dbname = '$DBName'"; $result = $db->ExecuteQuery($query); if (($result) && ($db->GetSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new DBConfig(); $config->DBName = $DBName; $config->DBHostName = $db->GetSQLValue($result, 0, 1); //Get the host name. $config->DBPort = $db->GetSQLValue($result, 0, 2); //Get the port } return $config; } /** * gets DBConfig of active database * @param $db database object * @return if successful, DBConfig object filled with information. NULL otherwise */ function getActiveDBConfig($db) { $query = "SELECT dbname, hostname, port FROM dbconfig WHERE active = 'Y'"; $result = $db->ExecuteQuery($query); if (($result) && ($db->GetSQLValue($result, 0, 0))) //return value is having atleast one row { $config = new DBConfig(); $config->DBName = $db->GetSQLValue($result, 0, 0); //Get the db name. $config->DBHostName = $db->GetSQLValue($result, 0, 1); //Get the host name. $config->DBPort = $db->GetSQLValue($result, 0, 2); //Get the port } return $config; } ?>