- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					Find line that throws an exception
				
					
						
							In a JDBC Application, 
 
 (1) Loading the Driver,
 (2) Statement Creation,
 (3) ResultSet all thorw SQLException.
 
 when we put this code in single try/catch block, how do we know which code of line thrown an Exception? I mean, it should be either of (1), (2) and (3).
 
 How do we distinguish them? Any Advices Appreciated.
 
 
 
 
 
 
 
 
 
- 
	
	
		
			
			
				Contributing Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					Re: Find line that throws an exception
				
					
						
							My opinion is after each statement you need to print some message. If message print your console then that statement does not have a problem. Otherwise that will throw on Exception.
 
 --------------------
 suresh
 
 
 
 
 
 
 
 
 
- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					Re: Find line that throws an exception
				
					
						
							when an exception is thrown print the stack trace and see which method actully cused the exception.
 
 
 
 
 
 
 
 
 
 
	
	
	
	
	
	
	
	
	
	
	
	
		
		
			
				 Posting Permissions
				Posting Permissions
			
			
				
	
		- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-  
Forum Rules