KTU OOP Java2024 Scheme • 60M ESE
Last-Minute KTU Examination Preparation

Quick Revision & One-Page Cheat Sheets

Module-wise revision sheets, Java keywords, syntax templates, comparison tables, memory tricks, and your personal saved study bookmarks.

Your Bookmarked Topics (0)

Click “Bookmark” inside any topic note to save high-value topics here for fast revision.

Flagged Difficult Concepts (0)

Use “Flag Difficult” on challenging topics so you can revisit them right before the exam.

MODULE 1 — One-Page Revision Sheet

How Java achieves WORA via bytecode + JVM, core data types/wrappers/arrays/strings/Vector/operators/control flow, OOP 4 pillars + Microservices, and building objects with constructors & this.

Must-Know Definitions

WORA & Bytecode: Compiled .class intermediate instructions runnable unchanged on any OS possessing a JVM.
JDK vs JRE vs JVM: JDK = JRE + Dev tools (javac); JRE = JVM + Runtime libraries; JVM = Virtual bytecode execution engine.
Autoboxing / Unboxing: Automatic compiler conversion between primitives (int) and Wrapper objects (Integer).
Class as ADT: A class is both an instantiable Data Type and hides its internal data behind methods (Abstract Data).
Microservices: Architectural style structuring an app into small, independently deployable services around business domains with decentralized data.

Important Java Keywords & Syntax

staticstatic int count;

Class-level single copy in Method Area; callable without new.

thisthis.x = x; this(10);

Refers to current object; resolves shadowing or chains same-class constructors.

abstractabstract class Shape {}

Incomplete blueprint preventing instantiation.

instanceofobj instanceof Student

Tests object runtime class compatibility.

...void sum(int... v)

Varargs parameter (compiled as array; must be last param).

Simple Java Class with Constructor Overloading & this()
public class Student {
String name;
Student() { this("Unknown"); }
Student(String name) { this.name = name; }
}
Procedural vs OOP
CriterionProcedural (C)OOP (Java)
FocusFunctions / ProceduresObjects (Data + Methods)
ApproachTop-downBottom-up
SecurityGlobal open dataHidden private data (Encapsulation)
Memory Shortcuts & Mnemonics
  • JVM 5 Memory Areas: '2 Shared, 3 Per-Thread': Shared = Method + Heap | Thread = JVM Stack + PC + Native Stack.
  • Widening Order: 'B-S-I-L-F-D': byte -> short -> int -> long -> float -> double.
  • OOP 4 Pillars: 'A-P-I-E': Abstraction, Polymorphism, Inheritance, Encapsulation.
5-Minute Exam Readiness Checklist
  • Draw JVM Architecture (Class Loader -> 5 Runtime Areas -> Execution Engine + JNI).
  • Know all 8 primitives + byte/short promotion to int in expressions.
  • Know String immutability (== vs .equals()) + Vector (Objects only).
  • Know >>> vs >> and && vs &.
  • Know 6 Microservices characteristics + Monolith vs Microservices.
  • Know all 6 uses of this and constructor rules.
Last-Minute 2-Hour Exam Hall Strategy
0:00 – 0:30 (Diagrams)

Revise JVM, Inheritance, Exception Tree, MVC, Delegation Model & JDBC diagrams.

0:30 – 1:00 (Tables)

Memorize Overloading vs Overriding, Interface vs Abstract, Access Matrix & 4 JDBC Drivers.

1:00 – 1:30 (Design)

Practice Bad vs Good SOLID Java code, Singleton, Adapter & Microservices characteristics.

1:30 – 2:00 (Tracing)

Trace constructor order (`super()`), `try-catch-finally`, dynamic dispatch & custom exceptions.

Complete Exam Definitions Glossary (134)

JavaM1

A high-level, class-based, object-oriented, strongly typed programming language and software runtime platform developed at Sun Microsystems (led by James Gosling).

Write Once, Run Anywhere (WORA)M1

Java's portability guarantee: source code compiled once into platform-independent bytecode (.class) executes unchanged on any operating system or processor equipped with a compatible JVM.

Java Naming ConventionsM1

Standardized capitalization and identifier rules (PascalCase for classes/interfaces, camelCase for methods/variables, UPPER_SNAKE_CASE for constants, lowercase dot-separated names for packages) that keep code readable and compliant with KTU standards.

JDK (Java Development Kit)M1

Complete software package needed to develop, compile, debug, and run Java applications. Contains the JRE plus development tools (javac, javap, javadoc, jdb).

