GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  JDBC

 Print  |  
Question:  What is difference b/w Type-1 and Type-4 JDBC Driver with Example ?

Answer: Give me brief description with small Example


July 07, 2008 11:57:50 #3
 konnipati.sivaa   Member Since: October 2007    Total Comments: 6 

RE: What is difference b/w Type-1 and Type-4 JDBC Driver with Example ?
 

JDBC is a specification, it acts as a vehicle for exchanging SQL statements
between Java application and the database. JDBC API follows two packages

1. java.sql (JDBC Core API)

2. javax.sql (JDBC Ext API)


There are four types of drivers

1. JDBC-ODBC BridgeDriver

2. Native-API partly Java Driver

3. JDBC-Net-protocol Java Driver

4. Native-protocol Java Driver


Type 3,4 are pure Java drivers

Type 1 is common drivers

Type 1,3 data independent drivers

Type 2,4 are data base dependent


Type 1 : Driver is does not connect normal database its only connect RDBMS
system only


java application--->Bridge Driver-------->any database


Drawbacks:

1. We are try to connect our database its not connect java program to database

2. JDBC is normal program (non pointer). our ODBC is implemented pointer
concept. that is why internal conversion means pointer to non pointer takes
place

3. Its very slow compare to all

4. We need to install client libraries from db system into client system


JDBC driver class Name: sun.Jdbc.Odbc.JdbcOdbc Driver

Jdbc URL: Jdbc:Odbc:


Type 4: is Native - Protocol it is pure java Driver


javaApplication---->type4 Driver-------->single DataBase


This driver will use the database prorocol in order to connect database
directly driver does not connect any connection in middle .so it is Fast
compared to all It is two tier Architecture


Type 4 driver class Name: Oracle.Jdbc.driver.OracleDriver

Type4 Driver URL: Jdbc:Oracle:thin:@localhost:number:


From

konnipati.sivakumar

     

 

Back To Question