GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 464 of 493    Print  
is SQLException run time or compile time exception?

  
Total Answers and Comments: 7 Last Update: July 14, 2008     Asked by: naggeek 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: trcdutt
 
It is a compile time exception (Checked Exception). Anything that inherits Exception class is a compile time exception and any class that inherit from RuntimeException and Error classes are unchecked Exceptions (Runtime Exceptions). SQLException is a direct subclass of Exception which means it is a checked exception. Refer to the link from Java Language spec:

http://java.sun.com/docs/books/jls/second_edition/html/exceptions.doc.html

Above answer was rated as good by the following members:
interviewprep9, er.mukesh_208
December 24, 2007 03:54:30   #1  
ksmbasha Member Since: December 2007   Contribution: 2    

RE: is SQLException run time or compile time exception?
compile time exception
 
Is this answer useful? Yes | No
January 02, 2008 00:44:51   #2  
ans_2008 Member Since: December 2007   Contribution: 2    

RE: is SQLException run time or compile time exception?
SQL Exception is Run Time Exception Call a store Procedure give one less parameter declaration it will compile but give Error when you run your Application
 
Is this answer useful? Yes | No
January 23, 2008 02:22:21   #3  
shaik_masthan Member Since: December 2005   Contribution: 8    

RE: is SQLException run time or compile time exception?
SQLException is absolutely a compile time excpeption. If you declare sqlexception in the code ,then trying to compile it ,will give error..(you should catch the exception )..so it is compile time exception

If any doubts please try to compile it..you will get solution

 
Is this answer useful? Yes | No
February 07, 2008 10:18:46   #4  
cricketfan04 Member Since: February 2008   Contribution: 2    

RE: is SQLException run time or compile time exception?
The exception is thrown at run time. The compile time complaint you are seeing is because the underlying class throws SQLException which should be handled by either a try catch block or including throws clause at the method declaration.
 
Is this answer useful? Yes | No
February 11, 2008 06:03:36   #5  
sampra Member Since: February 2008   Contribution: 279    

RE: is SQLException run time or compile time exception?
RUN Time exception
 
Is this answer useful? Yes | No
April 17, 2008 07:42:49   #6  
trcdutt Member Since: February 2008   Contribution: 3    

RE: is SQLException run time or compile time exception?
It is a compile time exception (Checked Exception). Anything that inherits Exception class is a compile time exception and any class that inherit from RuntimeException and Error classes are unchecked Exceptions (Runtime Exceptions). SQLException is a direct subclass of Exception which means it is a checked exception. Refer to the link from Java Language spec:

http://java.sun.com/docs/books/jls/second_edition/html/exceptions.doc.html

 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
July 14, 2008 01:15:39   #7  
timmireddy Member Since: May 2008   Contribution: 11    

RE: is SQLException run time or compile time exception?
SQLexception that is thrown when SQL Server returns a warning or error. This class cannot be inherited. SQLException comes under Runtime exception because errors comes under Unchecked Exceptions.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape