Check out example codes for "mitigation of sql injection". It will help you in understanding the concepts better.

Code Example 1

String tableName;
switch(PARAM):
  case "Value1": tableName = "fooTable";
                 break;
  case "Value2": tableName = "barTable";
                 break;
  ...
  default      : throw new InputValidationException("unexpected value provided"

Learn ReactJs, React Native from akashmittal.com