help needed with oci jdbc driver on Oracle 8.1.5

help needed with oci jdbc driver on Oracle 8.1.5

Post by Bing Zhen » Tue, 13 Jun 2000 04:00:00

The following code (slightly modified oracle oci example) works on Solaris
but not Win NT.  Same version of jdk (1.2.2) and JDBC Driver (oracle 1.2)
were used.  (I added the [oracle home]\lib directory to the PATH on winnt
per instruction.)

When i run it on NT, i got the following exception error.  Can someone tell
me what's going on?  Thanks in advance!
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(

        at oracle.jdbc.driver.OracleDriver.connect(
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(
        at JdbcCheckup.main(

---Code Listing---
// You need to import the java.sql package to use JDBC
import java.sql.*;
import java.math.*;
import oracle.jdbc.driver.*;
import oracle.sql.*;

class JdbcCheckup

public static void main (String args [])
throws SQLException, IOException

// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

System.out.println ("Connecting...");

"username", "password");
// Connection conn = DriverManager.getConnection

System.out.println ("connected.");

// Create a statement
Statement stmt = conn.createStatement ();

// Do the SQL "Hello World" thing
ResultSet rset = stmt.executeQuery ("select 'Hello World' from dual");

while ( ())
   System.out.println (rset.getString (1));
// close the result set, the statement and connect
System.out.println ("Your JDBC installation is correct.");



help needed with oci jdbc driver on Oracle 8.1.5

Post by BARRIE TAYLO » Wed, 12 Jul 2000 04:00:00

I'm having very similar problems, using Oracle 7.3.4 on win98.

Also noted you need to start the oracle listeners to get a connection on
port 1521.

My program and key parameters are detailed in the attached two files, I
included some reference points since there are a few things to check in
the oracle configuration etc.

One thing I am not sure of is how to check the .dll files included in the
oracle driver distribution for windows are being found by the driver

Also does anyone know how to setup ODBC:JDBC connection to Oracle? It
might turn out to be easier to get that working instead... (tho loess

import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
//import oracle.*;//this line inserted resolve classpath problem.
//import oracle.jdbc.driver.OracleDriver;
Create new project.
public class ConnectOraclewithclasses111 extends HttpServlet {
 public void doGet(HttpServletRequest req, HttpServletResponse res)
  throws ServletException,IOException
        PrintWriter out = res.getWriter();
                out.println("setting up variables in ConnectOraclewithclasses111 using oci7 driver, Tues 11-Jul, 33<BR>");
        // define query string.
          String sql1 = "select * from dual";
  { //open data base connection.
        out.println("registering driver for connection to database.<BR>");
                //DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
                out.println("class registered, getting connection.<BR>");
    Connection m_connection = DriverManager.getConnection
        ("jdbc:oracle:oci7:@SID1","scott", "tiger");
//      ("jdbc:oracle:thin:@ORCL","scott", "tiger");
//      ("jdbc:oracle:oci7:@ORCL","scott", "tiger");
        out.println("Connection to database succeeded.<BR>");
        Statement stmt = m_connection.createStatement();
                out.println("stmt created.<P>");
                stmt = m_connection.createStatement();
    { // try Z2, run query to check if userid & password are valid.
        out.println("executing sql1 ="+sql1+"<BR>");
                        ResultSet rs = stmt.executeQuery(sql1);
        out.println("sql executed.<BR>");
                        if ( // if Z3-ValidUser
                                out.println("non null set returned by query.<BR>");
                        out.println("Invalid userID or Password, please try again.");
                catch(Exception ex){ //Trap SQL errors
            out.println("Error selecting on userid.<BR>"+ex.toString()+"<br>" + System.getProperties());} // end try Z2
        }       // first try catching classnot found error.
//              catch(ClassNotFoundException ex){ //
//      out.println("Error loading driver class. Exception information<BR>"+ex.toString()+
//      "<br><br>System information.<br>" + System.getProperties());
//  }// catch all other errors.
                catch(Exception ex){ //
      out.println("Error connecting to database. Exception information<BR>"+ex.toString()+
      "<br><br>System information.<br>" + System.getProperties());
  } // end doGet


I'm pretty sure this is a java classpath type problem, but have run out of ideas.

I have been playing with apache/java servlets using jdbc connections to Oracle. At uni I had it working on Oracle8/Sun OS, also have a working installation on Oracle8/Redhat6.1 .

At the moment I am trying to get a similar configuration workin on a windows platform. I am using the following packages.
Personal Oracle7 Release - Production Release
Apache/1.3.12 (win32) Apache Jserv/1.1.2

I have tested the Apache/Jserv configuration (IsItWorking loads no problem), even had jdbc/odbc connections working communicating with MSaccess.

I am getting
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I am using the driver for windows. (NB it is written for jdk1.1.1, I'm using jdk1.1.8 is that an issue?)
my java classpath is
c:\myweb\jdk1.1.8\lib\;              #standard part of jdk library
C:\myweb\jsdk2.0\lib\jsdk.jar;                  #required for Jserv
C:\myweb\data\                    #required for jdbc bridge to Oracle.

The dll files OCI73JDBC.DLL and oci73jdbc_g.dll (not sure if the 2nd dll is required) have been manually copied across to c:\orawin95\bin directory. I also tried using only one of the dll's at a time, I havent found anything that says anything other than the dll's should be placed in the windows path.

using winzip to view the contents of shows that oracle\jdbc\driver\OracleDriver.class exists within the file.

The Oracle jdbc howto I looked at suggested using the lines below.

import java.sql.*;
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:oci7:@mydatabase","scott", tiger");

The full java file is attached below.

the Servlet runtime error message is here, a couple of things that dont make sense to me
- classpath as printed in the error message thrown does not show even though it shows when compiling.
setting up variables in ConnectOraclewithclasses111 using oci7 driver, Tues 11-Jul, 33
registering driver for connection to database.
Error connecting to database. Exception information
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

System information.
{user.language=en, java.home=C:\MYWEB\JDK1.1.8\BIN\.., java.vendor.url.bug=,,, java.version=1.1.8, file.separator=\, line.separator= , user.region=US, file.encoding=Cp1252, java.compiler=symcjit, java.vendor=Sun Microsystems Inc., user.timezone=AET,, os.arch=x86, 95, java.vendor.url=, user.dir=C:\WINDOWS\Profiles\mat\Desktop, java.class.path=c:\myweb\jserv\ApacheJServ.jar;c:\myweb\jsdk2.0\lib\jsdk.jar;C:\MYWEB\JDK1.1.8\BIN\..\classes;C:\MYWEB\JDK1.1.8\BIN\..\lib\;C:\MYWEB\JDK1.1.8\BIN\..\lib\classes.jar;C:\MYWEB\JDK1.1.8\BIN\..\lib\rt.jar;C:\MYWEB\JDK1.1.8\BIN\..\lib\i18n.jar, java.class.version=45.3, os.version=4.10, path.separator=;, user.home=C:\MYWEB\JDK1.1.8\BIN\..}

The java classpath shown when compiling is shown below from the kawa compile message below.
Class Path - .;C:\Program Files\Kawa\;c:\myweb\jdk1.1.8\lib\;C:\myweb\jsdk2.0\lib\jsdk.jar;C:\myweb\data\
File Compiled...
No Errors...

the classpath as defined in kawa > packages > classpath is

What I dont understand is how/why the code doesnt need an  "import oracle.*;" line in the java code since servlets need the jsdk.jar file in the classpath and
import javax.servlet.*;
import javax.servlet.http.*;
to load the servlet drivers.

I looked at tnsnames.ora to find the "SID" for my system, chose ORCL. left the password as scott/tiger.

Any ideas??

I have attached below screendumps and the key configuration files from the major packages, maybe there is something obvious there.

This is screendump from starting Oracle windows client.
SQL*Plus: Release - Production on Fri Jul 07 10:54:41 2000
Copyright (c) Oracle Corporation 1979, 1996.  All rights reserved.
Connected to:
Personal Oracle7 Release - Production Release
With the distributed and replication options
PL/SQL Release - Production

this is screendump from starting oracle listener,

LSNRCTL for 32-bit Windows: Version - Production on 07-JUL-00 10:54:19
Copyright (c) Oracle Corporation 1994.  All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for 32-bit Windows: Version - Production
System parameter file is C:\ORAWIN95\network\admin\listener.ora
Log messages written to C:\ORAWIN95\network\log\listener.log
Listening on: (ADDRESS=(PROTOCOL=tcp)(DEV=124)(HOST=
Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version - Production
Start Date                07-JUL-00 10:54:23
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   C:\ORAWIN95\network\admin\listener.ora
Listener Log File         C:\ORAWIN95\network\log\listener.log
Services Summary...
  ORCL          has 1 service handler(s)
The command completed successfully

the tnsnames.ora file is below for reference.

#This is a SQL*Net Configuration file generated by SQL*Net Easy Configuration.
#Attention: Do not modify this file yourself.
#If you do, your SQL*Net Easy Configuration may not function properly. =
        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = TCP)
          (Host = Production1)
          (Port = 1521)
  ) =
        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = SPX)
          (Service = Server_lsnr)
  ) =
        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = NMP)
          (Server = FinanceServer1)
          (Pipe = ORAPIPE)
  ) =
        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = TCP)
          (Host =
          (Port = 1521)
        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = TCP)
          (Host =
          (Port =

read more »


help needed with oci jdbc driver on Oracle 8.1.5

Post by par.. » Thu, 13 Jul 2000 04:00:00


1. The Oracle documentation states that you need the following two
import statements.
  import java.sql.*;
  import java.math.*;

2. The classpath problem you've gotten around with by importing
oracle.* and oracle.jdbc.driver.OracleDriver would have better been
solved by adding the file to the classpath.

3. The import statement is used for resolving shorten class names.
When you use the full class name then no import statement is required.

  - references to the JFrame class are usually preceeded by "import
  - if you reference javax.swing.JFrame then the import statement is
not required.
  - thus "DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());" also does not require an import

4.  To use OCI to access an oracle database on your workstation, try
either of the following getConnection statements:

loopback","scott", "tiger");


(connect_data=(sid=orcl)))","scott", "tiger");

5.  Using is not an issue for jdk1.1.8  (however it is
an issue for jdk1.2.2).

Hope this helps, parsed

Quote:> I'm having very similar problems, using Oracle 7.3.4 on win98.
> MAtt

Sent via
Before you buy.

1. the problem about OCI JDBC driver of Oracle?


I want to develop a java application with Oracle and hope to utilize JDBC to
communicate with ORACLE on solaris 7.

I use java 1.2.1(Solaris VM (build Solaris_JDK_1.2.1_03a, native threads,
sunwjit)) as my tool,but this version of my Oracle is 8.0.5 and it is not
support java 1.2.
In java 1.1,the JDBC interface works well.
In java 1.2,the OCI JDBC driver can't run in a right way.
But I must use java 1.2 and OCI JDBC driver.

how to do I can?

I tried to download the Oracle JDBC Drivers release"JDBC 8.1.6
drivers can talk to RDBMS 8.1.6, 8.1.6sdk, 8.1.5, 8.0.6, 8.0.5, 8.0.4 and
7.3.4. ".

Its README said "Support for JDK 1.2.x".

I copied "," to $ORACLE_HOME/jdbc/lib and
copied "" to $ORACLE_HOME/lib.


But I run the program of OCI verion.
I got "$ java Employee
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in
java.library.path ".

How to do?

Help me,please.


2. US, DC, MD, VA, Oracle

3. jdbc oracle oci driver & to_date()

4. Duration/scope of SET ISOLATION and SET LOCK MODE TO WAIT


6. Paradox 7/32, Win 2K or Win XP, Disc size

7. Oracle JDBC OCI driver results in ORA-24806 when using NCLOBS

8. SQL Server

9. Oracle JDBC OCI driver - setFloat not working

10. Oracle Thin & OCI JDBC drivers

11. Oracle OCI vs thin JDBC driver

12. Oracle JDBC OCI driver results in ORA-24806 when using NCLOBS