Skip to main content

JDBC FAQ part2

3: What is  Driver? How many Drivers are available in JDBC? What are the types?
  •    It is a process of interacting with the database from a java application.
  • In JDBC applications we must specify the complete database logic in java application as for the java API representations, later on, we need to send java represented database logic to the database engine(DBE).
  • DBE must execute the database logic but it was configured as per the java representations but DBE able to understand only Query Language representations.
  • At the above situation, if we want to execute our database logic, we need to use one interface in between java application and the database, that interface must convert java representations to query language representations and query language representations to java representations. Now this interface is called as a “Driver”.
Driver:
  • It is a software or an interface existed in between a java application and database, which will map java API calls with query language API calls and vice versa.
  • Initially, sun Microsystems has provided “driver interface” to the market with this sun Microsystems has given an intimation to all the database vendors to have their own implementation as per their requirements for the Driver interface.
  • As a response, all the database vendors are providing their own implementation for the Driver interface in order to interact with the respective databases from a java application.
  • The users of the respective databases they must get the respective database provided Driver implementation from the database software and make use as part of the JDBC applications to interact with the respective databases from a java application.
Types of Drivers:
            There are 180+  number of Drivers in the market. But all these Drivers could be classified into the following 4 types.
  • Type 1 Driver
  • Type 2 Driver
  • Type 3 Driver
  • Type 4 Driver
Type 1 Driver:
    • Type 1 Driver is also called as Jdbc-Odbc Driver or Bridge Driver.
    • Jdbc-Odbc Driver is an implementation of Driver interface provided by the sun Microsystems along with the java software.
    • Jdbc-Odbc Driver internally depends on the Microsoft product Odbc Driver.
    • Odbc is nothing but open database connectivity. It is an open specification which can be used to interact with any type of databases.
Advantages:
  • This Driver is already available with java software that’s why no need to bother about how to get the Driver implementation explicitly.
  • Almost all the databases could support this Driver.
Disadvantages:
  • This Driver internally depends on Odbc Driver that’s why it is not suitable for internet or web applications or network applications.
  • This Driver is a slower Driver, why because Jdbc-Odbc Driver will convert java calls to Odbc calls. Then Odbc Driver has to convert Odbc calls to query language calls.
  • This driver is not portable Driver why because it was not complete the java implementations in Jdbc-Odbc Driver.
  • It we want to use Jdbc-Odbc Driver in our JDBC applications then we must require installing Odbc-Native Library.
Type 2 Driver:
            Type 2 Driver is also called as “part java part native Driver”. i.e., this Driver was designed by using some part of the java implementations and some other part of the database vendor provided native implementations. This Driver is also called as “native driver”.
Advantages:
            When compared to Type 1 driver it is efficient driver why because Type 2 driver directly will convert java API calls to database vendor API calls.
Disadvantages:
  • If we want to use Type 2 Driver in our JDBC applications then we must require installing database vendor native API.
  • It is a boastful Driver.
  • It is not suitable for web applications, distributed applications, and web applications.
  • Type 2 Driver performance is low when compared to Type 3 and Type 4 drivers.
  • This driver is not a portable driver. Why because this driver was not designed completely in java technology.
Type 3 Driver: 
    • It is also called as middleware database access server driver.
    • This driver could be used to interact with multiple databases from the multiple clients.
    • This driver could be used in collaboration with the application server.
    • This driver is suggestable for network applications.
Advantages:
  • It is the fastest driver among all the drivers available in the market.
  • To use Type 3 driver in our JDBC applications it is not required to install the JDBC native library and database native library.
  • It is very much suitable for network applications.
Disadvantages:
  • This driver is not suitable for simple JDBC applications.
  • This driver requires minimum 3-Tier Architecture.
  • When compared to Type1 and Type2 drivers. The type3 driver is efficient and portable. But when compared to a Type4 driver, the Type3 driver is not portable.
Type 4 Driver:
    • This driver is also called as pure java driver i.e, this driver was completely implemented by using java technology.
    • When compared to Type1, Type2, and Type3 drivers. A type4 driver is a portable driver.
    • The type4 driver can be used for any kind of applications.
    • The type4 driver is the cheapest driver when compared to all the drivers that're why it is frequently used the driver.


Comments

Popular posts from this blog

JSTL-JSP Standard Tag Library part 1

Evolution of JSTL: Java is a flexible, general-purpose programming language, JavaServer pages(JSP) depends on java but hides some of the hard details of writing full- fledged programs.  The JSP Standards Tag Library(JSTL) builds on top of JSP, making it even easier to use. Architecture : In this figure large web applications are designed using java, JSTL, and othe components like databases. In large applications, it's common for requests from web browser to be handled by a java program called a servlet, which interacts with databases and other Java code on the server. The servlet figures out how it wants a response be printed and then forwards the user to the right JSTL page, which takes care of nothing more than presenting information. As JSP grew in popularity, it became clear that different sites' custom tags fell into familiar, frequently used patterns.  For example, many pages needed to loop over data to print tables and lists. Vendors of JSP ...

Java Server page tutorial part 3: JSP Life Cycle

JSP Life Cycle: A JSP life cycle can be defined as the entire process from its creation till the destruction which is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet. Following are the steps followed by a JSP Container: ◦ Compilation  ◦ Parsing the JSP.  ◦ Turning the JSP into a servlet.  ◦ Compiling  the servlet.  ◦ Initialization ◦ Execution ◦ Cleanup Architecture: 1.       JSP Compilation: When a browser asks for a JSP, the JSP engine first checks to see whether it needs to compile the page.  If the page has never been compiled, or if the JSP has been modified since it was last compiled, the JSP engine compiles the page. The compilation process involves three steps: ◦ Parsing the JSP. ◦ Turning the JSP into a servlet.  ◦ Compiling the servlet.  2.       JSP Initialization: When a container loads a JSP ...

OPERATION MANUAL FOR RS232 TO RS422/RS485 VICE-VERSA

INTRODUCTION: Milestone model LD-15U is a RS232,  to RS422/RS485 converter is designed for high-speed data transmission between computer system and or peripherals over Iong distance under high noise conditions. They provide dual line interface per signal. APPLICATIONS: Application for these converters can be for factory automation, Programmable logic controllers,, attendance recording systems, Barcode Readers, remote data transmission, remote terminals, EPABX etc. SPECIFICATIONS: Input: RS232-T×D, R×D, DSR (for control), GND (D9 Female connector) Output: RS422/RS485-Tx+, Tx-, Rx+. Rx-(D9 Male Connector). Each signal is protected by spike suppressor, fuse and has opto-isolation. Selection Switch: 1. Rear side has 2-way'SELECT' switch for selecting 2-Wire or 4-Wire mode in RS422/RS485 application. 2. (Optional) Rear side has 3-way'SELECT' switch for selecting AUTO Mode (No Handshake Signal), DSR+ Mode (+12V Control) and DSR-Model (-_12V Control) for co...