Results 1 to 4 of 4

Thread: Pls help

  1. #1
    Swamipsn is offline Member
    Join Date
    Jul 2007
    Posts
    74
    Rep Power
    0

    Smile Pls help

    Hi,
    While I am trying to compile my code in NetBeans IDE following exception thrown

    Code:

    Java Code:
    try {
                          Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); 
            Connection con = DriverManager.getConnection("jdbc:odbc:cart");
                Statement st=con.createStatement();
                //ResultSet rs = null;
              st.executeUpdate("INSERT INTO signup(Name,Adr,Phno,mail,Log,pass,acno,Creditno,pin) VALUES('" + n + "','" + t + "','" + e + "','" + lo + "','" + p + "','" + ac + "','" + cr + "','" + pin + "')" );
              
             }
             catch(SQLException exe)
             {
                 System.out.println(exe);
             }
    Exception: com/mycompany/signup.java [54:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown

    Any one please tel me what went wrong
    Last edited by levent; 08-02-2007 at 12:10 PM. Reason: Code placed inside [code] tag.

  2. #2
    levent Guest

    Default

    Hi Swamipsn,

    This error is simple. You will need to catch ClassNotFoundException in your try-catch block. Currently you are just trying to catch SQLException there!

    By the way, please place your codes inside [code] tag.

  3. #3
    Swamipsn is offline Member
    Join Date
    Jul 2007
    Posts
    74
    Rep Power
    0

    Red face I did the same

    Thanks I did the same now also the same problem presented..? Any idea

  4. #4
    levent Guest

    Default

    Thanks I did the same now also the same problem presented..? Any idea
    The problem should have been solved by doing that. What is the new error and the code?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •