File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes class not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "class not found error" Watch "class not found error" New topic

class not found error

raghav sai

Joined: Sep 22, 2011
Posts: 1
import java.util.*;
import java.sql.*;
class DDemo
public static void main(String[] args) throws Exception
Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521:XE","system","cse508");
Scanner sc=new Scanner(;
System.out.println("enter rno");
int n=sc.nextInt();
PreparedStatement pst=con.prepareStatement("insert into student values(?)");
System.out.println("row inserted");
the above is my program
even after setting the classpath i am getting java.lang.classnotfounderror
can you please helpme
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32330

Welcome to CodeRanch!

Can you show what is in your classpath? Are you running at the command line or in an IDE?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1577
Looks like your first post, just for your information, we do have useful-tags.

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
I agree. Here's the link:
subject: class not found error
It's not a secret anymore!