aspose file tools*
The moose likes JDBC 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "class not found error" Watch "class not found error" New topic
Author

class not found error

raghav sai
Greenhorn

Joined: Sep 22, 2011
Posts: 1
import java.util.*;
import java.sql.*;
class DDemo
{
public static void main(String[] args) throws Exception
{
Class.forName("oracle.jdbc.OracleDriver");
Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521:XE","system","cse508");
Scanner sc=new Scanner(System.in);
System.out.println("enter rno");
int n=sc.nextInt();
PreparedStatement pst=con.prepareStatement("insert into student values(?)");
pst.setInt(1,n);
pst.execute();
System.out.println("row inserted");
con.close();
}
}
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
Marshal

Joined: May 26, 2003
Posts: 30753
    
156

Welcome to CodeRanch!

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


[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: 1527
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: http://aspose.com/file-tools
 
subject: class not found error