Vinay

12
P.VINAY KUMAR 11B61A1234 JDBC Objects

Transcript of Vinay

Page 1: Vinay

P.VINAY KUMAR11B61A1234

JDBC Objects

Page 2: Vinay

JDBC INTRODUCTIONCONCEPTS OF JDBC JDBC DRIVERS TYPE JDBC PACKAGES

Page 3: Vinay

JDBC provides API or PROTOCOL to interact with different DATABASE

With the help of JDBC drivers we can connect with different database.

A JDBC driver works as interface between client and Database server

Page 4: Vinay

Open a connection between the DBMS & J2ME applicationTranslate low-level SQL statements sent by J2ME application into messages that sent by the J2ME application.Return data that conforms to the JDBC specification to the JDBC drivers.Return information, such as error messages that conforms to the JDBC specification to the JDBC drivers.Provide transaction management routines that confirms to the JDBC specification.Close the connection between the DBMS & J2ME application

Concepts of JDBC:

Page 5: Vinay

Java Application

JDBC API

Data Base Drivers

Access SQL

Server

DB2 Informix MySQL Sybase

Page 6: Vinay

Type 1 JDBC-ODBC Bridge

Type 2Native API, partially java

Type 3 JDBC Network Driver, partially java

Type 4100% Java

Page 7: Vinay

Type 1 JDBC to ODBC Driver the JDBC to ODBC Driver, also called the

JDBC\ODBC bridge, is used to translate DBMS calls between JDBC specification & the ODBC specifications.

The JDBC to ODBC driver receives message from a J2ME application.it is platform dependent.

Client JDBC-

ODBCODBC DB

Vendor Library

Page 8: Vinay

Type 2 Java/Native Code Driver The Java/Native Code Driver uses the Java Classes

to generate platform specific code. This code is only understood by a specific DBMS. The disadvantage of this driver is lack of

portability. The API classes of Java/Native Code Driver

probably won’t work for another DBMS.

Client JDBC

Vendor Library

DB

Page 9: Vinay

Type 3 JDBC Driver Type 3 JDBC Driver is also referred as

JAVA protocol, is the most commonly used driver

It converts SQL queries into JDBC statements and translates JDBC formatted statements into DBMS format.

3-TIER ARCHITECTURE

Page 10: Vinay

Type 4 JDBC Driver Type 4 JDBC Driver is also referred as

JAVA Database Protocol, it is similar to Type 3 JDBC Driver.

SQL queries are need not to convert into JDBC-format, Directly translated into format required by DBMS.

This is the fastest way to communicate SQL queries to the DBMS.

It is 100% pure JDBC driver.

Page 11: Vinay

The JDBC API contained in two packages. The first package is called Java.sql and contains

core JDBC interfaces of JDBC API. It provide the basics for connecting to the DBMS

and interacting with data stored in the DBMS. Java.sql is part of J2SE. The second package is called Javax.sql, which

extends the Java.sql and is the part of J2ME. It includes JDBC interface that interfaces with Java

Naming and Directory Interface(JNDI). JDBC interface that manages connection pooling,

among other advanced JDBC features.

Page 12: Vinay

THANK YOU…