Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2007, 01:01 PM
Member
 
Join Date: Jul 2007
Posts: 72
Swamipsn is on a distinguished road
Pls help
Hi,
While I am trying to compile my code in NetBeans IDE following exception thrown

Code:

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 01:10 PM. Reason: Code placed inside [code] tag.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-02-2007, 01:12 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-02-2007, 01:55 PM
Member
 
Join Date: Jul 2007
Posts: 72
Swamipsn is on a distinguished road
I did the same
Thanks I did the same now also the same problem presented..? Any idea
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-02-2007, 03:33 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Quote:
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?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 11:18 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org