Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol

 
arjun gaur
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my table ::

create table User1(Username varchar2(20) ,
First_Name varchar2(20) ,
Last_Name varchar2(20) ,
Password varchar2(20) ,
Date_Of_Birth Date )


Hey! i have this code but i'm getting
i edited my code,made the changes but now i'm getting error-unreported exception ClassNotFounfException must be caught or declared to be thrown Class.forName("oracle.jdbc.OracleDriver")

same error for st.close() , ps.close() and rs.close()




Please help
Thanks
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class.forName() method throws the ClassNotFoundException. Your code clearly haven't cater this. SQLException and ClassNotFoundException are2 difrerent exceptions. If you also do Class.forName(...).newInstance() then you will also need to catch InstantiationException and IllegalAccessException.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!