How To Access Oracle via JDBC
  1. Where can I find the Oracle JDBC drivers?

    You can download Oracle JDBC drivers directly from Oracle at:
    JDBC Driver Downloads

    The primary CS Oracle server is a 11.2.0.1.0 database, you should be able to use any of the versions of the drivers in a basic mode to connect to our server.

  2. Is There an Oracle/Java Development Environment?

    Oracle offers a java development environment as a free download:
    Oracle JDeveloper

    Computer Science does not support this product directly.

  3. Where Can I Find Sample JDBC Code?

    Oracle provides a sample code archive on oracle.com. Examples range from basic connectivity to advanced feature use exceeding the needs of most course like projects.
    JDBC Samples

  4. How Do I Connect to CS Oracle Server

    There are multiple methods of connections supported by JDBC drivers. You can explore some of these in the sample code archive.

    In general the information you will need to connect successfully consists of:

    • For @csora
    • Hostname: claros.cs.purdue.edu
    • Port: 1524
    • SID: strep
    or
    • For @csdb
    • Hostname: oracle.cs.purdue.edu
    • Port: 1521
    • SID: orb
    (In one case a user reported issues connecting with hostname but not IP address. Currently the CS Oracle server resides at: 128.10.2.42)

    Sample Basic Connection Strings

    • Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@claros.cs.purdue.edu:1524:orb","login","password");
    • Connection conn = DriverManager.getConnection("jdbc:oracle:thin:login/password@claros.cs.purdue.edu:1524:orb");
    • Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@(description=(address=(host=claros.cs.purdue.edu) (protocol=tcp)(port=1524))(connect_data=(INSTANCE_NAME=orb)))", "login", "password");

Common Oracle Errors ORA-00054