JDBC is a Java API that allows Java programs to connect to relational databases. It establishes a connection, sends SQL statements, and processes results. There are four types of JDBC drivers. To execute SQL queries, a statement is created using the connection and then execute, executeUpdate, or executeQuery methods are called depending on if the query is DDL, DML, or DQL. The example program connects to a MySQL database, creates a statement, executes a SELECT query on a table, and prints out the results.