def fetchData(self,req,tblName):
    try:
      res = fetchDataSrvResponse()
      db_username,db_password=self.getLogin()
      con = mdb.connect('localhost', db_username, db_password, 'RappStore');
      cur = con.cursor()
      returncols=self.constructCommaColumns(req.req_cols)
      where=self.constructAndQuery(req.where_data)
      query="SELECT "+returncols+" FROM "+tblName+where
      cur.execute(query)
      result_set = cur.fetchall()
      for i in range(len(result_set)):
        line=StringArrayMsg()
        for j in range(len(result_set[i])):
          temp_s=String(result_set[i][j])
          line.s.append((str(result_set[i][j])))
        res.res_data.append(line)

      con.close()
      if (returncols=="*"):
        res.res_cols=self.getTableColumnNames(tblName)
      else:
        res.res_cols=req.req_cols
      res.success.data=True
      res.trace.append("Success")
    except mdb.Error, e:
      res.trace.append(("Database Error %d: %s" % (e.args[0],e.args[1])))
      res.success.data=False
      print "Error %d: %s" % (e.args[0],e.args[1])
    except __HOLE__:
      res.trace.append("Wrong Query Input Format, check for empty required columns list or wrong/incomplete Query data format")
      res.success.data=False
      print "Wrong Query Input Format, check for empty required columns list or wrong/incomplete Query data format"
    except IOError:
      print "Error: can\'t find login file or read data"
      res.success.data=False
      res.trace.append("Error: can\'t find login file or read data")
    return res

  ## @brief Implements the whatRappsCanRun service
  # @param req [rapp_platform_ros_communications::whatRappsCanRunSrvResponse::Request&] The ROS service request
  # @param tblName [string] the table name
  # @param res [rapp_platform_ros_communications::whatRappsCanRunSrvResponse::Response&] The ROS service response
dataset/ETHPy150Open rapp-project/rapp-platform/rapp_mysql_wrapper/src/mysql_wrapper.py/MySQLdbWrapper.fetchData