Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

THE JDBC ARCHIITECTURE FULL COVERED

Beoordeling
-
Verkocht
-
Pagina's
16
Geüpload op
13-11-2024
Geschreven in
2024/2025

Here's a paragraph describing a PDF on Java Programming Theory classes: "This comprehensive PDF guide covers the fundamental concepts and advanced topics of Java programming, serving as a valuable resource for students, professionals, and enthusiasts alike. Spanning over 500 pages, this document delves into the basics of Java syntax, data types, operators, control structures, functions, and object-oriented programming principles. It further explores advanced topics such as multithreading, networking, and database connectivity. With clear explanations, illustrative examples, and practice exercises, this PDF provides an in-depth understanding of Java concepts, including exception handling, file input/output, and graphical user interfaces. Additional topics include Java frameworks, libraries, and best practices for coding, debugging, and testing. Suitable for beginners and experienced programmers, this PDF is an indispensable resource for anyone seeking to master Java programming theory and apply it to real-world applications.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

BCA - JAVA
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2017 ONWARS BATCH
PRORAMMING


What is JDBC?
JDBC or Java Database Connectivity is a specification from Sun microsystems that provides a
standard abstraction (that is API or Protocol) for java applications to communicate with various
databases. It provides the language with java database connectivity standard. It is used to write
programs required to access databases. JDBC along with the database driver is capable of accessing
databases and spreadsheets.
JDBC Architecture

The JDBC API supports both two-tier and three-tier processing models for database access but in
general, JDBC Architecture consists of two layers −

 JDBC API: This provides the application-to-JDBC Manager connection.

 JDBC Driver API: This supports the JDBC Manager-to-Driver Connection.

The JDBC API uses a driver manager and database-specific drivers to provide transparent
connectivity to heterogeneous databases.

The JDBC driver manager ensures that the correct driver is used to access each data source. The
driver manager is capable of supporting multiple concurrent drivers connected to multiple
heterogeneous databases.

Following is the architectural diagram, which shows the location of the driver manager with respect
to the JDBC drivers and the Java application −
1
Page

, BCA - JAVA
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2017 ONWARS BATCH
PRORAMMING


Common JDBC Components

The JDBC API provides the following interfaces and classes −

 Driver Manager: This class manages a list of database drivers. Matches connection requests
from the java application with the proper database driver using communication sub protocol.
The first driver that recognizes a certain sub protocol under JDBC will be used to establish a
database Connection.

 Driver: This interface handles the communications with the database server. You will interact
directly with Driver objects very rarely. Instead, you use Driver Manager objects, which
manages objects of this type. It also abstracts the details associated with working with Driver
objects.

 Connection: This interface with all methods for contacting a database. The connection object
represents communication context, i.e., all communication with database is through
connection object only.

 Statement: You use objects created from this interface to submit the SQL statements to the
database. Some derived interfaces accept parameters in addition to executing stored
procedures.

 ResultSet: These objects hold data retrieved from a database after you execute an SQL query
using Statement objects. It acts as an iterator to allow you to move through its data.

 SQLException: This class handles any errors that occur in a database application.

JDBC Connectivity Model
2
Page

, BCA - JAVA
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2017 ONWARS BATCH
PRORAMMING


Types of JDBC Architecture
The JDBC architecture consists of two-tier and three-tier processing models to access a database. They
are as described below:
1. Two-tier model: A java application communicates directly to the data source. The
JDBC driver enables the communication between the application and the data source.
When a user sends a query to the data source, the answers for those queries are sent
back to the user in the form of results.The data source can be located on a different
machine on a network to which a user is connected. This is known as a client/server
configuration, where the user’s machine acts as a client and the machine having the
data source running acts as the server.
2. Three-tier model: In this, the user’s queries are sent to middle-tier services, from
which the commands are again sent to the data source. The results are sent back to the
middle tier, and from there to the user. This type of model is found very useful by
management information system directors.


Creating JDBC Application
There are following six steps involved in building a JDBC application −
 Import the packages: Requires that you include the packages containing the JDBC
classes needed for database programming. Most often, using import java.sql.* will
suffice.
 Register the JDBC driver: Requires that you initialize a driver so you can open a
communication channel with the database.
 Open a connection: Requires using the DriverManager.getConnection() method to
create a Connection object, which represents a physical connection with the database.
 Execute a query: Requires using an object of type Statement for building and
submitting an SQL statement to the database.
 Extract data from result set: Requires that you use the appropriate method to retrieve
the data from the result set.
 Clean up the environment: Requires explicitly closing all database resources versus
relying on the JVM's garbage collection.
3 Page

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
13 november 2024
Aantal pagina's
16
Geschreven in
2024/2025
Type
College aantekeningen
Docent(en)
Abbas
Bevat
Alle colleges

Onderwerpen

$8.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
academics1

Maak kennis met de verkoper

Seller avatar
academics1 COOPERATIVE ARTS AND SCEINCE COLLEGE
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
3
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen