473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 17841
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.