• 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: 3585
16
Android Java
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic