title: Type mismatch: cannot convert from java.sql.Connection to com.mysql.jdbc.Connection
body: <pre><code>import java.io.IOException;
  import java.sql.DriverManager;
  
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import com.mysql.jdbc.*;
  
  *// Here,in below 2 statement, I got 2 the same error as shown in title*
  
  **Connection con = DriverManager.getConnection("localhost:3306", "root","simple");               
  Statement stmt = con.createStatement();**
      if(stmt.execute(sql)){
      System.out.println("Sql Statement Executed.");
      }
      else
      {
          System.out.println("Sql Statement not eexecuted.");
      }
      if((unm != null) &amp;&amp; (pwd != null)){
          RequestDispatcher rd =request.getRequestDispatcher("Home.jsp");
          rd.forward(request, response);
      }
  }
  
  }
  </code></pre>
  
  <p>I am  trying to send my data from servlet to mysql server but in servlet I got the</p>
  
  <p>error : "Type mismatch: cannot convert from java.sql.Connection to com.mysql.jdbc.Connection"</p>
  
  <p>Can anyone suggest me the way to remove the error for  my code. I am not getting any idea.</p>