JRE (Java Runtime Environment)M1

Software package containing the JVM, standard class libraries, and supporting runtime files needed solely to execute compiled Java programs (contains java, not javac).

Java Compiler (javac)M1

Command-line tool in JDK that checks .java source files for syntax, semantic, and type errors and translates valid source into .class bytecode.

PATH vs CLASSPATHM1

PATH tells the OS shell where JDK executables (javac, java) reside; CLASSPATH tells javac and the JVM where user-defined .class files and third-party .jar libraries are located.

Class Loader SubsystemM1

JVM subsystem responsible for dynamically Loading .class files, Linking (Bytecode Verification, Preparation of static memory, Resolution of symbolic references), and Initializing static variables/blocks.

JIT (Just-In-Time) CompilerM1

Component of the JVM Execution Engine that boosts performance by compiling frequently executed bytecode ('hot spots') directly into native CPU machine code at runtime.

Garbage Collector (GC)M1

Automatic background memory manager inside the JVM Execution Engine that identifies and reclaims Heap objects no longer referenced by any live variable.

Primitive Data TypeM1

One of Java's 8 built-in non-object value types (byte, short, int, long, float, double, char, boolean) whose size and range are fixed across all platforms.

LiteralM1

A fixed constant value written directly in source code, belonging to one of 6 categories: integer (100, 0x1F, 012), floating-point (3.14f, 1.2e5), boolean (true, false), character ('A', '\u0064'), string ("KTU"), or null (for references only).

Overflow and UnderflowM1

Condition where an arithmetic result exceeds the maximum (Overflow) or drops below the minimum (Underflow) range of an integer type, causing silent two's-complement wrap-around without throwing an exception.

Widening Conversion (Implicit Casting)M1

Automatic conversion of a smaller compatible primitive type into a larger type (byte -> short -> int -> long -> float -> double, and char -> int) without data loss.

Narrowing Conversion (Explicit Casting)M1

Manual conversion of a larger type to a smaller type ((targetType) value) required when precision or range may be lost (truncation).

Wrapper ClassM1

One of 8 classes in java.lang (Byte, Short, Integer, Long, Float, Double, Character, Boolean) that encapsulates a primitive value into an immutable object.

Autoboxing and UnboxingM1

Compile-time automatic conversion performed by javac between a primitive type and its corresponding wrapper class (int <-> Integer).

ArrayM1

A fixed-length, indexed data structure (treated as a reference object in Java) that stores homogeneous elements in contiguous logical order starting at index 0.

Jagged (Ragged) ArrayM1

A multidimensional array in Java where individual rows are allocated independently with varying column lengths (e.g., row 0 has 2 elements, row 1 has 4 elements).

java.lang.StringM1

A final, immutable class representing a sequence of characters. String literals are stored in a shared Heap memory region called the String Constant Pool.

String ImmutabilityM1

Design property where a String object's character sequence cannot be modified after creation; operations like replace() or concat() return a newly created String object.

java.util.VectorM1

A legacy, synchronized dynamic array class in java.util capable of growing/shrinking at runtime and storing heterogeneous or generic object references.

Operator PrecedenceM1

Priority hierarchy determining which operator executes first in an expression containing multiple operators of differing priority (e.g., * before +).

AssociativityM1

Evaluation direction (Left-to-Right or Right-to-Left) used when adjacent operators share the exact same precedence level (e.g., 6 / 2 * 3 evaluates (6 / 2) * 3 = 9 Left-to-Right; a = b = 5 evaluates a = (b = 5) Right-to-Left).

Unsigned Right Shift (>>>)M1

Java-specific bitwise shift operator that shifts bits right and ALWAYS fills vacated leftmost bits with 0 (unlike signed >>, which preserves the sign bit).

Selection Statements (if, switch)M1

Control structures that route execution along distinct branches depending on a boolean condition (if) or equality match against constants (switch).

Enhanced for-each LoopM1

Iteration syntax for (type var : collection) (introduced in Java 5) that sequentially traverses arrays and collections using a read-only iteration variable.

Labeled breakM1

A civilized replacement for goto in Java (break labelName;) used to break directly out of nested outer loops or labeled blocks.

Method (Function in OOP)M1

A named block of code declared inside a class that defines an object's behavior, accepting zero or more parameters and optionally returning a value.

Command-Line ArgumentsM1

Space-separated tokens passed immediately after the class name when launching a program (java MyApp arg1 arg2), stored automatically as Strings in main(String[] args).

Varargs (Variable-Arity Method)M1

