title: JDBC connection type 4
body: <p>In jdbc type 4 connection "driver" has been registered but connection has some error i.e.</p>
  
  <pre><code>Connection con=DriverManager.getConnection("jdbc:oracle:@localhost:1521:XE","system","manager");
  </code></pre>
  
  <p><em><strong>error: -incompatible types,found:- java.sql.connection, required :Connection</em></strong> </p>
  
  <pre><code>import java.sql.*;
  class A
  {
      public static void main(String args[])
      {
          try
          {
              Class.forName("oracle.jdbc.driver.OracleDriver");
              Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","manager");
              Statement stmt= con.createStatement();
              ResultSet rset=stmt.executeQuery("Select * from emp");
              while(rset.next())
              {                               
              System.out.println(rset.getInt(1)+"\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+ rset.getFloat (4));
              }
              con.close();
          }
          catch(Exception e)
          {
              System.out.println(e);  
          }
      }
  }
  </code></pre>