Re: Cannot establish JDBC connection, help!
Date: Wed, 17 Jan 2001 22:36:13 GMT
Message-ID: <9456os$ol7$1_at_nnrp1.deja.com>
I can't give you a difinitive answer here but if both drivers aren't
working, it might be that you don't have the drivers set up in your
classpath. The code looks fine. I'm assuming that your URL is taking the
form of <hostname>:<port number>:<database name>; so you end up with
something like
jdbc:oracle:oci8:_at_myhost:1521:mydatabase, username, password being
passed intothe getConnection method
regards
Paul
In article
<ssmulgund-at-yahoo-dot-com-ya02408000R1601011752120001_at_news.ne.mediaone
.net>,
ssmulgund-at-yahoo-dot-com_at_no.spam (ssm) wrote:
>
> I'm using Oracle 8.1.5 Enterprise Edition under Windows 2000, Service
Pack
> 1. I'm trying to write some Java code that accesses an Oracle
database
> (the starter DB that gets installed during the standard Oracle
installation
> process). I'm running JDK 1.3. The code looks like this:
>
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> String user, password, url;
>
> // Get user, password, url inputs
> ...
>
> Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:_at_" +
> url, user, password)
>
> Upon execution of this last statement, an execution is thrown with the
> following output:
>
> Connecting ... Exception in thread "main"
java.lang.UnsatisfiedLinkError:
> make_c
> _state
> at oracle.jdbc.oci8.OCIDBAccess.make_c_state(Native Method)
> at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:197)
> at
> oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:142)
>
> at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
> va:214)
> at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:193)
> at
java.sql.DriverManager.getConnection(DriverManager.java:517)
> at
java.sql.DriverManager.getConnection(DriverManager.java:177)
> at JdbcConnect.main(JdbcConnect.java:21)
>
> Can anyone help me out as to what's going on here? Note that it
doesn't
> work with the thin driver either (although different exceptions result
> there). I can communicate with the same database using SQLPlus, and
> everything works fine from there. Interestingly, the Oracle ODBC Test
also
> craps out in try to connect to the database, although I'm not sure
that I
> have the ODBC source configured properly. The Oracle documentation
isn't
> of much help in this process.
>
> Help!
>
> Sandeep
Sent via Deja.com
http://www.deja.com/
Received on Wed Jan 17 2001 - 23:36:13 CET