A method parameter declared with ellipsis (type... name) enabling the method to receive zero or more arguments of that type, treated internally as a standard array.

ClassM1

A user-defined blueprint or template that groups state (fields/variables) and behavior (methods/constructors) common to a set of objects.

Abstract ClassM1

A class declared with the abstract modifier that cannot be directly instantiated (new), designed to share common fields/methods while optionally leaving abstract methods (without body) for subclasses to implement.

InterfaceM1

A reference type declared with interface specifying what a class must do (contract of abstract methods + constants) rather than how it does it; a single class can implement multiple interfaces.

Object-Oriented Programming (OOP)M1

A programming paradigm that models software as a collection of interacting objects, where each object combines internal data (attributes) and allowed operations (methods).

Procedural Programming ParadigmM1

A top-down paradigm (e.g., C, Pascal) focused on step-by-step procedures/functions operating on separate data structures, often exposing data globally.

Class as an Abstract Data Type (ADT)M1

A class satisfies both requirements of an ADT: (1) it is a Data Type defining a set of values and operations that can be instantiated into objects, and (2) its internal data representation is Abstracted (hidden) behind methods.

Abstraction (Data & Feature Abstraction)M1

Mechanism of exposing only relevant functionality to the user while suppressing internal implementation details. Includes Data Abstraction (hiding how an object stores private data) and Feature Abstraction (inheritance hierarchies retaining common traits).

EncapsulationM1

Mechanism of wrapping data (variables) and the code manipulating it (methods) into a single unit (class), restricting direct external access to prevent misuse.

InheritanceM1

Mechanism whereby a subclass acquires the attributes and behaviors of an existing superclass, supporting hierarchical classification and code reusability.

PolymorphismM1

Greek for 'many forms'; ability of an entity or method call (one interface, multiple methods) to exhibit different behaviors depending on parameter types (static/compile-time) or actual runtime object type (dynamic/run-time).

Monolithic ArchitectureM1

Traditional software architecture where all UI, business logic, and data access components are tightly compiled and deployed together as a single unified codebase/artifact.

Microservices ArchitectureM1

Architectural style that structures an application as a collection of small, autonomous, loosely coupled services modeled around distinct business domains, each owning its own data and communicating via lightweight network APIs.

ObjectM1

A runtime instance of a class possessing three characteristics: State (field values), Behavior (methods), and Identity (unique runtime existence/memory reference).

Object Reference VariableM1

A variable of a class type (e.g., Student s1) that holds the memory reference (address handle) of an object on the Heap, or null if pointing to nothing.

The new OperatorM1

Operator that dynamically allocates Heap memory for an object at runtime, initializes default field values, executes the class constructor, and returns the object's reference.

ConstructorM1

A special member block inside a class with the exact same name as the class and no explicit return type, automatically invoked by new to initialize a newly created object.

Default vs No-Arg ConstructorM1

A Default Constructor is automatically inserted by javac with an empty body ONLY if you define ZERO constructors. A No-Arg Constructor is explicitly written by the programmer with ClassName() { ... }.

Constructor OverloadingM1

Defining multiple constructors within the same class having distinct parameter lists (different number, data types, or order of parameters) to allow flexible object initialization.

Access ModifiersM1

Keywords (public, private, protected, or omitted default/package-private) controlling visibility of classes, constructors, fields, and methods across classes and packages.

The this KeywordM1

An implicit reference variable inside instance methods and constructors that refers to the current object on which the method or constructor was invoked.

PolymorphismM2

OOP ability of an interface or method name to take multiple forms ('one interface, multiple methods'), resolved either statically at compile time or dynamically at runtime.

Compile-Time Polymorphism (Static Binding)M2

Polymorphism resolved entirely by javac during compilation based on method signatures and argument types (e.g., Method Overloading and Constructor Overloading).

Method OverloadingM2

Defining two or more methods within the same class (or inherited hierarchy) sharing the same name but possessing different parameter lists (number, type, or sequence of parameters).

Object as ParameterM2

Passing a class-type reference into a method or constructor (e.g., boolean equalTo(Test o) or copy constructor Box(Box ob)).

Java Argument Passing (Call-by-Value of References)M2

Java passes a copy of every argument onto the callee's stack frame. For primitives, changes never affect the caller; for objects, the copied reference still points to the caller's Heap object, allowing field mutation (often casually described in older textbooks as behaving like call-by-reference for object state).

RecursionM2

The process of defining a solution in terms of itself; a Java method that invokes itself directly or indirectly is called a recursive method.

