Working With Type-4 Driver

Working With Type-4 Driver

Type-4 driver also known as Pure Java Driver OR Thin Driver.

Type-2 and Type-4 Drivers of Oracle having same Jar File, same Driver Class Name, but different JDBC URL’s.

Driver Class Name
oracle.jdbc.driver.OracleDriver oracle.jdbc.OracleDriver

JDBC URL : jdbc:oracle:thin:@localhost:1521:XE

import java.sql.*;
 * @author ashok.mariyala
public class Type4DbConnectDemo { 
   public static void main(String[] args) throws Exception { 
      Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","scott","tiger"); 
      Statement st = con.createStatement();
      ResultSet rs = st.executeQuery("select * from emp");
      while( {

Working With Type-4 Driver
Scroll to top