title: Insert integer from a jsp form into a database table?
body: <p>See my code below...</p>
  
  <pre><code>//connect
  //reading params from the form
  String name = request.getParameter("name");
  String year_prime = request.getParameter("year");
  int year = Integer.parseInt(year_prime);
  
  //inserting the params into table Students
  stmt.executeUpdate("insert into students(name,year) values('"+name+"', year)");
  
  //close connection
  </code></pre>
  
  <p>I am trying to get the <code>year</code> value, which is an <code>int</code>, and insert it into a database table. However I am getting an error, and the INSERT methods only seem to work with <code>Strings</code>. Could someone please help me with this problem.</p>