title: Implementing java 8 DriverAction Interface
body: <p>I am running simple JDBC demo program where I used DriverAction interface and its deregister method to test its functionality, but I received error for my Dirver class, please find below code and suggest what is missing.</p>
  
  <p>//error -com.mysql can not be resolve to type error</p>
  
  <pre><code>import java.sql.*;
  
  public class Jdbcexample implements DriverAction {
  
      public static void main(String[] args) {
          try {
          Driver driver = new com.mysql.jdbc.Driver();/*com.mysql can not be resolve to type error */
          DriverAction driveraction = new Jdbcexample();
          DriverManager.registerDriver(driver,driveraction);
          Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
          Statement stmt =con.createStatement();
          ResultSet rs =stmt.executeQuery("select* from user");
          while(rs.next()) {
              System.out.println(rs.getInt(1)+""+rs.getString(2)+""+rs.getString(3));
          }
          con.close();
      DriverManager.deregisterDriver(driver);
          }
          catch(Exception e) {
              System.out.println(e);
          }
  
  }
  
      @Override
      public void deregister() {
          System.out.println("Driver is deregistered");
  
      }
  }
  </code></pre>