Using JDBC

The best place to start in understanding an API is with a minimal implementation example. The following code demonstrates just such an implementation using only four JDBC classes as listed in Table 5-4.

Table 5-4. Core JDBC Classes
Interface/ClassPurpose
DriverManagerLoads the JDBC driver and manages the database connection. Controls access to the database driver.
ConnectionConnects to the database and allows the creation of Statement objects.
StatementAllows the execution of SQL statements and returns results, either integer values for the number of rows updated or ResultSet objects representing the rows returned by the execution of a SQL select statement.
ResultSet Allows access to individual rows in the set of rows returned by a SQL ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.