Base Case (Termination Condition)M2

An if condition inside a recursive method that returns directly without making further recursive calls, stopping infinite recursion.

Static Variable (Class Variable)M2

A field declared with static outside methods; allocated once in the Method Area at class-loading time and shared across all instances of the class.

Static MethodM2

A method declared with static that belongs to the class itself (ClassName.method()), callable without creating an object. Cannot access non-static members directly or use this/super.

Static BlockM2

A static { ... } initializer block executed automatically once when the class is first loaded into JVM memory—prior to main() and any object creation.

Final VariableM2

A variable marked final whose value cannot be reassigned once initialized (Java's named constant). Combined with static, forms a class constant (static final).

Nested Class / Inner ClassM2

A class declared within the body of another class (or method). Non-static nested classes are termed Inner Classes; static ones are termed Static Nested Classes.

Anonymous Inner ClassM2

A nameless local class declared and instantiated in a single expression (new Interface() { ... };), widely used in Swing/event handling and threads.

Superclass (Base / Parent Class)M2

A general class whose common attributes and methods are inherited by one or more derived classes.

Subclass (Derived / Child Class)M2

A specialized class declared with extends SuperClass that inherits accessible members of the superclass and adds or overrides specialized members.

The Diamond Problem (Multiple Inheritance Ambiguity)M2

Ambiguity arising when a subclass inherits from two superclasses that both inherit from a common ancestor or define conflicting implementations of the same method (show()).

The super KeywordM2

A reference keyword inside a subclass pointing to its immediate superclass, used to invoke superclass constructors (super(args)) and access hidden superclass fields or overridden methods (super.member).

protected Access ModifierM2

Visibility level granting access to the declaring class, all classes in the same package, AND all subclasses—even if those subclasses live in DIFFERENT packages.

Constructor Chaining Across InheritanceM2

Automatic or explicit invocation of superclass constructors from every subclass constructor via super(...), ensuring base layers are fully initialized before derived layers execute.

Method OverridingM2

Defining a method in a subclass with the exact same name, parameter signature, and compatible (same or covariant) return type as a method in its superclass, replacing the superclass implementation for subclass objects.

Dynamic Method DispatchM2

Runtime polymorphism mechanism whereby a call to an overridden method through a superclass reference variable is resolved by the JVM at runtime based on the actual object type being referenced.

final MethodM2

A method declared with the final modifier (final void verify()) that CANNOT be overridden by any subclass, ensuring consistent behavior and allowing early binding optimization.

final ClassM2

A class declared with the final modifier (final class SecurityGate) that CANNOT be inherited (subclassed) by any other class; all its methods are implicitly final.

PackageM3

A namespace container for grouping related classes, interfaces, and sub-packages hierarchically, serving as both a naming mechanism (preventing collisions) and a visibility-control mechanism.

Default (Unnamed) PackageM3

The anonymous package assigned automatically when a Java source file omits the package declaration; recommended only for small test programs.

CLASSPATHM3

An OS environment variable or -cp / -classpath CLI flag telling javac and the JVM which root directories and .jar/.zip archives to search for user-defined classes and third-party libraries.

The import StatementM3

Directive placed immediately after package and before class declarations (import pkg.ClassName; or import pkg.*;) bringing external packaged classes into unqualified scope.

Package-Private (default) AccessM3

Access level applied automatically when no modifier (public, private, protected) is written; restricts visibility strictly to classes inside the same package.

InterfaceM3

A reference type declared with interface defining abstract method contracts, constants (public static final), and (since JDK 8) optional default/static methods, enabling unrelated classes to share polymorphic behavior.

Partial ImplementationM3

A class that implements an interface without implementing all of its abstract methods; Java requires such a class to be declared abstract.

Nested InterfaceM3

An interface declared as a member inside a class or another interface; unlike top-level interfaces (public or default), nested interfaces inside a class can be public, private, or protected.

Interface Inheritance (extends)M3

Mechanism where one interface inherits constants and method declarations from one or more parent interfaces (interface B extends A1, A2).

JDK 8 default MethodM3

A concrete method defined inside an interface using the default keyword (default void log() { ... }), allowing libraries to add new interface methods without breaking existing implementing classes.

ExceptionM3

An abnormal event/condition arising during program execution (runtime) that disrupts normal sequential instruction flow, represented in Java as an object descending from java.lang.Throwable.

Checked ExceptionM3

An Exception subclass (EXCLUDING RuntimeException and Error) checked strictly by javac at compile time; the programmer MUST handle it with try-catch or declare it via throws (IOException, SQLException, ClassNotFoundException).

Unchecked ExceptionM3

An exception descending from RuntimeException (or Error) that is NOT checked by javac at compile time, typically caused by programmer logic mistakes (ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException).

JVM Default Exception HandlerM3

Built-in runtime fallback triggered when an exception is never caught by user code; prints the exception name/message, prints a call stack trace, and terminates the thread.

try and catch BlockM3

try { ... } encloses code that may throw an exception (curly braces mandatory even for 1 statement); catch (ExType e) { ... } defines a handler immediately following try for matching exception objects.

Nested try StatementM3

A try block placed inside another try block; if an inner try lacks a matching catch, the stack unwinds outward to inspect enclosing try's catch clauses.

finally BlockM3

An optional block after try/catch containing guaranteed cleanup code that executes regardless of whether an exception was thrown, caught, uncaught, or returned early.

throw KeywordM3

Statement inside a method/block used to explicitly throw a single Throwable object (throw new MyException("msg"); or rethrowing a caught parameter throw e;).

throws KeywordM3

Clause appended to a method declaration (void readFile() throws IOException, SQLException) listing checked exceptions the method might throw without handling internally, pushing responsibility to the caller.

Exception PropagationM3

Mechanism where an unhandled exception automatically travels backward (unwinds) down the runtime call stack from callee to caller until a matching catch block is found (or the default JVM handler terminates the thread).

Custom (User-Defined) ExceptionM3

A programmer-defined class extending Exception (for a checked custom exception) or RuntimeException (for unchecked), usually overriding/calling super(message) or toString().

Software Design PatternM3

A general, reusable architectural solution (template) to a commonly occurring problem in object-oriented software design, popularized by the 'Gang of Four' (GoF) across Creational, Structural, and Behavioral categories.

Singleton Design PatternM3

A Creational design pattern that guarantees a class has only ONE instance in the JVM and provides a global point of access to that single instance.

Adapter Design PatternM3

A Structural design pattern that converts the interface of an existing class (Adaptee) into another interface (Target) expected by clients, allowing classes with incompatible interfaces to collaborate without modifying their source code.

Single Responsibility Principle (SRP)M4

First SOLID principle stating that every class or module should have responsibility over a single part of functionality—meaning it should have only ONE reason to change.

Open/Closed Principle (OCP)M4

Second SOLID principle stating that software entities (classes, modules, methods) should be open for extension (supporting new behaviors), but closed for modification (without altering existing working source code).

Liskov Substitution Principle (LSP)M4

Introduced by Barbara Liskov: Objects of a superclass must be replaceable with objects of any of its subclasses without breaking the correctness or expected behavioral contract of the program.

Interface Segregation Principle (ISP)M4

Fourth SOLID principle: No client class should be forced to depend on or implement methods from an interface that it does not use; prefer multiple small cohesive interfaces over one fat monolithic interface.

Dependency Inversion Principle (DIP)M4

Fifth SOLID principle: (1) High-level modules should not depend on low-level modules; both should depend on abstractions (interfaces). (2) Abstractions should not depend on details; details should depend on abstractions.

AWT (Abstract Window Toolkit)M4

Java's original GUI toolkit (java.awt) whose components (Button, Label, TextField) are heavyweight, delegating rendering directly to native OS peer widgets.

SwingM4

A rich Java GUI framework (javax.swing) built upon AWT that provides flexible lightweight components written entirely in Java with a Pluggable Look and Feel.

Lightweight ComponentM4

A GUI widget written 100% in Java that does NOT map directly to an OS-specific native peer component, enabling consistent cross-platform behavior and lower OS resource overhead.

Pluggable Look and Feel (PLAF)M4

Swing feature allowing developers or users to dynamically change the visual appearance ('look') and interaction style ('feel')—such as Windows, Metal, Nimbus, or custom themes—at runtime without rewriting application logic.

Model-View-Controller (MVC)M4

Software architecture splitting an interactive component into three concerns: Model (application state/data), View (visual rendering), and Controller (user input handling).

Model-Delegate (Separable Model) ArchitectureM4

Swing's adapted version of MVC that combines View and Controller into a single logical entity called the UI Delegate (ComponentUI), enabling Pluggable Look and Feel.

Component vs ContainerM4

A Component is an independent visual control (JButton, JLabel); a Container is a specialized component capable of holding other components and nested containers (JFrame, JPanel), forming a Containment Hierarchy.

JFrameM4

Primary top-level Swing container window for desktop applications (javax.swing.JFrame), implementing WindowConstants to define close behavior (EXIT_ON_CLOSE, DISPOSE_ON_CLOSE, HIDE_ON_CLOSE, DO_NOTHING_ON_CLOSE).

JLabel and ImageIconM4

Passive JComponent displaying read-only text and/or an Icon (ImageIcon loaded from file/URL) aligned via SwingConstants (LEFT, RIGHT, CENTER, LEADING, TRAILING).

JTextFieldM4

Single-line editable text control extending JTextComponent, backed by the Document model; fires ActionEvent on Enter and CaretEvent on cursor move.

Swing Buttons & ButtonGroupM4

Four button classes extending AbstractButton (JButton, JToggleButton, JCheckBox, JRadioButton), plus ButtonGroup which enforces mutual exclusion among grouped JRadioButtons.

EventM4

An object describing a state change in a source (caused by GUI user actions like button clicks/keystrokes, or non-UI triggers like timers/counters).

Event SourceM4

An object (such as JButton, JTextField, JFrame) that generates an event and dispatches it to registered listeners via addTypeListener(TypeListener el) and removeTypeListener(...).

Event ListenerM4

An object implementing one or more listener interfaces (from java.awt.event or javax.swing.event) that registers with a source to receive and handle event notifications.

Multicasting vs Unicasting EventsM4

Multicasting notifies ALL registered listeners when an event fires (standard in Java); Unicasting allows at most one registered listener (throwing java.util.TooManyListenersException on a second registration).

java.util.EventObjectM4

Root superclass of ALL event classes in Java, defining Object getSource() and toString().

java.awt.AWTEventM4

Direct subclass of EventObject serving as the superclass for all AWT/Swing Delegation Event Model events (int getID()).

ActionEvent & ActionListenerM4

Event fired when a JButton is pressed, a JTextField receives Enter, or a menu item is selected; handled by implementing void actionPerformed(ActionEvent ae).

Layout ManagerM4

An object implementing java.awt.LayoutManager assigned to a Container (setLayout(...)) that automatically computes positions and sizes of child components dynamically.

FlowLayoutM4

Simple layout manager arranging components sequentially row by row in their preferred sizes, wrapping to new lines when horizontal space runs out.

BorderLayoutM4

Layout manager dividing container space into five regions (NORTH, SOUTH, EAST, WEST, CENTER), allowing at most ONE component per region.

GridLayoutM4

Layout manager dividing container space into an equal-sized rectangular grid of rows × cols cells.

CardLayoutM4

Layout manager treating components inside a container as a stack of cards where only one named card is visible at a time (first, next, previous, last, show).

GridBagLayout & GridBagConstraintsM4

Flexible grid layout manager where components occupy dynamic rectangular regions configured via a GridBagConstraints object (gridx, gridy, gridwidth, gridheight, weightx, weighty, fill, anchor).

JDBC (Java Database Connectivity)M4

A standard Java API (java.sql and javax.sql) defining how a Java client connects to heterogeneous relational databases, submits SQL statements, and processes returned results independently of the underlying DBMS.

Two-Tier vs Three-Tier JDBC ArchitectureM4

In the Two-Tier model, a Java client communicates directly with the DBMS via a JDBC driver (Client -> Driver -> DB). In the Three-Tier model, the client talks to a middle-tier application server, which uses JDBC to communicate with the DBMS (Client -> App Server -> Driver -> DB).

JDBC DriverM4

A software component implementing java.sql.Driver that translates vendor-independent JDBC API calls into a specific database vendor's proprietary communication protocol.

DriverManager (Class) & Driver (Interface)M4

DriverManager manages registered Driver implementations and matches a connection request's JDBC URL subprotocol to the first compatible driver to return a Connection.

Connection (Interface)M4

Represents a live communication session (physical context) with a specific database; factory for creating Statement, PreparedStatement, and CallableStatement objects (conn.createStatement(), conn.close()).

Statement vs PreparedStatement vs CallableStatementM4

Statement executes static SQL strings compiled every call; PreparedStatement (sub-interface) executes precompiled parameterized SQL with ? placeholders (prevents SQL injection & runs faster repeatedly); CallableStatement invokes database Stored Procedures.

ResultSet (Interface) & SQLException (Class)M4

ResultSet holds tabular data returned by executeQuery() and acts as a cursor iterator (rs.next(), rs.getInt(), rs.getString()). SQLException is a checked exception class reporting database/SQL errors.