Exception "java.sql.SQLException: Closed Connection" using Oracle OCI JDBC (Type 2) Driver
 Technote (troubleshooting)
 
Problem(Abstract)
Resolving the "java.sql.SQLException: Closed Connection" error when using Oracle® OCI JDBC™ Driver to connect to a Oracle database.
 
Cause
The Oracle OCI JDBC driver is a type 2 JDBC driver. This means that the JDBC driver JAR file depends on the values of ORACLE_HOME environment variable and Oracle native libraries. The Oracle native libraries are located in $ORACLE_HOME/lib directory, where ORACLE_HOME is the environment variable that defines the directory.
 
Resolving the problem
Ensure that the Oracle JDBC driver JAR file uses the correct ORACLE_HOME and native libraries by editing the setupCmdLine.bat (Windows® platforms) or setupCmdLine.sh (UNIX® platforms) and make the following two changes (in bold face). The samples shown here are for AIX®.
1. Define the ORACLE_HOME environment variable
...
#!/bin/sh
                                   
WAS_HOME="/opt/WebSphere/AppServer"                              JAVA_HOME="/opt/WebSphere/AppServer/java"                        WAS_CELL=firionavie                                              WAS_NODE=firionavie                                              export ORACLE_HOME=<Directory where Oracle is installed>
...


2. Extend the WAS_LIBPATH to include $ORACLE_HOME/lib at the following section based on platform:
...
PLATFORM=`/bin/uname`
case $PLATFORM in

  AIX)
          WAS_LIBPATH="$WAS_HOME"/bin:/usr/mqm/java/lib:/usr/opt/wemps/lib:"ORACLE_HOME"/lib
WAS_EXT_DIRS="$WAS_EXT_DIRS":/usr/mqm/java/lib:/usr/opt/wemps/lib
...
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Windows
Software version: 5.1.1
Software edition:
Reference #: 1171519
IBM Group: Software Group
Modified date: Aug 16, 2004