Java Database Connectivity (JDBC) Overview

The JDBC ( Java Database Connectivity ) API developed by Sun Microsystems, which contains interfaces and classes for writing java application to establish database connection. Using JDBC you can execute all SQL (Structured Query Language), PL/SQL or T/SQL with the heterogonous databases. JDBC API is not even use to inserting, updating , deleting and retrieving records but you can also create database objects like; table, view, stored procedure, trigger etc.

You will learn how to insert, update, delete and retrieve records from database. You will also learn to create batch and execute in java, implement transactions in java, scrollable result set, fixed SQL statement, parameterized SQL statement, execute stored procedure in java and information about database and resultset.

JDBC Architecture Diagram
Arch JDBC

This tutorial will guide you to develop JDBC applications using different type of drivers using JDBC API. The JDBC API and JDBC Driver both are different from each other. The JDBC driver is different for different database, like MySQL driver is different than Oracle and it is also different than MS-SQL server.

JDBC API - It contains the common classes and interfaces to work in database, like - Connection, PreparedStatement, Statement, ResultSet, ResultSetMetaData, DatabaseMetaData etc.

JDBC Driver - It is different for different database. Following is the list of common JDBC drivers -

  1. JDBC-ODBC Bridge
    jdbc:odbc:<odbc name>
    sun.jdbc.odbc.JdbcOdbcDriver
     
  2. Microsoft SQL Server
    jdbc:sqlserver://<localhost@<;user=sa;password=sa;database=MyDB
    com.microsoft.sqlserver.jdbc.SQLServerDriver
     
  3. Oracle Thin
    jdbc:oracle:thin:@<host>:<port>:<sid>
    oracle.jdbc.driver.OracleDriver
     
  4. MySQL (MM.MySQL Driver)
    jdbc:mysql://<host>:<port>/<db>
    com.mysql.jdbc.Driver

Complete JDBC Driver List

  Next


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code