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
Go To First  |  Previous Question  |  
 JDBC  |  Question 135 of 135    Print  
What is difference b/w Type-1 and Type-4 JDBC Driver with Example ?
Give me brief description with small Example


  
Total Answers and Comments: 3 Last Update: July 31, 2008     Asked by: timmireddy 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 29, 2008 02:00:25   #1  
saankhya2003 Member Since: July 2008   Contribution: 4    

RE: What is difference b/w Type-1 and Type-4 JDBC Driver with Example ?
In case of typeI driver, native database libraries have to be installed in the client,this is not a pure java driver. ODBC acts as a bridge.
In case of type4 driver, the database calls are converted to the client calls directly, without the help of any middle ware hence widely used.

 
Is this answer useful? Yes | No
July 30, 2008 01:01:14   #2  
aleemkh Member Since: July 2008   Contribution: 10    

RE: What is difference b/w Type-1 and Type-4 JDBC Driver with Example ?
Type 1 JDBC drivers are  comparatively slow.  They are not pure java drivers. The JDBC calls are converted to ODBC calls . So they are also called as JDBC-ODBC biridge drivers. The the ODBC interacts with database. The other biggest disadvantage is the client or the server should have ODBC installed in it so they are not pure java drivers. The performance is also very slow


Type 4 JDBC drivers are pure java drivers and they are the fastest drivers available.
They dont require ODBC , the JDBC directly interacts with database which makes the process fast. The only disadavantage with TYPE-4 JDBC drivers is that they are speicific to the database . Oracle thin Driver is TYPE-4 JDBC driver which is speicific to only ORACLE database. But this is not an issue as Database provides their own drivers

 
Is this answer useful? Yes | No
July 30, 2008 11:57:50   #3  
konnipati.sivaa Member Since: October 2007   Contribution: 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


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape