title: where clause SQL in JSP
body: <p>Could anyone tell me why my SQL statement does not work in JSP. I copy the output of the string to oracle, it works as intended. Is this statement correct? </p>
  
  <pre><code>ResultSet rs = stmt.executeQuery("SELECT disc||crs_num FROM crs_sec_schedule_reader where'" +sqlString+"' ");
  </code></pre>
  
  <p>Following is the detail of the codes:</p>
  
  <pre><code>String sqlString;
  
  sqlString = "crs_sec_schedule_reader.semester = '" + semesterAdjusted+"' ";
  
  
  if(!department.equals( "Select All"))
  {
  sqlString += " and discipline_schedule_reader.discipline_name = '" + department+"'";
  }
  
  if (div_undr.equals("null") &amp;&amp; div_grad.equals("G"))
  {
  sqlString += "and crs_sec_schedule_reader.D_E_G ='" + "G"+"'";
  }
  else if (div_undr .equals("U") &amp;&amp; div_grad.equals( "null"))
  {
  sqlString += " and (crs_sec_schedule_reader.D_E_G = '"+ "D" +"' or     
  crs_sec_schedule_reader.D_E_G ='" + "E"+"')";
  }
  else
  {
  sqlString += "and (crs_sec_schedule_reader.D_E_G = '" + "D" + "' or  
  crs_sec_schedule_reader.D_E_G ='" + "E"+"'or crs_sec_schedule_reader.D_E_G = '"+"G" 
  +"') ";
  }
  
  
  
  .....
  
  ResultSet rs = stmt.executeQuery("SELECT disc||crs_num FROM crs_sec_schedule_reader    
  where'" +sqlString+"' ");
  </code></pre>