Connecting to Oracle from Java with JDBC

Requirements

Good sources for more detailed information

Installing the Oracle9i Thin Driver

  1. Include classes12.zip in your CLASSPATH Environment Variable
  2. Alternatively, extract the files from it into a directory already in the CLASSPATH

Connecting to Oracle with JDBC

  1. Create a new Java program with a main() function.
  2. Import the java.sql.* package.
  3. Load the Oracle JDBC thin driver.
  4. Open a connection to Oracle
  5. Execute a query and retrieve a ResultSet
  6. Read the results
  7. Close the connection

A Simple Example

  1. A simple example may be downloaded from here.