Unfortunately, in practice this does not work for all cases. Here's the standard method for dynamically loading a driver:Ī standard JDBC Compliant driver should also create a new instance of the driver class with this code.
Support for time zones in Date, Time, and Timestamp valuesĭrivers enables JDBC classes to communicate with data sources.Character streams for international Unicode.Programmatic inserts, deletes, and updates.Where there are significant changes are in the areas of performance and support for SQ元 (SQL-99) datatypes. The JDBC 2.0 core API adds only a few more classes than the previous version. The JDBC 2.0 API is broken into two parts: the core API, which this course discusses, and the JDBC 2.0 Optional Package. DatabaseMetaData and ResultSetMetaData classes are available to provide information about a database or a ResultSet. A query returns a ResultSet containing the requested data, which is retrieved by Type.
A Statement, PreparedStatement, or CallableStatement is then created and used to update the database or execute a query.
To query a database, Java apps pass a Driver to the DriverManager and then obtain a Connection. JDBC is a Java API that documents a standard framework for dealing with tabular and, generally, relational data. JDBC Exception Types and Exception Handling.Statements, ResultSets, and Interacting with a Database.Areas Controlled by the Connection Interface.Connecting a Java Program to a Database.