• Post Reply Bookmark Topic Watch Topic
  • New Topic

class not found error  RSS feed

 
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
 
author & internet detective
Marshal
Posts: 37688
574
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?
 
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!