This is complete beginners to expert up-to-date JDBC tutorial.
In this tutorial, we will learn the latest features added to JDBC 4+ release.
All the source code examples in this tutorial are developed using JDK 8 with JDBC 4.2.
JDBC stands for Java Database Connectivity, which is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.
In this article, we will learn commonly used methods of the PreparedStatement interface.
In this article, we will learn commonly used methods of the CallableStatement interface.
In this article, we will learn commonly used methods of ResultSet interface with examples.
In this article, we will learn commonly used methods of the ResultSetMetaData interface.
In this article, we will learn commonly used methods of DatabaseMetadata interface.
In this article, we will learn commonly used methods of DriverManager class with examples.
JDBC stands for Java Database Connectivity, which is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.
- Java JDBC API Overview - Overview of JDBC API, java.sql and javax.sql package.
- Steps to Connect a Java Application to Database (JDBC and MySQL) - In this post, I will demonstrate the fundamental steps involved in the process of connecting to a database and executing a query using JDBC API.
- JDBC CRUD Example Tutorial - In this post, you will learn how to CREATE, INSERT, UPDATE, SELECT and DELETE operations using JDBC API.
Examples using JDBC Statement
- JDBC Statement Create a Table Example - Example to create a table using a Statement interface.
- JDBC Statement - Insert Multiple Records Example - Example to insert multiple records in a table using the Statement interface.
- JDBC Statement - Update a Record Example - Example to update a record in a table using the Statement interface.
- JDBC Statement Select Records Example - Example to retrieve records from a table using Statement interface.
- JDBC Statement - Delete a Record Example - Example to delete a record from a table using a Statement interface.
- JDBC Statement - Batch Insert Example - Example to insert records in a batch process via Statement interface.
- JDBC Statement - Batch Update Example - Example to update records in a batch process via Statement interface.
Examples using JDBC PreparedStatement
- JDBC PreparedStatement - Insert a Record Example - Example to insert a record in a table using the PreparedStatement interface.
- JDBC PreparedStatement - Update a Record Example - Example to update a record in a table using the PreparedStatement interface.
- JDBC PreparedStatement - Select Records Example - Example to retrieve records from a table using the PreparedStatement interface.
- JDBC PreparedStatement with a list of values in an IN clause - Example to pass a list of values to IN clause using PreparedStatement interface.
- JDBC PreparedStatement - Batch Insert Example - Example to insert records in a batch process via the PreparedStatement interface.
- JDBC PreparedStatement - Batch Update Example - Example to update records in a batch process via PreparedStatement interface.
Examples using JDBC CallableStatement
- JDBC CallableStatement Stored Procedures Example - Create and use Stored Procedure examples using the CallableStatement interface.
Insert and Retrieve Image Examples
JDBC Transactions
- JDBC Transactions with Example - In this article, you will learn how to use JDBC transactions with examples.
JDBC SQLExceptions Handling
- JDBC Handling SQLExceptions - In this article, we will learn how to handle SQLExceptions while working with JDBC.
JDBC java.sql Package Interfaces and Classes
In this article, we will learn commonly used methods of Connection interface with examples.
In this article, we will learn commonly used methods of Statement interface with examples.In this article, we will learn commonly used methods of the PreparedStatement interface.
In this article, we will learn commonly used methods of the CallableStatement interface.
In this article, we will learn commonly used methods of ResultSet interface with examples.
In this article, we will learn commonly used methods of the ResultSetMetaData interface.
In this article, we will learn commonly used methods of DatabaseMetadata interface.
In this article, we will learn commonly used methods of DriverManager class with examples.
JDBC Batch Processing
- JDBC Batch Update MySQL Example - Example to update records in a batch process using Statement and PreparedStatement interfaces.
- JDBC Batch Insert MySQL Example - Example to insert records in a batch process using Statement and PreparedStatement interfaces.
- JDBC Statement - Batch Insert Example - Example to insert records in a batch process via Statement interface.
- JDBC Statement - Batch Update Example - Example to update records in a batch process via Statement interface.
- JDBC PreparedStatement - Batch Insert Example - Example to insert records in a batch process via the PreparedStatement interface.
- JDBC PreparedStatement - Batch Update Example - Example to update records in a batch process via PreparedStatement interface.
JDBC with In-Memory Databases
JSP with JDBC and MySQL Database
- JSP + JDBC + MySQL Example - In this article, we will build a simple Employee Registration module using JSP, JDBC, and the MySQL database.
- JSP Registration Form + JDBC + MySQL Example - In this article, we will build a simple Employee Registration module using JSP, JDBC, and the MySQL database.
- JSP Login Form + JDBC + MySQL Example - In this article, we will build a simple Login Form using JSP, JDBC, and the MySQL database.
Servlet + JSP + JDBC + MySQL Examples
Web app using JSP, Servlet, MySQL and Hibernate
- JSP Servlet Hibernate CRUD Example // Web application
- JSP Servlet Hibernate Web Application // Web application
- Hibernate Registration Form Example with JSP, Servlet, MySQL // Web application
- Login Form using JSP + Servlet + Hibernate + MySQL Example // Web application
JDBC FAQ
- JDBC Dynamically Insert Multiple Rows to MySQL Example - Example to dynamically insert rows using StringBuilder and PreparedStatement placeholders ?.
- Retrieve column names from java.sql.ResultSet - This article provides how-to to retrieve the column names of a table using the getMetaData() method.
Resource and Useful Links
Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours
Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course