JDBC Tutorial

Java database connectivity (JDBC) API provides you to connect any database.

In this tutorial we will show the JDBC 4.0 basic examples with Oracle database.

JDBC Statement interface: java.sql.Statement :

Statement object is used to execute static SQL statement and returns the results it produces.

Examples on JDBC Statement API:

 

JDBC PreparedStatement interface: 

java.sql.PreparedStatement extends Statement

PreparedStatment object represents pre compiled sql statement.

SQL statement is pre compiled and stored in PreparedStatment object. We can execute SQL statement multiple times.

Examples on JDBC PreparedStatement API:

 

JDBC CallableStatement interface:

java.sql.CallableStatement extends PreparedStatement

CallableStatement is used to execute database stored procedures.

Examples on JDBC CallableStatement API:

 

JDBC DatabaseMetaData interface:

Examples on JDBC DatabaseMetaData API:

Leave a Reply

Your email address will not be published. Required fields are marked *