> Hi,
> I hope someone out there can help me with this. I usually connect to
[quoted text clipped - 67 lines]
> 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)
[quoted text clipped - 7 lines]
> Thanks in advance
> Dave Holland
I only wrote jdbc code once and what I have looks like:
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection ("jdbc:oracle:oci8:@connectstring", dbUser,
dbPw);
...
and that works. Did you make sure you can logon to the database using that
connect string in SQLplus?
hth
rob van lopik
Dave Holland - 29 Jun 2004 13:21 GMT
> > Hi,
> > I hope someone out there can help me with this. I usually connect to
[quoted text clipped - 104 lines]
>
> rob van lopik
Hi,
Both DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver()); and
Class.forName("oracle.jdbc.driver.OracleDriver"); can be used to
register the driver, the 'DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver())' way tends to be used in non-JDK
JVMs such as Microsofts. I've not yet worked out where the problem
is. I suspect it could be in my install of the oracle client, I'll
pursue this and post what I find.
Dave Holland
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
[quoted text clipped - 5 lines]
>
> code follows>>>>>
<snip>
> full output is
> about to connect
[quoted text clipped - 18 lines]
> 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.

Signature
Shanmu
K N V Sudhakar - 16 Jul 2004 08:05 GMT
Hi Dave,
I am also getting the same/similar message when I am trying to connect
to Oracle database.
I am able to connect to the database if I add the connection string
put in tnsnames.ora in the statement as mentioned below:
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@(description=(address=(
host=10.8.32.178)(protocol=tcp)(port=1521))(connect_data=(sid="+BCVDatabase+")))",BCV_user,
BCV_password);
But when I am using the statement as below
Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@VLCTYPOC",
BCV_user, BCV_password);
and adding connection String for VLCTYPOC in TNSNAMES.ora, I am
getting the error message as java.sql.SQLException: Closed Connection.
> on 6/25/2004 6:45 PM Dave Holland Wrote:
> > Hi,
[quoted text clipped - 35 lines]
> to connect using OCI in my 9i oracle_home. Sync'ing up the JDBC/OCI
> versions should solve this problem.