title: JSP - Connecting and Inserting data to MySQL Database
body: <p>Right, here's my situation, I have a form on a page (index.jsp) which submits data to a JSP page (output.jsp) which will then do things with the data and output a result. I would like to insert the results of this into a MySQL database.</p>
  
  <p>I've tried doing some things with MySQL directly in the JSP but I've been advised against this as it opens security holes, I believe.</p>
  
  <p>So I have created a SubmitServlet.java (by default, Netbeans has put it into Source Packages/default package, opposed to the location of the JSP files, in Web Pages). I understand that I've got to do a lot of the connecting here, though I'm not entirely sure how to get the data submitted into the database from the JSP, to the servlet. What do I need to do?</p>
  
  <p>I have read several tutorials at RoseIndia, but they've only just left me more confused as to what is actually required so any help would be appriciated greatly!</p>
  
  <p>PS: Also worth pointing out I am completely new to Java web applications, so the more you treat me like a complete idiot, the better!</p>