Solved

Sun One ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Posted on 2003-11-24
3
377 Views
Last Modified: 2013-11-21
I am trying to set up the Oracle jdbc on Sun One Web Server Enterprise Edition 6.1 but do not seem to be having any luck.  It seems that OCI and thin fails.

I have installed the Oracle client in the folder c:\oracle\ora92.  I have selected the following items to install in the Oracle client: Oracle 9i Client 9.2.0.1.0, Common files, JDBC/OCI, JDBC/Thin, and Internet Directory Client.  (I then downloaded ojdbc14.jar and placed it in jdbc\lib folder.)

I am seeing the following error: ClassNotFoundException: oracle.jdbc.driver.OracleDriver

From the following web page:
<code>
<%@page language="java"
       import="java.sql.*,
       oracle.jdbc.driver.*,
       oracle.sql.*
   "%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Hello World
</title>
</head>
<body>
<%
//connections to ops2
 DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
 Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@wydot-ops2","username","password");

 Statement stmt = conn.createStatement();
 ResultSet rset = null;

rset = stmt.executeQuery("SELECT AGENCY_NUMID,AGENCY_NAME FROM flightsch.state_agencies ORDER BY agency_name");

 while(rset.next())  
   {
     String ag_name = rset.getString("agency_name");  
%>
       <%= ag_name%>
<%
   }     //end of while loop
 rset.close();
 stmt.close();
 conn.close();
%>
</body>
</html>
</code>

I have made the following entries into the Sun One Administration pages:
Java Tab
JVM path Settings
   Classpath suffix = c:\oracle\ora92\jdbc\lib
   Ignore Env Class Path = on
   Native Lib Path Prefix = c:\j2sdk1.4.2_02\lib
   Native Lib Path Suffix =
JDBC Connection Pools
   Pool = jdbc-oracle-pool
   DataSource Classname = oracle.jdbc.pool.Oracle.DataSource
   URL = wydot-ops2
   User = username
    Password = password
    (Rest of items = defaults)

0
Comment
Question by:wykzimme
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 9811684
you need to make sure the class jar is on the classpath...

I have no idea with SunOne, but I *think* the file is called classes12.zip

it may be called: ojdbc14.jar now though...

Classpath suffix = c:\oracle\ora92\jdbc\lib\ojdbc14.jar

if it is...

have a look inside the jar with winzip to check the class is there...

Tim
0
 

Author Comment

by:wykzimme
ID: 9811797
It did not work by adding it to the suffix.  I did add it to the Environment variable for the system and then OCI worked.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9811815
how about thin?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to parse custom JSON to POJO java 4 56
WEB Farm 6 64
Oracle SQL syntax check  without executing 6 37
even odd program using while loop 3 29
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now