title: Type mismatch: Cannot convert from java.sql.statement to com.mysql.jdbc.Statement
body: <p>This is the code I am working with to connect to a mysql database.</p>
  
  <p>I am getting this error: Type mismatch: Cannot convert from java.sql.statement to com.mysql.jdbc.Statement</p>
  
  <p>The line:  Statement getData=con.createStatement(); //ERROR HERE</p>
  
  <p>Do I have a class loading issue? </p>
  
  <pre><code>//connect to database
  
  import java.sql.Connection;
  import java.sql.Driver;
  import java.sql.DriverManager;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.Date;
  
  import com.mysql.jdbc.Statement; 
  
  
  
  public class dbconn {
      public static void main(String args[]) {
  
          String username = "username";
          String password = "password";
          String url = "jdbc:mysql://localhost:3306/Databasename";
  
          try {
  
          Class.forName("com.mysql.jdbc.Driver");
          Connection con=DriverManager.getConnection(url, username, password);
          Statement getData=con.createStatement(); //ERROR HERE
          ResultSet rs = getData.executeQuery("select * from MY_TABLE_NAME");
          while(rs.next())
              System.out.println(rs.getDate(1));
          con.close();
  
      }catch(Exception e) {System.out.println(e);}
  
  
      }
  
  
  }
  </code></pre>