java database connectivity
JDBC:
JDBC stands for Java DataBase
Connectivity.
JDBC is a specification for developing
database applications with Java programming language.
Database Application:
An application that communicates with
database is known as database application.
Application:
An application is a program in which
we interact with on the desktop.
Database:
A database is a software and it is an organized
collection of data.
Data organized in a database in the
form of tables.
Each table contains fields and
records.
Application is a front end &
database is a back end.
Application uses SQL to communicate
with database.
SQL:
SQL stands for Structured Query
Language.
It is used by an application to communicate with database.
Database software
contains two parts:
1) Database Application(Example:
SQL*Plus)
2) Database(Example: Oracle)
List of databases:
1) Oracle
2) MySQL
3) MS-SQL Server
4) MS-Access
5) DB2
6) Derby
7) Sybase
8) DBase
9) FoxPro
10) Visual FoxPro .. etc.,
Application is called as client and
database is called as server.
Client:
A client is a software that sends the
request to server to get the response.
Server:
A server is a software that receives
request from the client, process the request, constructs the response and sends
the response back to a client.
Driver:
A driver is a software and it is used
to connect application & database.
Specification:
A specification is a set of rules
& guidelines that are used to develop environments & applications.
JDBC specification used by vendors to
develop drivers.
JDBC specification also used by Java
programmers to develop database applications.
There are four types of
JDBC drivers:
1) Type-I Driver(JDBC ODBC Bridge
Driver)
2) Type-II Driver(JDBC Native API
Driver)
3) Type-III Driver(JDBC Network
Protocol Driver)
4) Type-IV Driver(JDBC 100% Pure Java
Driver)
1) Type - I Driver(JDBC
ODBC Bridge Driver):
Driver Class Name:
sun.jdbc.odbc.JdbcOdbcDriver
Driver Location:
rt.jar file in JDK 1.7 & below
versions.
Note: This driver removed from JDK1.8
& above versions.
rt=> Run Time jar=> Java ARchive
JDK=> Java Development Kit(It is a Java Software)
JAR file location:
C:\Program Files\Java\jdk1.7\jre\lib
Driver Vendor:
Sun Microsystems
Uniform Resource Locator(URL) to
access the driver:
jdbc:odbc:dsn
jdbc=> protocol odbc=> sub protocol dsn=> data source name
Note: Type-I Driver developed in C
language
Type - I Driver Functionality:
It converts Java instructions into
odbc understandable format
Advantages of Type-I Driver:
1) It is very easy to connect.
2) Only one driver that supports all
ODBC enabled databases.
Disadvantages of Type-I Driver:
1) Performance overhead since Java
calls should go through via jdbc & odbc drivers.
2) Database client software(ODBC)
needs to be installed on local system.
3) Type 1 driver is a platform
dependant.
Read More
By
Mr. Venkatesh Mansani
No comments:
Post a Comment