×
STUDY HARD SO YOU CAN LIVE YOUR LIFE AS YOU WANT.
--Your friends at LectureNotes
Close

Note for Advanced Java and J2EE - j2ee By Shree Sai

  • Advanced Java and J2EE - j2ee
  • Note
  • Gujrat technical University - G.T.U.
  • Computer Science Engineering
  • 33 Views
  • 1 Offline Downloads
  • Uploaded 2 months ago
Shree Sai
Shree Sai
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Advance Java Technology APOLLO INSTITUTE OF ENGINEERING & TECHNOLOGY INFORMATION TECHNOLOGY DEPARTMENT Prepared By: Mr. Nitin K. Kanzariya JDBC Prepared By: Mr. Nitin K. Kanzariya

Text from page-2

Chapter 1: JDBC Introduction Java JDBC is a java API to connect and execute query with the database. JDBC API uses jdbc drivers to connect with the database. Why use JDBC Before JDBC, ODBC API was the database API to connect and execute query with the database. But, ODBC API uses ODBC driver which is written in C language (i.e. platform dependent and unsecured). That is why Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language). What is API API (Application programming interface) is a document that contains description of all the features of a product or software. It represents classes and interfaces that software programs can follow to communicate with each other. An API can be created for applications, libraries, operating systems, etc JDBC Driver JDBC Driver is a software component that enables java application to interact with the database. There are 4 types of JDBC drivers: 1. JDBC-ODBC bridge driver 2. Native-API driver (partially java driver) 3. Network Protocol driver (fully java driver) 4. Thin driver (fully java driver) 1) JDBC-ODBC bridge driver The JDBC-ODBC bridge driver uses ODBC driver to connect to the database. The JDBC-ODBC bridge driver converts JDBC method calls into the ODBC function calls. This is now discouraged because of thin driver. Prepared By: Mr. Nitin K. Kanzariya

Text from page-3

Advantages: o Easy to use. o Can be easily connected to any database. Disadvantages: o Performance degraded because JDBC method call is converted into th o The ODBC driver needs to be installed on the client machine. 2) Native-API driver The Native API driver uses the client-side libraries of the database. The driver converts JDBC method calls into native calls of the database API. It is not written entirely in java. Prepared By: Mr. Nitin K. Kanzariya

Text from page-4

Advantage: o performance upgraded than JDBC-ODBC bridge driver. Disadvantage: o The Native driver needs to be installed on the each client machine. o The Vendor client library needs to be installed on client machine. 3) Network Protocol driver The Network Protocol driver uses middleware (application server) that converts JDBC calls directly or indirectly into the vendor-specific database protocol. It is fully written in java. Advantage: o No client side library is required because of application server that can perform many tasks like auditing, load balancing, logging etc. Disadvantages: o Network support is required on client machine. o Requires database-specific coding to be done in the middle tier. o Maintenance of Network Protocol driver becomes costly because it requires database-specific coding to be done in the middle tier. 4) Thin driver The thin driver converts JDBC calls directly into the vendor-specific database protocol. That is why it is known as thin driver. It is fully written in Java language. Prepared By: Mr. Nitin K. Kanzariya

Lecture Notes