The JDBC Interfaces

The methods discussed in the prior section are expressed as Java interfaces that are implemented by specific database drivers. Database application developers use the following JDBC interfaces:

  • java.sql.DriverManager: A class that provides methods to load drivers and to support the creation of database connections by using methods expressed in the java.sql.Driver interface.

  • java.sql.Connection: Represents a particular connection on which further actions are allowed.

  • java.sql.Statement: Associated to a connection, this allows SQL statements to be sent to the database.

  • java.sql.CallableStatement: This has the same role as java.sql.Statement but in the context of database stored procedures.

  • java.sql.PreparedStatement: This also has the same role as java.sql.Statement but in the context of precompiled SQL.

  • java.sql.ResultSet: Allows access to the rows of a previously executed statement.

  • java.sql.ResultSetMetaData: Gives information such as the type and properties of the columns in a result set.

  • java.sql.DatabaseMetaData: Provides information about the database as a whole.

Figure 5-3 is a simplified view of the relationship between the driver manager and the connection, statement, and result set objects.

click to expand
Figure 5-3: The relationship between the main JDBC interfaces.



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net