O'Reilly logo

Ivor Horton's Beginning Java™ 2, JDK™ 5th Edition by Ivor Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required