A Typical JDBC API Usage Sequence
To connect to and query a database from the client, you must provide code for these tasks:
- Import packages.
- Register the JDBC drivers.
- Open a connection to a database.
- Create a statement object.
- Execute a query and return a result set object.
- Process the result set.
- Close the result set and statement objects.
- Make changes to the database.
- Commit changes.
- 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.