This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

class not found error  RSS feed

 
raghav sai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 36463
464
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Can you show what is in your classpath? Are you running at the command line or in an IDE?
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your first post, just for your information, we do have useful-tags.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!