title: How to use mysql-connector-driver with jsp
body: <p>I need to create a login with JSP and so, I need to use <code>mysql-connector-java</code>.</p>
  
  <p>I insert the file jar: <code>mysql-connector-java-5.1.38-bin.jar</code>  into <strong>WEB-INF/lib</strong></p>
  
  <p>and I use this code into the jsp file:</p>
  
  <pre><code>&lt;%@ 
          page import="java.sql.*"
      %&gt;
  
  &lt;%
      String DRIVER = "com.mysql.jdbc.Driver";
      String URL_mioDB = "jdbc:mysql://localhost:3306/ditta";
  
      try
      {
         Class.forName(DRIVER);
      } 
      catch (ClassNotFoundException e) 
      {
         System.err.println("Driver not found" + e);
      } 
  
      Connection connessione = null;
      try
      {
         // apro la connesione verso il database.
         connessione = DriverManager.getConnection(URL_mioDB,"root","");
      } 
      catch (Exception e)
      {
         System.err.println("Error during connection with db : " + e);
      } 
  
      String mail="",pass="",send="",query="";
  
      try
      {
          mail=request.getParameter("email");
          pass=request.getParameter("password");
          send=request.getParameter("send");
  
          out.println("&lt;FORM name='F1' method='post' action='login.jsp'&gt;");
              out.println("Email: &lt;INPUT type='text' name='email' value='' placeholder='mariorossi@gmail.com'&gt;&lt;BR&gt;&lt;BR&gt;");
              out.println("Password: &lt;INPUT type='password' name='password' value=''&gt;&lt;BR&gt;&lt;BR&gt;");
              out.println("&lt;INPUT type='submit' name='send' value='Invia'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;INPUT type='reset' name='reset' value='Reset'&gt;");
          out.println("&lt;/FORM&gt;");
      }
      catch (Exception e)
      {
         System.err.println(e);  
      } 
  
      if(send!=null &amp;&amp; mail!="" &amp;&amp; pass!="")
      {
          query="SELECT * FROM dipendenti WHERE email="+ mail + " AND password=" + pass + "";
  
          Statement statement = connessione.createStatement();
          ResultSet resultSet = statement.executeQuery(query);
          ResultSetMetaData rsmd = resultSet.getMetaData();
  
          for(int i=0;i&lt;=rsmd.getColumnCount();i++)
          {
              out.println(resultSet.getString(i));
              }
      }
  
  %&gt;
  </code></pre>
  
  <p>after that, When I click on the send button the page give me this error:</p>
  
  <p><a href="http://i.stack.imgur.com/pVauT.jpg" rel="nofollow">errors image</a></p>