Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol  RSS feed

 
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: 3648
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!