Posts

Showing posts with the label JDBC API

JDBC Tutorial in Java: Architecture, API, and Real-World Examples

JDBC (Java Database Connectivity) JDBC (Java Database Connectivity) is a standard Java API that allows Java applications to communicate with a database server. It provides a set of interfaces and classes used to connect to databases, execute SQL queries, and process results. JDBC is part of the Java Standard Edition and is available in the java.sql package, which is included in the rt.jar file. Since it is part of the Java built-in libraries, programmers can directly use JDBC by importing the required classes. What JDBC Does Establishes a connection between a Java program and a database Executes SQL queries (SELECT, INSERT, UPDATE, DELETE) Retrieves and processes data from the database Manages database transactions JDBC API Structure The JDBC API consists of interfaces defined in the java.sql package. These interfaces are implemented by database vendors (such as MySQL, Oracle, PostgreSQL) through JDBC drivers. The JDBC driver acts as a bridge between Java applications and the database...

Application Programming Interface (API): Definition, Types, and Examples in Java

📘 Application Programming Interface (API) An Application Programming Interface (API) is a collection of interfaces, implementation classes, and helper classes that enables communication between two different applications. APIs act as a bridge that allows one software application to interact with another without knowing its internal implementation. An API is generally provided in the form of a JAR (Java Archive) file. Most APIs are developed and maintained by software vendors to allow developers to use their services or features. 🔍 Example of API ✅ JDBC (Java Database Connectivity) JDBC is a standard Java API Used to connect Java applications with a database server Allows execution of SQL queries from Java programs 🧩 Categories of API APIs can be classified into three main categories based on how interfaces and implementations are packaged. 🔹 Category 1 API Interface, implementation classes, and helper classes are present in a single JAR file Easy to use and deploy 📌 Example: Core...