i get a classdef not found error in my code.help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saranya sara
    New Member
    • Jan 2011
    • 1

    #1

    i get a classdef not found error in my code.help me

    Code:
    import java.io.*;
    import java.sql.*;
    
    import java.lang.*;
    
    public class OraThin 
    {
      public static void main(String[] args)
     {
        try {
          Connection con=null;
          Class.forName("oracle.jdbc.driver.OracleDriver");
          con=DriverManager.getConnection("jdbc:oracle:thin:@saran:1521:ss", "scott", "tiger");
          Statement s=con.createStatement();
          s.execute("INSERT INTO ss VALUES ('William Shakespeare')");
          s.close();
          con.close();
       }
     catch(Exception e)
      {
    e.printStackTrace();
    }
     }
    }



    my classpath is
    classpath=".C:\ oraclexe\app\or acle\product\10 .2.0\server\jdb c\lib"
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    Looks like you have a classpath error.

    Try:
    Code:
    SET classpath=.;C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib

    I removed the quotes and the space before the word "server".

    Luck!
    Oralloy
    Last edited by Oralloy; Jan 3 '11, 09:29 PM. Reason: Added explanatory note to my suggestion.

    Comment

    Working...