Illustrating ColumnType Specification


This document is organized into following sub-sections :

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

Overview of the Sample Application

This application illustrates the Column-Type Specification performance extension of Oracle JDBC drivers. It gives a comparison between DEFAULT FETCH and FETCH WITH COLUMN TYPE SPECIFIED. The corresponding execution time will be displayed in the text fields. Thus the user will be able to see the advantage of specifying the Column Type by comparing the execution time.

Note: Column-Type Specification is an Oracle-JDBC driver specific performance extension.

Steps in the Sample

  1. After invoking the application, the connection status is shown in status bar. Errors if any are also shown in the status bar.
  2. Press "DEFAULT FETCH" button to see the execution time taken for querying in normal mode
  3. Press "FETCH WITH COLUMN TYPE SPECIFIED" button to see the execution time taken for querying after specifying the column type
  4. 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 or above (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 step-by-step instructions to run this application successfully.
This will be discussed in the following subsections

Install the sample

Database setup

Run the sample using Oracle9i JDeveloper

Run the sample using the JDK environment

Install the sample

Step 1. Unjar ColumnTypeSample.jar using Winzip, or using the following command:

> jar xvf ColumnTypeSample.jar

You will find jar.exe in JDK_HOME\bin. Ensure that JDK_HOME\bin is present in your system path. (JDK_HOME is the root directory of the JDKx.x installation ).

This creates a folder ColumnTypeSample with all the source files

Step 2. Edit Connection.properties file located in the directory ColumnTypeSample\src . Change the attributes hostname, portnumber and database name 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

Database Setup

The application requires the Travel Schema to be loaded into the database

Run the sample using Oracle9i JDeveloper

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

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

Step 3. Select Run/Run ColumnTypeSample.jpr 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
              Also ensure that ColumnTypeSample\src directory is added to the CLASSPATH

 Step 2.  Change directory to ColumnTypeSample\src\oracle\otnsamples\jdbc\columntype. Compile the files using javac:

               %javac *.java

 Step 3. Run the class file using java:            
            
              %java oracle.otnsamples.jdbc.columntype.ColumnTypeSample



Description of Sample Files

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

ColumnTypeSample is the top level directory.

Directory
Files
Description
ColumnTypeSample Readme.html This file
ColumnTypeSample.jws The Oracle9i JDeveloper workspace file
ColumnTypeSample.jpr The Oracle9i JDeveloper project file
ColumnTypeSample\src Connection.properties This file has the details of the database connection parameters
ColumnTypeSample\src\oracle\otnsamples\jdbc\columntype ColumnTypeSample.java The source file for sample
ColumnTypeFrame.java The source file for the sample User Interface

 



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