A Typical JDBC API Usage Sequence


To connect to and query a database from the client, you must provide code for these tasks:


  1. Import packages.
  2. Register the JDBC drivers.
  3. Open a connection to a database.
  4. Create a statement object.
  5. Execute a query and return a result set object.
  6. Process the result set.
  7. Close the result set and statement objects.
  8. Make changes to the database.
  9. Commit changes.
  10. Close the connection.
You must supply Oracle driver-specific information for the first three tasks, which allow your program to use the JDBC API to access a database. For the other tasks, you can use standard JDBC Java code as you would for any Java application.