JDBC
JDBC stands for Java Database Connectivity. It was developed by Sun Microsystems in java language. It is available in API.
JDBC is used to develop applications using database without considering the nature of the database. In order to connect our application with the actual data base, we require a interface and it is called driver. The driver translates the calls from JDBC API to the calls required by the actual database. By changing the drivers the same application can be used to access other databases.
The important classes and interfaces of JDBC are available in the package java.sql and are given below.
| java.sql.DriverManager | – | class |
| java.sql.Connection |
– | interface |
| java.sql.Statement | – | interface |
| java.sql.PreparedStatement | – | interface extending statement |
| java.sql.CallableStatement | – | interface extending prepared statement |
| java.sql.Resultset |
– | table |
| java.sql.SQLException | – | Exception |
| java.sql.SQLWarning | – | Exception |
JDBC Drivers:
Drivers are an interface which is used to connect the JDBC with the RDBMS. There are four types of drivers. They are
JDBC – ODBC Bridge:
This is a driver which interfaces the JDBC API with the data base through ODBC. The ODBC driver and the bridge code must present in the users machine
Native – API-Partly- Java Driver:
This is a driver which interfaces the JDBC API with the data base, through the data base vendors driver. That is the driver is not developed by java. But it is purchased from database vendors and embedded with the JDBC. This driver is better than the bridge driver because it interfaces directly with the database without using ODBC.
JDBC - Net- All- Java Driver:
This interface uses a driver written in java. This converts the JDBC call into an independent protocol. This protocol is then passed to web or to a server(middle man).
The middle man contains type1 or 2 drivers. Using this the JDBC application can access any database. This driver is 100% based. So by this we can implement any type of application using JDBC. The driver used in the web or server(middle man) is not necessary to be of 100% java.
Native-Protocol-All-Java Driver:
In this type of driver all the mechanism needed for connecting the database is available inside the JDBC. So this can directly interact with the RDBMS. This interface is 100% java. This driver is available in all the supported RDBMS.
| Name* : |
|||||
| Email* : |
|||||
| Country* : |
|||||
| Phone* : |
|||||
| Subject* : |
|||||
| Upload Homework : Upload another homework (upto 5 uploads max.)
|
|||||
| Due Date |
Time |
AM/PM |
Timezone |
||
| Instructions |
|||||
|
|||||