CS290I - Scalable Internet Services and Systems

Thorsten von Eicken - UCSB - Winter 2002

Project How-To: Oracle

Command line access

You need to add the following items to your environment:

setenv ORACLE_HOME /cs290i/oracle/product/817
setenv ORACLE_BASE /cs290i/oracle
setenv ORACLE_SID cs290i
set path=($ORACLE_HOME/bin $path)
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$ORACLE_HOME/lib

The command line program is called sqlplus:

[bugatti ~] sqlplus tve@cs290i

SQL*Plus: Release 8.1.7.0.0 - Production on Sat Jan 12 17:30:07 2002

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Enter password:

Connected to:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
JServer Release 8.1.7.0.0 - Production

SQL>

Perl driver

We have installed the Oracle DBI driver, see "perldoc DBD::Oracle" for a manual page. To connect to your database, use the following:

use DBI;
$dbh = DBI->connect("dbi:Oracle:cs290i", $user, $passwd);

Java driver

The name of the Java class for the Oracle driver is "oracle.jdbc.driver.OracleDriver". E.g.:

import java.sql.*;
Class.forName ("oracle.jdbc.driver.OracleDriver");

The connection string that you will need to use to get the database handle is:

Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:dbUser/dbPassword@bugatti:1521:cs290i");

where dbUser is your username and dbPassword is your Oracle password.


Updated 01/28/2002