JDBC Overview
JDBC Overview
Contents to be coverd
• What is JDBC?
• Features
• Database support
• Architecture
• Development process
What is JDBC?
• JDBC
• A java API used to connect and execute query with the database.
• Uses drivers to connect with relational database.
Java API
Features
• Provides portable access to various databases
• No need to develop code for different databases
• You can build your own custom SQL statements
• CRUDE (insert, update, select and delete) operations
• Complex SQL queries: inner/outer joins
• Call stored procedures
Databases Supported
• JDBC supports a large number of databases
JDBC Architecture
• JDBC Driver
• Provides connections to a database
• Converts JDBC call to for specific database
• JDBC Driver implementations
• Provided by db vendors and 3rd parties
JDBC Driver Manager
• Driver Manager helps to connect an application based on the
database connection string
• In JDBC 4.0 the JDBC drivers are automatically loaded based on the
class path.
JDBC API
• JDBC API is defined in the following packages
• java.sql and
• javax.sql
• Key Classes
• java.sql.DriverManager;
• java.sql.Statement;
• java.sql.Connection;
• java.sql.ResultSet;
• javax.sql.DataSource; //for pooling connection