// Connecting to a Oracle database via JDBC.
// Presuming JDK 1.6, must have ojdbc6.jar (Oracle JDBC drivers) on the classpath or in the ext directory.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

private Connection conn;

public void init()
   {
   // instantiate the Oracle JDBC driver.
   // I have not tested this code.
   try
      {
      Class.forName( "oracle.jdbc.driver.OracleDriver" ));
      }
   catch ( Exception e )
      {
      System.out.println( "can't load Oracle driver: " + e.getMessage() );
      }
   try
      {
      // I don't see the point of the following, but that is what I was told to do:
      OracleDriver driver = new OracleDriver();
      driver = null;

      // log on to the database
      conn = DriverManager.getConnection( "jdbc:oracle:thin:@some.server.name:someportnumber:somedatabasename", "myuserid", "mypassword" );
      conn.setAutoCommit( false );
      }
   catch ( SQLException e )
      {
      System.out.println( "can't connect to Oracle: " + e.getMessage() );
      }
   }

...

// create the shell into which you can pour an SQL command.
Statement stmt = conn.createStatement();