title: Populate jQuery UI autocomplete with data from database using JSP+AJAX
body: <p>I've been trying to get this to work for a couple of days now and I'm not getting anything with the code I have. I have a form that has a textbox that needs to list outside salesmen that I am trying to use autocomplete.</p>
  
  <p>This is the code for the form (doorform2.jsp)</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
      $("#outsideSales").autocomplete({source: "outsideIn.jsp",minLength: 2});
  &lt;/script&gt;
  
  &lt;input type="text" name="outsideSalesman" id="outsideSales" required&gt;
  </code></pre>
  
  <p>This is the code that I am using to get data from my database to use for the autocomplete</p>
  
  <pre><code>&lt;%
  Connection con = null;
  Statement stmt = null;
  ResultSet rs = null;
  
  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  con = DriverManager.getConnection("jdbc:sqlserver://nemesis:1433;instanceName=gfi;databaseName=NationalFormsRepository;user=portal;password=P0rtal");
  stmt = con.createStatement();
  
  String outside = request.getParameter("outsideSalesman");
  
  ArrayList&lt;String&gt; outsideSalesmenNames = new ArrayList&lt;String&gt;();
  String outsideSalesman = "SELECT outsideSalesName FROM tbl_outsideSales WHERE outsideSalesName like '%"+outside+"%'";
  
  rs = stmt.executeQuery(outsideSalesman);
  
  while(rs.next())
  {
      outsideSalesmenNames.add(rs.getString("outsideSalesName"));
  }
  out.println(outsideSalesmenNames);
  
  %&gt;
  </code></pre>
  
  <p>I've tried to follow several tutorials online but most of the ones that I have been following are for php not jsp or they are for older versions of jquery autocomplete. I feel like I am missing something small but have been looking at it to long to see it. Can anyone take a look and see if I am missing anything?</p>