The Java Database Connectivity (JDBC) API is a collection of classes and interfaces, and is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases and other tabular data sources.
JDBC technology allows you to use the Java programming language to connect to SQL based relational databases and obtain the data available in the databases. Normally, to use JDBC, it will include the following steps:
- Making a connection to a database
- Creating SQL or MySQL statements
- Executing that SQL or MySQL queries in the database
- Viewing & Modifying the resulting records
The post will discuss JDBC by examples:
(Those examples need MySQL JDBC driver. MySQL Connector/J is the official JDBC driver for MySQL. Download MySQL JDBC driver from MySQL site)
- Create JDBC Connection
- JDBC Create Database
- JDBC Drop Database
- JDBC Create Table
- JDBC Drop Table
- JDBC Insert Records Using Statement
- JDBC Insert Records Using PreparedStatement
- JDBC Select Records
- JDBC Update Records Using Statement
- JDBC Update Records Using PreparedStatement
- JDBC Delete Record Using Statement
- JDBC Delete Record Using PreparedStatement
- JDBC Batch Update
- JDBC CallableStatement
(to be continued)