How do I set up JDBC to communicate with Oracle database?

Question ID : 191
Created on 2012-02-27 at 10:57 AM
Author : Veryant Support []

Online URL :

An Oracle JDBC FAQ is at

Where can I get the class files?
You can get the classes files from the Oracle Technology Network SQLJ & JDBC Download Page.
JDBC Driver Downloads

Oracle Database 11g Release 2 (, (, ( drivers

What are all of these files for?
There are a large number of classes files that are part of the Oracle JDBC installation.
All the classes to support basic functionality for the Thin and OCI drivers when using JDK 1.6 (JSE 6). Additional jar files are required when you use some features.

The Oracle Database Documentation Library is at
To read about the JDBC drivers provided by Oracle, search for "JDBC Driver" and click on the first result
The Oracle Database JDBC Developer's Guide is at
"Choosing the Appropriate Driver" is at

We recommend starting with the JDBC Thin driver.

You can find information in the isCOBOL Data Access Guide.

The key information is:

In order to let isCOBOL interact with a RDBMS you need the proper JDBC driver. JDBC drivers are Java libraries (jar) that are usually supplied by the RDBMS vendor. Each RDMBS has its own drivers. The Java library must appear in the CLASSPATH and the driver class name must be specified by the iscobol.jdbc.driver configuration property.

In addition you must specify the connection URL by setting the iscobol.jdbc.url property.

JDBC : Common Driver and URL settings : Oracle


Value for iscobol.jdbc.driver:

Value for iscobol.jdbc.url:

Value for iscobol.jdbc.url when using a TNS:

Note that if you are using Java 6 then the Oracle library name is ojdbc6.jar

Here is a real example from one of our Linux boxes:

export ISCOBOL_JDK_ROOT=/usr/jdk1.6.0_11
export ISCOBOL=/home/dl136134/porting/Linux32/isCOBOL2012R1
export PATH=$ISCOBOL/bin:$PATH
export CLASSPATH=.:$ISCOBOL/lib/iscobol.jar:$ISCOBOL/lib/isxms.jar:$ISCOBOL/lib/utility.jar
export ORACLE_HOME=/database/oracle/app/oracle/product/11.1.0/client_1
export CLASSPATH=$ORACLE_HOME/jdbc/lib/ojdbc6.jar:$CLASSPATH
export TWO_TASK=mach1

Note that we are using TWO_TASK as documented at


A tnsnames.ora entry and the following:

Our tnsnames.ora file contains the following:

      (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
      (SERVICE_NAME = mach1)

which defines the mach1 service name.

To set up the environment run the following command:

. ./

To run a program named PROGRAM run the following command:

iscrun -c PROGRAM

where contains the following:


replacing username/password with the actual username and password

In this example, mach-1 is the hostname and mach1 is the service name.

The syntax is:

Thin-style Service Name Syntax
Thin-style service names are supported only by the JDBC Thin driver. The syntax is:
For example:

For more information about the syntax of the connection URL see "Data Sources and URLs" at

Back to Original Question