
First of all sorry for the late update of the blog!!!!!Anyway yesterday i thought of writing about the Hibernate-the framework in java but than to know about that we need to know the Java DataBase Connectivity(JDBC) and to know about the JDBC we must know about the different types of drivers.......
So here we are with the different types of drivers.....huum
First thing is WHAT is a driver basically...
Now to interact with the database(any database may be mysql,oracle) you need to have a driver so that this interaction can possibly be done!!!!!in other words the driver basically is responsible for the connection between your program and the dabtabase.....and that's the reason WHY we need driver.
Now when it comes to the types of driver there are basically FOUR types of drivers
- Type one Driver-This driver is also called as brige drive.As shown in the picture (forget about the JDBC api and stuff)what is noticeable is the the Database liberary API's.This type of driver basically needs the support from the Database library API.Not only library but also the ODBC driver is quite noticeable.Hence this type of driver basically needs a ODBC driver support(which can be provided by create a DSN).We will look at this supports in the jdbc connectivity.Because of these when ever you want to move your application from one computer to other you need to install these Database library and also you need to make sure that you have the DSN already been created with the same name as in the other system.From the java prospective this type of driver is basically also called as default driver as this comes with the jdk...i.e.you don't have to update the build path of the application.This is called as bridge driver as it acts as a bridge between the Calling Java Application and the ODBC.So a application has to through the JDBC,which interacts with the ODBC(through the DSN)which in turn interacts with the DataBase...
- Type Two Driver and Type Three Driver-Both these drivers have the DB Directory so these don't basically need the ODBC support....And also these drivers must be provided by the DB vendors that you are using.....These drivers are not at all in use any where including industry....So we will give more importance to the next driver...
- Type Four Driver-This basically is the widely used driver because of the features offered by this driver.The one you can see on the TOP.As you can see all you need is the type 4 driver,nothing else(no ODBC,no DSN and stuff).This type of drivers are basically provided by the DB vendors and you must "update the BuildPath" of the project by adding the external jar files.In case of Oracle you have to include the ojdbc14.jar.... Now to find this jar file you must go to the location where you have installed the Oracle,and in the directory D:\Oracle10GXE\app\oracle\product\10.2.0\server\jdbc\lib you will find the ojdbc14.jar.One very big advantage with the type 4 driver is that it can be used in any system where there is a Oracle database.No library and DSN of the same name all this is not reqiured(as in case of type 1 we need all this stuff).
No comments:
Post a Comment