24.7. Summary
In this chapter you've been introduced to JDBC programming and seen it in action. The important points covered in this chapter include the following:
The fundamental classes in JDBC are as follows:
DriverManager manages the loading of JDBC drivers and connections to client applications.
Connection provides a connection to a specific data source.
Statement provides a context for executing SQL statements.
ResultSet provides a means for accessing data returned from an executed Statement.
The essential JDBC program has the following basic sequence when writing:
Import the necessary classes.
Load the JDBC driver.
Identify the data source.
Allocate a Connection object.
Allocate a Statement object.
Execute a query using the Statement object.
Retrieve data from the returned ResultSet object.
Close the ResultSet.
Close the Statement object.
Close the Connection object.
The JTable component provides an easy and convenient way to display the results of database queries.
A table model can provide the data to be displayed by a JTable component. A table model is an object of a class that implements the TableModel interface.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access