A Typical JDBC API Usage Sequence


The JDBC API makes it possible to do three things:
  • Establish a connection with a database.
  • Send SQL statements.
  • Process the results.
The following tasks connect to and query a database from the client:

  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.




      How many Germans does it take to screw in a lightbulb?    
      One, they’re efficient and not very funny.