|Title: How do I set up JDBC to communicate with Oracle database?|
An Oracle JDBC FAQ is at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html
Where can I get the class files?
What are all of these files for?
The Oracle Database Documentation Library is at http://www.oracle.com/pls/db112/homepage
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:
Note that we are using TWO_TASK as documented at http://docs.oracle.com/cd/E11882_01/install.112/e24322/post_inst_task.htm#CHDJCCBI
A tnsnames.ora entry and the following:
Our tnsnames.ora file contains the following:
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:
where program.properties 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
For more information about the syntax of the connection URL see "Data Sources and URLs" at http://docs.oracle.com/cd/E11882_01/java.112/e16548/urls.htm#JJDBC28267
|Authored by: Veryant Support on Mon, Feb 27th, 2012 at 7:00 PM
This question has been viewed 92058 times so far.
|Online URL: http://support.veryant.com/support/phpkb/question.php?ID=191|
Powered by PHPKB Knowledge Base Software