• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

The Problem

How do Java applications interact with relational databases in a portable way, without being tied to specific database products?

Core Idea

JDBC (Java Database Connectivity) is a standard Java API that provides universal database access. Applications use the JDBC API, while database-specific JDBC drivers handle the actual communication with each database.

How It Works

  • Application uses JDBC API to issue SQL statements
  • JDBC Driver Manager selects the appropriate driver for the database
  • Driver translates JDBC calls to database-specific protocol
  • Results are returned through standard JDBC result sets

Key Properties

  • Part of Java SE standard edition
  • Drivers for all major databases (MySQL, Oracle, PostgreSQL, etc.)
  • Supports connection pooling through DataSource
  • SQL statements via Statement, PreparedStatement, CallableStatement

Visual Explanation

JDBC A Jdbc Input B Jdbc Core Mechanism A->B triggers C Jdbc Output B->C produces

Semantic Network

semantic_JDBC THIS Jdbc REL1 Related Concept THIS--REL1 related REL2 Builds Into THIS--REL2 builds into

Edge Cases & Gotchas

  • Must close connections, statements, and result sets properly
  • Use PreparedStatement to prevent SQL injection