473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

class not found exception

2 New Member
hi,
i got class not found exception of a small jdbc program in windows.

the program is like this
Expand|Select|Wrap|Line Numbers
  1. import java.sql.*;
  2. public class Db1
  3. {         
  4.         public static void main(String a[]) throws Exception
  5.         {
  6.        Class.forName("oracle.jdbc.driver.OracleDriver");
  7.     //Driver  drv=new oracle.jdbc.driver.OracleDriver();
  8.     //DriverManager.registerDriver(drv);
  9.         Connection con=DriverManager.getConnection("jdbc.oracle:thin:@localhost:1521:orcl","scott","tiger");
  10.         System.out.println("concls->"+con.getClass());
  11.  
  12.         }
  13. }
  14.  and the problem is like this
  15.  
  16.  
  17. E:\work>javac Db1.java
  18. Db1.java:21: cannot find symbol
  19. symbol  : variable con
  20. location: class Db1
  21.              System.out.println("concls->"+con.getClass());
  22.                                            ^
1 error

E:\work>javac Db1.java

E:\work>java Db1
java.lang.Class NotFoundExcepti on: oracle.jdbc.dri ver.OracleDrive r
Exception in thread "main" java.lang.NullP ointerException
at Db1.main(Db1.ja va:21)

E:\work>javac Db1.java

E:\work>java Db1
Exception in thread "main" java.lang.Class NotFoundExcepti on: oracle.jdbc.dri ver.
OracleDriver
at java.net.URLCla ssLoader$1.run( Unknown Source)
at java.security.A ccessController .doPrivileged(N ative Method)
at java.net.URLCla ssLoader.findCl ass(Unknown Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.misc.Launch er$AppClassLoad er.loadClass(Un known Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at java.lang.Class Loader.loadClas sInternal(Unkno wn Source)
at java.lang.Class .forName0(Nativ e Method)
at java.lang.Class .forName(Unknow n Source)
at Db1.main(Db1.ja va:6)

E:\work>

I already set the classpath and i already check the Services.msc also.
there is no problem over their.

i am using oracle 9 software
Dec 17 '07 #1
4 2128
debasisdas
8,127 Recognized Expert Expert
Question moved to java forum .
Dec 17 '07 #2
BigDaddyLH
1,216 Recognized Expert Top Contributor
I already set the classpath
But what did you set it to? Does it include the driver's jar? I don't think so!
Dec 17 '07 #3
vasavimaruthi
2 New Member
But what did you set it to? Does it include the driver's jar? I don't think so!

the necessary jar file for my jdbc driver is classes12.jar
i copied tht into my working directory.. like this

E:\work\classes 12.jar
Dec 18 '07 #4
BigDaddyLH
1,216 Recognized Expert Top Contributor
the necessary jar file for my jdbc driver is classes12.jar
i copied tht into my working directory.. like this

E:\work\classes 12.jar
It doesn't matter where you put library jars, like your driver jar, as long as the jar is on the classpath!
Dec 18 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2031
by: dinks | last post by:
Hi, I'm new to C++ and have been assigned a task which i dont completely understand. Any help would be greately appreciated. Here is the problem: The class "linkedListType" use the "assert" facility. I am to get rid of them and replace them with exceptions. I need to create a "linkedListException" class that's declared and implemented in my "linkedListType" class. This class needs to inherit from the base "exception" class and return...
4
5616
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal transaction As SqlTransaction, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object)
5
3414
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
0
3209
by: Daniel Sélen Secches | last post by:
I found a good class to do a simple FTP. Very good.... I'm posting it with the message, i hope it helps someone ============================================================== Imports System.Net
1
7091
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final deployment on Jan 2, 2004 got following messages and errors... I reset everything and tried several times agian. Then erased the setup project and tried to rebuild a new one with the same errors. PLease note... ALL this this code ran perfectly five minutes...
0
1467
by: Nol | last post by:
Hi all, My webservice throws an exception, which is translated into a soap Fault in the soap message body. See below for the actual message format as it is send by the server. On the (dotNet) client I get (catch) this as a SoapException (or SoapHeaderException). The SoapException contains various (string type) fields. For example, the Message fields contains the fully qualified name of the exception on the server side. The...
12
2520
by: mast2as | last post by:
Hi everyone... I have a TExceptionHandler class that is uses in the code to thow exceptions. Whenever an exception is thrown the TExceptionHander constructor takes an error code (int) as an argument. I was hoping to create a map<int, const char*that would be used in the showError member function of the TExceptionHandler class where the key (int) would be the error code and const char* the message printed out to the console. My question...
0
1409
by: dfa_geko | last post by:
Hi All, Just had a question about the RSACryptoServiceProvider class. I'm kind of a newbie at this. In the following code at the end of the message, does the key get stored in the User Profile key store in the OS? I'm assuming that if this is the case then if I were to encrypt the file in one machine, it will not decrypt on another as the key is stored in the OS. Am I right about that?
11
6236
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accidentally calling the original attribute instead of the wrapped version. Does anyone have a simple solution for this?
0
8171
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8615
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8568
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6081
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
1699
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.