SLAC ESD Software Engineering Group
Stanford Linear Accelerator Center

JDBC Connections

SLAC Detailed
SLAC Computing
Software Home
Software Detailed

This page summarizes how to make JDBC connections to Oracle databases from Windows machines, and then how to use this connection to create a dynamic Web page using Macromedia Dreamweaver.

Contents: Adding the JDBC Driver to your Class Path, Creating a Web Interface Using Macromedia Dreamweaver
See also:  

Adding the JDBC Driver to your Class Path

Java Database Connectivity (JDBC) is a Java API that enables Java programs to execute SQL statements, allowing Java programs to interact with any SQL-compliant database.  JDBC is similar to ODBC, but is designed specifically for Java programs, wheras ODBC is language-independent.


  1. The files which make up the jdbc driver are [ oracle _home]\ jdbc\lib\ and [ oracle _home]\ jdbc\lib\ Add these files to your class path.

    1. Go to Start > Settings > Control Panel > System. Click on the “Advanced” tab and click on the “Environment Variables” button at the bottom of the page. In the “System variables” window at the bottom, select CLASSPATH.

    1. Click the Edit Button, and add: C:\ oracle \ora92\jdbc\lib\;C:\ oracle \ora92\jdbc\lib\ to the Variable value field.

    2. Restart your computer.


Creating a Web Interface to the Database using Macromedia Dreamweaver

This section does not cover publishing locations or how to set up Dreamweaver connections.

  1. In Dreamweaver, create a new page or connect to an existing jsp page.

  2. Go to the Database tab under Application (or check Window > Database).

  3. To connect to your database create a connection using the Oracle Thin Driver

    1. Click the “+” button
    2. Select “Oracle Thin Driver (Oracle)”
    3. Create a connection name. Replace [hostname] with the oracle host (e.g. slac-oracle). Replace [port] with 1521, and replace [sid] with the database name (e.g. SLACPROD). Enter an Oracle User name and Password, then under “Dreamweaver Should Connect”, choose “Using Driver on this Machine”.

    1. Test the connection.
  4. Go to the Bindings tab under Application (or check Window > Bindings).
    1. Click the "+" button
    2. Select "Recordset (Query)"
    3. Create a Recordset Name.  Select the connection you created in the last step, and select the table you would like to display values from with appropriate search parameters.

  5. Create your table
    1. In the design view, place your cursor where you would like the table to be inserted.
    2. Go to Insert > Application Objects > Dynamic Table.
    3. Select the recordset you created in the previous step.  Once you have specified your table properties, click 'OK'.  To view your data, click View > Live Data.

Programmers' Guides, Users' Guides, Requirements, Design, Papers, Administration, How-To, Hardware, IOC, Database

[SLAC ESD Software Engineering Group][ SLAC Home Page]

Author: G. DeContreras 24-Feb-2004
Modified by: