Re: connecting to an oracle db using the thick (oci) driver

From: Shanmuhanathan T (shanmuha_at_mailinator.com)
Date: 07/08/04

  • Next message: Raquel: "Holdability question ...."
    Date: Thu, 08 Jul 2004 17:41:31 +0530
    
    

    on 6/25/2004 6:45 PM Dave Holland Wrote:
    > Hi,
    > I hope someone out there can help me with this. I usually connect to
    > the oracle database from my java code via the thin driver. However I
    > have been asked to investigate using the oci driver instead. I have
    > installed the oracle 9 client (on my win2000 PC) and have set up a
    > test harness (code below), but all I seem to get is a
    > 'java.sql.SQLException: Closed Connection' when I try to connect.
    >
    > code follows>>>>>
    <snip>
    > full output is
    > about to connect
    > error connecting to db java.sql.SQLException: Closed Connection
    > java.sql.SQLException: Closed Connection
    > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    > at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2348)
    > at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:477)
    > at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
    >
    > at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    > va:468)
    > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    > at java.sql.DriverManager.getConnection(Unknown Source)
    > at java.sql.DriverManager.getConnection(Unknown Source)
    > at DbHarness.connect(DbHarness.java:26)
    > at DbHarness.test(DbHarness.java:13)
    > at DbHarness.main(DbHarness.java:6)
    > Connection complete
    >
    >
    > Thanks in advance
    > Dave Holland

    Dave,
    The only time I got this error was when my JDBC class versions did not
    match the OCI version - specifically I was using JDBC with Jdeveloper10g
    to connect using OCI in my 9i oracle_home. Sync'ing up the JDBC/OCI
    versions should solve this problem.

    -- 
    Shanmu
    

  • Next message: Raquel: "Holdability question ...."