Steps to Use JDBC

There are several steps that you need to perform when using JDBC. In order to connect to and query JSTP from the client, you must provide code to perform several tasks:

  1. Import packages

  2. Register JDBC drivers

  3. Open a connection to JSTP

  4. Create a statement object

  5. Execute a Query and return a resultset object

  6. Process the resultset

  7. Close the resultset and statement objects

  8. Close the connection

For the first three tasks, you need to provide Oracle driver-specific information so that you can use the JDBC API to access the JSTP database. Standard JDBC Java code can be used for the other tasks.

Setting Up PATH and CLASSPATH Environment Variables

If you are using the thin driver or the JDBC OCI driver and you don't set up the PATH and CLASSPATH ...

Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.