In this chapter, you discovered the essential steps for communicating with a database:
Import java.sql.* to avoid long member names.
Build a JDBC URL.
Load one or more specific JDBC drivers with class.forName().
If necessary, adjust the connection properties.
Open a connection with getConnection().
Create a statement object.
Build a SQL statement.
Execute the SQL statement.
Manage multiple result sets.
Fetch rows of data in cases of a result set of rows.
Fetch columns of rows by column name or column index.
Fetch integer results.
Check for warnings.
Manage data truncation errors.
Close the result set.
Close the statement.
Terminate the connection with close().
Catch exceptions.
The next chapter discusses data type conversions, how to use the SQL escape syntax, what a database transaction is, and in which context programmers use transactions and also provides examples of using SQL cursors.