Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the, Slides of Database Programming

An introduction to JDBC (Java Database Connectivity) and its architecture. It explains the different types of JDBC drivers and their advantages and disadvantages. It also covers the JDBC Driver Manager and how to establish a connection to a database using JDBC. Additionally, it discusses the different types of statements in JDBC, including Statement, PreparedStatement, and CallableStatement, and how to use them. Finally, it briefly touches on using properties files to connect to a database.

Typology: Slides

2019/2020

Available from 06/06/2023

harshitha-maddukuri
harshitha-maddukuri 🇮🇳

1 document

1 / 68

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Presentation by:
peakabo
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44

Partial preview of the text

Download JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the and more Slides Database Programming in PDF only on Docsity!

Presentation by:

peakabo

JDBC

Java Data Base Connectivity

JDBC SERVER

It is independent of O.S. which is specific to JRE.

JDBC is an API with set of classes and interfaces

present in package java.sql

JAVA APP

DB

JDBC JRE DRIVER C L I E N T JAVA APP

DB

DRIVER SERVER JDBC JRE C L I E N T

JDBC API Application JDBC Driver A JDBC Driver Manager JDBC.ODBC BRIDGE ODBC JDBC Architecture JDBC Driver B DB DB DB

JDBC-ODBC Bridge Driver *A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. *Some ODBC native code and in many cases native database client code must be loaded on each client machine that uses this type of driver. *Type 1 drivers are "bridge" drivers. They use another technology such as Open Database Connectivity (ODBC) to communicate with a database. This is an advantage because ODBC drivers exist for many Relational Database Management System (RDBMS) platforms. The Java Native Interface (JNI) is used to call ODBC functions from the JDBC driver.

JDBC-ODBC Bridge Driver

JAVA

APP

DB JDBC-ODBC BRIDGE J D B C O D B C

C L I E N T

SERVER

  • (^) Advantages:

Almost any database for which ODBC driver is

installed, can be accessed.

Disadvantages:

  • (^) Performance overhead since the calls have to

go through the JDBC overhead bridge to the

ODBC driver, then to the native database

connectivity interface.

  • (^) The ODBC driver needs to be installed on the

client machine.

  • (^) Considering the client-side software needed,

this might not be suitable for applets.

  • (^) Advantage

Better performance than Type 1 since no

jdbc to odbc translation is needed.

Disadvantages

  • (^) The vendor client library needs to be

installed on the client machine.

  • (^) Cannot be used in internet due the client

side software needed.

  • (^) Not all databases give the client side library.

Native-API Partly Java Driver

ORA

CLE

SQL

Server OCI DB Library J D B C JAVA App C L I E N T SERVER

Functions:

  • (^) This type of driver converts JDBC calls into calls to the client API for that database.
  • (^) Client -> JDBC Driver -> Vendor Client DB Library -> Database

Net-Protocol Fully Java Driver JDBC Driver 1 Middle ware Appli cation

ODBC

OCI

DB

Library JAVA App JAVA App JDBC Driver 2

DB

Ora cle SQL Ser

CLIENT SERVER

APPLICATION SERVER Protocol 1 Protocol 2

Functions

  • (^) Follows a three tier communication approach.
  • (^) Can interface to multiple databases - Not vendor specific.
  • (^) The JDBC Client driver written in java, communicates with a middleware-net-server using a database independent protocol, and then this net server translates this request into database commands for that database.
  • (^) Thus the client driver to middleware communication is database independent.
  • (^) Client -> JDBC Driver -> Middleware-Net Server -> Any Database.
  • (^) Disadvantages
  • (^) Requires database-specific coding to be done in the middle tier.
  • (^) An extra layer added may result in a time-bottleneck. But typically this is overcome by providing efficient middleware
  • (^) This driver converts JDBC calls into the

network protocol used by DBMSs directly.

  • (^) This allows a direct call from the client to

the DBMS server and is a practical solution

for Intranet access.

  • (^) As protocols are proprietary to database

vendors, they will be the primary source

for this style of driver.

  • (^) Several database vendors have these in

progress.

Native-Protocol Fully Java Driver