Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC

Re: JDBC

From: Sam Fredland <designinsites_at_home.com>
Date: Wed, 05 Jan 2000 15:45:59 GMT
Message-ID: <XGJc4.4713$VZ2.33815@news1.alsv1.occa.home.com>


Cindy,

I have a thin driver (I have classes111.zip). I got things working. I changed the host from localhost to the name of my machine (which was what was in my tnsnames.ora and listener.ora files). They map to different IP addresses (127.0.0.1 vs 209.19.117.6) which should both indicate the same machine, but I guess Oracle isn't smart enough to figure that out.

Thanks for the help.

-Sam

C. Ferguson <c_ferguson_at_rationalconcepts.com> wrote in message news:38729157.6DCD407D_at_rationalconcepts.com...
> From your dump, it looks like you are using the thin, and therefore, don't
worry
> about the oci error. That error appears to indicate that you don't have
that
> driver. I'm not sure what makes you think you are running the oci driver.
>
> So, the thin driver used to be in a classes111.zip or a classes12.zip and
now
> may be in a classes815.zip? if it's the thin driver.
> This file should be in your classpath. Since you didn't specify a
classpath
> option in your java command, I am making that assumption.
>
> To specifcally tell the vm what classes to use, use java -classpath
> .:./classes111.zip dbTest ....
> (using unix notation. just replace the colon with a semicolon for the
windows
> notation and use appropriate directory notation)
>
> And if you want to see the actual line number that it is dumping at, use
java
> -Djava.compiler=NONE -classpath ....
> where the compiler=NONE is telling the vm to not use the jit.
>
> You really need to determine what driver it is you are using before I can
give
> you more help and in doing that step, you will perhaps not need my help.
>
> cindy
>
> Sam Fredland wrote:
>
> > Cindy,
> >
> > Thanks. I looked at the document. I'm not sure whether I have the thin
or
> > the OCI driver. I ran the following sample program:
> >
> > import oracle.jdbc.driver.*;
> > import java.sql.*;
> >
> > public class JDBCTest {
> >
> > public static void main(String[] argv) throws Exception, SQLException {
> > String dbURL = argv[0];
> > System.out.println( dbURL );
> > String username = "ucboulder";
> > String password = "ucboulder";
> >
> > try {
> > Class.forName("oracle.jdbc.driver.OracleDriver");
> > } catch (Exception e) {
> > e.printStackTrace();
> > throw new Exception("Cannot load Driver " +
> > "oracle.jdbc.driver.OracleDriver");
> > }
> > try {
> > Connection conn = DriverManager.getConnection(dbURL, username,
password);
> > } catch (SQLException e) {
> > e.printStackTrace();
> > throw new SQLException(e.getMessage());
> > }
> > }
> > }
> >
> > The results for both the thin and OCI drivers were:
> >
> > ----------
> > java JDBCTest
> >

jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=
> > 1521))(connect_data=(sid=myp)))
> >

jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=
> > 1521))(connect_data=(sid=myp)))
> > Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8
in
> > java.library.path
> > at java.lang.ClassLoader.loadLibrary(ClassLoader.java, Compiled Code)
> > at java.lang.Runtime.loadLibrary0(Runtime.java, Compiled Code)
> > at java.lang.System.loadLibrary(System.java, Compiled Code)
> > at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, Compiled Code)
> > at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java,
> > Compiled Code)
> > at

oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java,
> > Compiled Code)
> > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java, Compiled
> > Code)
> > at java.sql.DriverManager.getConnection(DriverManager.java, Compiled
Code)
> > at java.sql.DriverManager.getConnection(DriverManager.java, Compiled
Code)
> > at JDBCTest.main(JDBCTest.java, Compiled Code)
> > ----------
> > java JDBCTest jdbc:oracle:thin:@localhost:1521:myp
> > jdbc:oracle:thin:@localhost:1521:myp
> > java.sql.SQLException: The Network Adapter could not establish the
> > connection
> > at oracle.jdbc.dbaccess.DBError.check_error(DBError.java, Compiled
Code)
> > at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java,
> > Compiled Code)
> > at

oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java,
> > Compiled Code)
> > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java, Compiled
> > Code)
> > at java.sql.DriverManager.getConnection(DriverManager.java, Compiled
Code)
> > at java.sql.DriverManager.getConnection(DriverManager.java, Compiled
Code)
> > at JDBCTest.main(JDBCTest.java, Compiled Code)
> > Exception in thread "main" java.sql.SQLException: The Network Adapter
could
> > not establish the connection
> > at JDBCTest.main(JDBCTest.java, Compiled Code)
> >
> > which makes me believe I'm not running a thin driver. But I've no idea
what
> > to make of:
> >
> > Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8
in
> > java.library.path
> >
> > Any idea?
> >
> > -Sam
>
Received on Wed Jan 05 2000 - 09:45:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US