ROW PRE-FETCH Illustration sample


This document is organized into following sub-sections :

  1. Overview of the Sample Application
  2. Installation and Configuration
  3. Description of Sample Files

Overview of the Sample Application

This application illustrates the use of row prefetching performance extension. It gives a comparison between querying using three different values of row-prefetch:
   - The default value
   - Row-Prefetch value of 100
   - Row-Prefetch value of 200

 The execution time for each prefetch value will be displayed in the corresponding text fields.

 Note that ROW PRE-FETCHING is an Oracle-JDBC driver specific performance extension.


Steps in the Application :

 1) After invoking the application, the connection status is shown in statusbar. Errors if any are also shown in the statusbar.

 2) Press "DEFAULT ROW PRE-FETCH" Button to see the execution time taken for querying using the default values of Row-Prefetch.

 3) Press "WITH ROW PRE-FETCH=100" Button to see the execution time taken for querying using Row-Prefetch value 100.

 3) Press "WITH ROW PRE-FETCH=200" Button to see the execution time taken for querying using  Row-Prefetch value 200.

 5) Press "EXIT" Button to exit the Application

Required Software

  • Oracle9i JDeveloper or higher ( Note: JDeveloper is Oracle's Visual Java Development Tool and can be downloaded from here )
    or

    JDK1.2.x (can be downloaded from here )
  • Oracle9i (Database) or higher running SQL*Net TCP/IP listener. This can be downloaded from here .
  • Travel Schema needs to be loaded into the database. This can be downloaded from here.

Installation and Configuration

The section has a set of step-by-step instructions to run this application successfully. This will be discussed in the following subsections

Database setup

Install the sample

Run the sample using Jdeveloper

Run the sample using the JDK environment

Database Setup

The application requires the Travel Schema to be installed firs. (Travel schema cane be downloaded from here )           

Install the sample

 Step 1. Unjar  RowPrefetchSample.jar using Winzip, or using the following command:
              > jar xvf RowPrefetchSample.jar . This creates a directory RowPrefetchSample.

 Step 2. Edit connection.properties file. Change the hostname, portnumber and databasename to those of the database instance you want
             to connect to. Change the following lines:

HostName = insn104a.idc.oracle.com
SID = otn9i
Port = 1521
UserName = travel
Password = travel

Run the sample using JDeveloper

 Step 1. Using JDeveloper File/Open option select the RowPrefetchSamples.jws from the RowPrefetchSample directory.

 Step 2. Select Project/Make from JDeveloper main menu and select Make Project "RowPrefetchSample.jpr"

 Step 3. Select Run/Run RowPrefetchSample.jar from JDeveloper main menu to run the application.

Run the sample using the JDK Environment

 Step 1. Install Oracle JDBC Driver and include the zip/jar files in the CLASSPATH. Make sure that connection.properties and RowPrefetchSample/src are in the classpath

 Step 2.  Change directory to RowPrefetchSample/src/oracle/otnsamples/jdbc/prefetch. Compile the files using javac:

               %javac *.java

 Step 3. Run the class file using java:

               %java oracle.otnsamples.jdbc.prefetch.RowPrefetchSample

Description of Sample Files

The directory structure of the deliverable RowPrefetchSample.jar will be as shown below

RowPrefetchSample is the top level directory.

RowPrefetchSample
This directory has the following files:
    README.html  -- This file
    connection.properties  ----  details of database connection parameters
   
    RowPrefetchSample.jws          ----  The JDeveloper workspace file
    RowPrefetchSample.jpr           ----  The JDeveloper project file
   
RowPrefetchSample\src oracle/otnsamples/jdbc/prefetch/RowPrefetchSample.java The source file for sample
oracle/otnsamples/jdbc/prefetch/RowPrefetchFrame.java  The source file for the sample User Interface
oracle/otnsamples/jdbc/prefetch/GenTableModel.java A swing table model implementation .


Please enter your comments about this sample in the OTN Sample Code Discussion Forum.