title: querying a database with an arraylist
body: <p>I want to query a database using an arraylist value.
  It should return a value from the database the same as one of my arraylist element if it exists.
  I am trying something like this, but it is not working</p>
  
  <pre><code>ArrayList&lt;String&gt;  list  =  new ArrayList&lt;String&gt;();
  list.add("boy");
  list.add("girl");
  Class.forName("com.mysql.jdbc.Driver");
  Connection con = DriverManager.getConnection("url", "root", "");
  Statement st = con.createStatement();
  ResultSet rs = st.executeQuery("Select * from table where keyword= (list)");
  </code></pre>