When it comes to adapting technology to changing needs, Sun has done its part with updates to Java and JDBC, Java's data-access programming interface. JDBC 1.x works well with traditional SQL types but SQL servers are evolving. JDBC 2.0 makes Java a better tool for using the object-relational technology of servers from major database vendors. In this column, I'll discuss JDBC and some aspects of programming with JDBC 2.0. JDBC makes it easier to write Java code for accessing SQL databases.
Objects simplify programming by promoting abstraction, inheritance, encapsulation, and polymorphism.
Using a single API for working with disparate databases also simplifies programming. JDBC includes statement classes that support different execution models for SQL queries. To support ad hoc queries, prepared queries, and stored procedures, JDBC includes the Statement , PreparedStatement , and CallableStatement classes, respectively. JDBC includes metadata classes that let you determine whether a DBMS provides features supported by JDBC classes. For example, JDBC defines APIs for executing batch statements, but to exploit them, you need a JDBC driver and a DBMS that supports batch statements.