473,480 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cannot connect with OCI driver and Oracle 9i (9.2)

Hello all,

I have been trying to use the OCI driver to connect to Oracle 9i, but
have been getting the following error:

java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAcce ss.java:2364)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.jav a:480)
at oracle.jdbc.driver.OracleConnection.<init>(OracleC onnection.java:360)
at oracle.jdbc.driver.OracleDriver.getConnectionInsta nce(OracleDriver.java:521)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:325)
at java.sql.DriverManager.getConnection(DriverManager .java:517)
at java.sql.DriverManager.getConnection(DriverManager .java:177)
at TestOCI.main(TestOCI.java:17)

Here's my setup:
.. Running on 'SunOS beavis 5.7 Generic_106541-17 sun4u sparc
SUNW,Ultra-5_10'
.. java version is 'Java(TM) 2 Runtime Environment, Standard Edition
(build 1.3.1-b24)'
.. echo $LD_LIBRARY_PATH -> /users/david/TestOCI/9.2.0.3:/oracle/lib
.. in the '9.2.0.3' directory, I have the following files:
classes12_g9203.zip, libheteroxa9.so, libheteroxa9_g.so,
libocijdbc9.so, libocijdbc9_g.so (downloaded from the oracle driver
section)

And the sample program that I run, TestOCI.java:

import java.sql.*;
public final class TestOCI {

private static final String DRIVER = "oracle.jdbc.OracleDriver";
private static final String URL = "jdbc:oracle:oci8:@zool";

public static void main(String[] args) {

try {
Class.forName(DRIVER);
Connection con = DriverManager.getConnection(URL,"user", "pw");
Statement stmt = con.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}
}

I have tried to change the URL to 'oci' instead of 'oci8', same
result. It does work perfectly if I use the thin driver however.
This is run with the classpath explicitely set to
'/users/david/TestOCI/9.2.0.3/classes12_g9203.zip:.'
I have also tried to run DbVisualizer (java client) against Oracle
with the same setup, and I get the very same exception.

Does anyone have a clue/pointer?
Thanks
Jul 19 '05 #1
3 17854
You need two more shared object files:

libclntsh.so.9.0
libwtc9.so

Cheers,
Dave


David wrote:
Hello all,

I have been trying to use the OCI driver to connect to Oracle 9i, but
have been getting the following error:

java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAcce ss.java:2364)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.jav a:480)
at oracle.jdbc.driver.OracleConnection.<init>(OracleC onnection.java:360)
at oracle.jdbc.driver.OracleDriver.getConnectionInsta nce(OracleDriver.java:521)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:325)
at java.sql.DriverManager.getConnection(DriverManager .java:517)
at java.sql.DriverManager.getConnection(DriverManager .java:177)
at TestOCI.main(TestOCI.java:17)

Here's my setup:
. Running on 'SunOS beavis 5.7 Generic_106541-17 sun4u sparc
SUNW,Ultra-5_10'
. java version is 'Java(TM) 2 Runtime Environment, Standard Edition
(build 1.3.1-b24)'
. echo $LD_LIBRARY_PATH -> /users/david/TestOCI/9.2.0.3:/oracle/lib
. in the '9.2.0.3' directory, I have the following files:
classes12_g9203.zip, libheteroxa9.so, libheteroxa9_g.so,
libocijdbc9.so, libocijdbc9_g.so (downloaded from the oracle driver
section)

And the sample program that I run, TestOCI.java:

import java.sql.*;
public final class TestOCI {

private static final String DRIVER = "oracle.jdbc.OracleDriver";
private static final String URL = "jdbc:oracle:oci8:@zool";

public static void main(String[] args) {

try {
Class.forName(DRIVER);
Connection con = DriverManager.getConnection(URL,"user", "pw");
Statement stmt = con.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}
}

I have tried to change the URL to 'oci' instead of 'oci8', same
result. It does work perfectly if I use the thin driver however.
This is run with the classpath explicitely set to
'/users/david/TestOCI/9.2.0.3/classes12_g9203.zip:.'
I have also tried to run DbVisualizer (java client) against Oracle
with the same setup, and I get the very same exception.

Does anyone have a clue/pointer?
Thanks


Jul 19 '05 #2
Dave Hau <davehau_nospam_123@nospam_netscape.net> wrote in message news:<3EF76D38.2040704@nospam_netscape.net>...
You need two more shared object files:

libclntsh.so.9.0
libwtc9.so

Thanks, but it doesn't seem to be the problem since I do have these
files in /oracle/lib (which is in my LD_LIBRARY_PATH).
Jul 19 '05 #3
gaunt2
1 New Member
Hi David,
have you found any solution for your problem? I have exectly the same problem now and I don't know how to solve it. Can you help me?
Thanks
Vojta
Aug 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
4772
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
1
10651
by: CM | last post by:
Hi, when i want connect me in my BD with a JSP (with this simple code), this exception is throw. Thank's for ur help Mathieu CODE of my JSP ---------------------
5
13183
by: jrefactors | last post by:
My machine is Windows XP with Oracle 9.2 Home; IIS and Oracle are in the same box. I have tried both Oracle OLEDB Provider and Microsoft ODBC For Oracle, but both not working. For Microsoft...
1
2690
by: PeteCresswell | last post by:
I'm doing this: --------------------------------------------------------- 5200 Case "Query" On Error Resume Next Set curQD = thisDB.QueryDefs(!ObjectName) curErr = Err On Error GoTo...
3
1760
by: stueyh | last post by:
When attempting to connect to an Access 2000 DB using ADO.Net from within ASP.Net running under an impersonated local user account receiving the following error. ERROR Disk or network error....
7
4336
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
9
2388
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
2
297
by: David | last post by:
Hello all, I have been trying to use the OCI driver to connect to Oracle 9i, but have been getting the following error: java.sql.SQLException: Closed Connection at...
0
1201
by: Rauf Sarwar | last post by:
"hilz" <hs_74@hotmail.comwrote in message news:<K7-dnfyIdLwmV2qjXTWcqA@speakeasy.net>... 1) Did you install Oracle as an Administrator? 2) Are all these three services set to Automatic? 3) Are...
0
7059
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6758
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7010
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3011
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.