<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Southmp3 audio songs free download &#187; Java</title>
	<atom:link href="http://www.onetechstudio.com/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.onetechstudio.com</link>
	<description>Entertainment @ 1 Tech Studio</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:08:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Java Exception Handling</title>
		<link>http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html</link>
		<comments>http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html#comments</comments>
		<pubDate>Sat, 19 Nov 2011 01:32:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Telugu Movie News]]></category>
		<category><![CDATA[Exceptions]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://onetechstudio.com/?p=284</guid>
		<description><![CDATA[&#160; Java Exception Handling &#60;span style=&#8221;color:blue;&#8221;&#62; I. Introduction &#60;/span&#62; &#60;IMG SRC=&#8221;rose exception.gif&#8221; WIDTH=&#8221;552&#8243; HEIGHT=&#8221;481&#8243; BORDER=&#8221;0&#8243; ALT=&#8221;"&#62; &#60;p&#62; An exception is an error thrown by a class or method reporting an error in operation. For example, dividing by zero is undefined in mathematics, and a calculation can fail if this winds up being the case because [...]
Related posts:<ol>
<li><a href='http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html' rel='bookmark' title='PL/SQL Exception Handling'>PL/SQL Exception Handling</a> <small>Summary...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">&nbsp;</p>
<h2 style="text-align: center;"><strong><span style="color: #0000ff;">Java Exception Handling</span></strong></h2>
<p style="text-align: center;"><strong><span style="color: #0000ff;"> </span></strong></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt; I. Introduction &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;IMG SRC=&#8221;rose exception.gif&#8221; WIDTH=&#8221;552&#8243; HEIGHT=&#8221;481&#8243; BORDER=&#8221;0&#8243; ALT=&#8221;"&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">An exception is an error thrown by a class or method reporting an error in operation. For example, dividing by zero is undefined in mathematics, and a calculation can fail if this winds up being the case because of an error in user input. In this particular case an ArithmeticException is thrown, and unless the programmer looks for this exception and manually puts in code to handle it, the program will crash stating the exception thrown and a stack trace, which would be unhelpful to a casual user of a Java program. If the programmer handles the exception, he could deliver a useful error to the user and return the user to the beginning of the program so that they could continue to use it.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/P&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt;  II. Common Exceptions  &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">There are many different exceptions that can be thrown by a program, and the Java API contains quite a few. A lot are contained in the default package, java.lang; however, when you start using more functionality such as AWT, Swing, or java.io, the packages may also contain additional exceptions thrown by those libraries. As you start expanding the functionality, it might be a good idea to look at potential exceptions in the package and when they might be thrown in the course of your application. Here is a primer of some:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/P&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; ArithmeticException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Thrown if a program attempts to perform division by zero</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; ArrayIndexOutOfBoundsException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Thrown if a program attempts to access an index of an array that does not exist</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; StringIndexOutOfBoundsException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Thrown if a program attempts to access a character at a non-existent index in a String</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; NullPointerException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Thrown if the JVM attempts to perform an operation on an Object that points to no data, or null</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; NumberFormatException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Thrown if a program is attempting to convert a string to a numerical datatype, and the string contains inappropriate characters (i.e. &#8216;z&#8217; or &#8216;Q&#8217;)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; ClassNotFoundException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Thrown if a program can not find a class it depends at runtime (i.e., the class&#8217;s &#8220;.class&#8221; file cannot be found or was removed from the CLASSPATH)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;br&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;i&gt;&lt;span style=&#8221;color:red;&#8221;&gt; IOException&lt;/span&gt;&lt;/i&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8211;Actually contained in java.io, but it is thrown if the JVM failed to open an I/O stream</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">As I said before, many different exceptions exist, and you should probably use your API documentation to learn about additional exceptions that may apply to your particular application.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt; III. &#8220;Catching&#8221; Exceptions   &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The java language contains keywords used specifically for testing for and handling exceptions. The ones we will be using here are try and catch, and they must be used in conjunction with one another. They sort of work like if-else:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">try{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/*</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Contains code to be tested</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">*/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}catch(Exception e){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/*</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Contains code to be executed if instanced of Exception is caught</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">*/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The catch statement can look for all exceptions, using the Exception superclass, or it can catch a specific exception that you think could be thrown in the code you are testing with the try block. You can even have multiple catch blocks to catch and execute custom code for a number of different errors. A good thing to note would be that any particular exception that is caught is compared with each catch statement sequentially; so it is a good idea to put more generic exceptions, like Exception, towards the bottom of the list.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt;  IV. The Throwable Superclass  &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The catch statement also stores an instance of the exception that was caught in the variable that the programmer uses, in the previous example Exception e. While all exceptions are subclasses of Exception, Exception itself is a subclass of Throwable, which contains a nice suite of methods that you can use to get all kinds of information to report about your exceptions:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">getMessage()&#8211;returns the error message reported by the exception in a String</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">printStackTrace()&#8211;prints the stack trace of the exception to standard output, useful for debugging purposes in locating where the exception occurred</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">printStackTrace(PrintStream s)&#8211;prints the stack trace to an alternative output stream</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">printStackTrace(PrintWriter s)&#8211;prints the stack trace to a file, this way you can log stack traces transparent to the user or log for later reference</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">toString()&#8211;if you just decide to print out the exception it will print out this: NAME_OF_EXCEPTION: getMessage().</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Using the catch you now have control over what the error message is and where it goes.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt;  V. Effectively using try-catch   &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In this section, I&#8217;m going to give you a few code samples on using try-catch blocks to give you an idea of the flexibility you as a programmer have over exceptions in your programs. The scenario is a user has input a file name to a program of a file that does not exist. In this scenario we are going to be using a text-based program; however, in a graphical environment you can easily use the catch block to draw dialog boxes. In the first example, we want to print a useful error message and exit the program gracefully, saving the user from the confusing stack trace with something useful:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">try{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">BufferedReader in = new BufferedReader(new FileReader(userInput));</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.out.println(in.readLine())</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}catch(IOException e){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.err.println(e.getMessage());</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.err.println(&#8220;Error: &#8221; + userInput + &#8221; is not a valid file. Please verify that the file exists and that you have access to it.&#8221;);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.exit(1);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Here, System.err.println() prints the error message to standard error output which is a high priority buffer that is used to report error messages to the console. If you&#8217;re being a good programmer, you have separate methods that handle the different functionality of your programs; this way you can easily start the program from a previous place in the program before an exception occurs. In this next example, the user inputs the filename through the function getUserInput() elsewhere in the program; we want to report the &#8220;helpful error message&#8221; to the user and return the user to a place where he can enter a new filename.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">public String getFileInput(String userInput){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">try{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">BufferedReader in = new BufferedReader(new FileReader(userInput));</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return in.readLine();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}catch(IOException e){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.err.println(e.getMessage());</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">System.err.println(&#8220;Error: &#8221; + userInput + &#8221; is not a valid file. Please verify that the file exists and that you have access to it.&#8221;);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return getFileInput(getUserInput());</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Now you have an idea of how you can control your programs once an exception is thrown, and this should give you the basic idea of how to work with exceptions in the Java language.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;span style=&#8221;color:blue;&#8221;&gt;  VI. Final Thoughts on Exceptions    &lt;/span&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;p&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The best way to prevent your application from crashing from exceptions is to avoid exceptions in the first place. It is much more costly for a system to catch and handle exceptions than to account for potential errors directly in your code. A lot of times, an exception can point to a problem in the programmer&#8217;s logic rather than in the user&#8217;s use of the program. You should look for the cause of exceptions, and try to understand why it occurred and make sure that you really had considered everything. You will be making far more resilient and robust applications.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/p&gt;</div>
<p><span style="color: #0000ff;"><br />
</span></p>
<p><img class="aligncenter size-full wp-image-291" title="rose exception" src="http://onetechstudio.com/wp-content/uploads/2009/11/rose-exception.gif" alt="rose exception" width="452" height="381" /></p>
<p><span style="color: #0000ff;">I. Introduction</span></p>
<p>An exception is an error thrown by a class or method reporting an error in operation. For example, dividing by zero is undefined in mathematics, and a calculation can fail if this winds up being the case because of an error in user input. In this particular case an ArithmeticException is thrown, and unless the programmer looks for this exception and manually puts in code to handle it, the program will crash stating the exception thrown and a stack trace, which would be unhelpful to a casual user of a Java program. If the programmer handles the exception, he could deliver a useful error to the user and return the user to the beginning of the program so that they could continue to use it.</p>
<p><span style="color: #0000ff;"> II. Common Exceptions </span></p>
<p>There are many different exceptions that can be thrown by a program, and the Java API contains quite a few. A lot are contained in the default package, java.lang; however, when you start using more functionality such as AWT, Swing, or java.io, the packages may also contain additional exceptions thrown by those libraries. As you start expanding the functionality, it might be a good idea to look at potential exceptions in the package and when they might be thrown in the course of your application. Here is a primer of some:</p>
<p><span style="color: #ff0000;"><em> ArithmeticException</em></span></p>
<p>Thrown if a program attempts to perform division by zero</p>
<p><span style="font-style: italic;"><span style="color: #f91d05;">ArrayIndexOutOfBoundsException</span></span></p>
<p>Thrown if a program attempts to access an index of an array that does not exist</p>
<p><em><span style="color: #ff0000;">StringIndexOutOfBoundsException</span></em></p>
<p>Thrown if a program attempts to access a character at a non-existent index in a String</p>
<p><em><span style="color: #f91d05;">NullPointerException</span></em></p>
<p>Thrown if the JVM attempts to perform an operation on an Object that points to no data, or null</p>
<p><em><span style="color: #ff0000;">NumberFormatException</span></em></p>
<p>Thrown if a program is attempting to convert a string to a numerical datatype, and the string contains inappropriate characters (i.e. &#8216;z&#8217; or &#8216;Q&#8217;)</p>
<p><em><span style="color: #ff0000;"> ClassNotFoundException</span></em></p>
<p>Thrown if a program can not find a class it depends at runtime (i.e., the class&#8217;s &#8220;.class&#8221; file cannot be found or was removed from the CLASSPATH)</p>
<p><span style="color: #ff0000;"><em> IOExceptio</em></span><span style="color: #ff0000;"><em>n</em></span></p>
<p>Actually contained in java.io, but it is thrown if the JVM failed to open an I/O stream</p>
<p>As I said before, many different exceptions exist, and you should probably use your API documentation to learn about additional exceptions that may apply to your particular application.</p>
<p><span style="color: #0000ff;"> III. &#8220;Catching&#8221; Exceptions </span></p>
<p>The java language contains keywords used specifically for testing for and handling exceptions. The ones we will be using here are try and catch, and they must be used in conjunction with one another. They sort of work like if-else:</p>
<p>try{</p>
<p>/*</p>
<p>Contains code to be tested</p>
<p>*/</p>
<p>}catch(Exception e){</p>
<p>/*</p>
<p>Contains code to be executed if instanced of Exception is caught</p>
<p>*/</p>
<p>}</p>
<p>The catch statement can look for all exceptions, using the Exception superclass, or it can catch a specific exception that you think could be thrown in the code you are testing with the try block. You can even have multiple catch blocks to catch and execute custom code for a number of different errors. A good thing to note would be that any particular exception that is caught is compared with each catch statement sequentially; so it is a good idea to put more generic exceptions, like Exception, towards the bottom of the list.</p>
<p><span style="color: #0000ff;"> IV. The Throwable Superclass</span></p>
<p>The catch statement also stores an instance of the exception that was caught in the variable that the programmer uses, in the previous example Exception e. While all exceptions are subclasses of Exception, Exception itself is a subclass of Throwable, which contains a nice suite of methods that you can use to get all kinds of information to report about your exceptions:</p>
<p>getMessage()&#8211;returns the error message reported by the exception in a String</p>
<p>printStackTrace()&#8211;prints the stack trace of the exception to standard output, useful for debugging purposes in locating where the exception occurred</p>
<p>printStackTrace(PrintStream s)&#8211;prints the stack trace to an alternative output stream</p>
<p>printStackTrace(PrintWriter s)&#8211;prints the stack trace to a file, this way you can log stack traces transparent to the user or log for later reference</p>
<p>toString()&#8211;if you just decide to print out the exception it will print out this: NAME_OF_EXCEPTION: getMessage().</p>
<p>Using the catch you now have control over what the error message is and where it goes.</p>
<p><span style="color: #0000ff;"> V. Effectively using try-catch </span></p>
<p>In this section, I&#8217;m going to give you a few code samples on using try-catch blocks to give you an idea of the flexibility you as a programmer have over exceptions in your programs. The scenario is a user has input a file name to a program of a file that does not exist. In this scenario we are going to be using a text-based program; however, in a graphical environment you can easily use the catch block to draw dialog boxes. In the first example, we want to print a useful error message and exit the program gracefully, saving the user from the confusing stack trace with something useful:</p>
<p>try{</p>
<p>BufferedReader in = new BufferedReader(new FileReader(userInput));</p>
<p>System.out.println(in.readLine())</p>
<p>}catch(IOException e){</p>
<p>System.err.println(e.getMessage());</p>
<p>System.err.println(&#8220;Error: &#8221; + userInput + &#8221; is not a valid file. Please verify that the file exists and that you have access to it.&#8221;);</p>
<p>System.exit(1);</p>
<p>}</p>
<p>Here, System.err.println() prints the error message to standard error output which is a high priority buffer that is used to report error messages to the console. If you&#8217;re being a good programmer, you have separate methods that handle the different functionality of your programs; this way you can easily start the program from a previous place in the program before an exception occurs. In this next example, the user inputs the filename through the function getUserInput() elsewhere in the program; we want to report the &#8220;helpful error message&#8221; to the user and return the user to a place where he can enter a new filename.</p>
<p>public String getFileInput(String userInput){</p>
<p>try{</p>
<p>BufferedReader in = new BufferedReader(new FileReader(userInput));</p>
<p>return in.readLine();</p>
<p>}catch(IOException e){</p>
<p>System.err.println(e.getMessage());</p>
<p>System.err.println(&#8220;Error: &#8221; + userInput + &#8221; is not a valid file. Please verify that the file exists and that you have access to it.&#8221;);</p>
<p>return getFileInput(getUserInput());</p>
<p>}</p>
<p>Now you have an idea of how you can control your programs once an exception is thrown, and this should give you the basic idea of how to work with exceptions in the Java language.</p>
<p><span style="color: #0000ff;"> VI. Final Thoughts on Exceptions</span></p>
<p>The best way to prevent your application from crashing from exceptions is to avoid exceptions in the first place. It is much more costly for a system to catch and handle exceptions than to account for potential errors directly in your code. A lot of times, an exception can point to a problem in the programmer&#8217;s logic rather than in the user&#8217;s use of the program. You should look for the cause of exceptions, and try to understand why it occurred and make sure that you really had considered everything. You will be making far more resilient and robust applications.</p>
<h3><span style="color: #800080;">Some Examples of  Exceptions</span></h3>
<table style="text-align: center;" border="1" cellpadding="0">
<tbody>
<tr>
<td>
<h2><strong><span style="color: #993366;">arithmetic.java</span></strong></h2>
</td>
</tr>
<tr>
<td>&nbsp;</p>
<p>public class arithmetic {</p>
<p>public static   void main(String[] args) {</p>
<p>int a,b,c;</p>
<p>a=5;</p>
<p>b=0;</p>
<p>c=a/b;</p>
<p>System.out.println(c);</p>
<p>}</p>
<p>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Output</p>
<p>******</p>
<p>&nbsp;</p>
<p>Exception in thread &#8220;main&#8221;   java.lang.ArithmeticException: / by zero</p>
<p>at   arithmetic.main(arithmetic.java:6</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<table style="text-align: center;" border="1" cellpadding="0">
<tbody>
<tr>
<td>
<h2 style="text-align: center;"><strong><span style="color: #993366;">arrayindex.java</span></strong></h2>
</td>
</tr>
<tr>
<td>&nbsp;</p>
<p>public class arrayindex {</p>
<p>public static   void main(String[] args) {</p>
<p>int a[]= new   int[5];</p>
<p>int b[]=   {1,2,3,4,5,6};</p>
<p>for(int   i=0;i&lt;6;i++){</p>
<p>a[i]=b[i];</p>
<p>System.out.println(a[i]);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Output</p>
<p>******</p>
<p>&nbsp;</p>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>Exception in thread &#8220;main&#8221;   java.lang.ArrayIndexOutOfBoundsException: 5</p>
<p>at   arrayindex.main(arrayindex.java:8)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<table style="text-align: center;" border="1" cellpadding="0">
<tbody>
<tr>
<td>
<h2 style="text-align: center;"><strong><span style="color: #993366;">StringIndexOutofBounds.java</span></strong></h2>
</td>
</tr>
<tr>
<td>&nbsp;</p>
<p>public class StringIndexOutofBounds {</p>
<p>&nbsp;</p>
<p>public static   void main(String[] args) {</p>
<p>&nbsp;</p>
<p>String str=   &#8220;String Index out of Bounds Exception&#8221;;</p>
<p>String str2=   str.substring(50);</p>
<p>System.out.println(str2);</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Output</p>
<p>******</p>
<p>&nbsp;</p>
<p>Exception in thread &#8220;main&#8221;   java.lang.StringIndexOutOfBoundsException:</p>
<p>String index out of   range: -14</p>
<p>at   java.lang.String.substring(Unknown Source)</p>
<p>at   java.lang.String.substring(Unknown Source)</p>
<p>at   StringIndexOutofBounds.main(StringIndexOutofBounds.java:7)</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<table style="text-align: center;" border="1" cellpadding="0">
<tbody>
<tr>
<td>
<h2 style="text-align: center;"><strong><span style="color: #993366;">UnSupportedOperation.java</span></strong></h2>
</td>
</tr>
<tr>
<td>
<p style="text-align: center;">&nbsp;</p>
<p>import java.util.ArrayList;</p>
<p>import java.util.Collections;</p>
<p>import java.util.List;</p>
<p>public class UnSupportedOperation {</p>
<p>public static   void main(String[] args) {</p>
<p>al = new   ArrayList();</p>
<p>al.add(2);</p>
<p>al.add(3);</p>
<p>al =   Collections.unmodifiableList(al);</p>
<p>al.add(4);</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Output</p>
<p>******</p>
<p>&nbsp;</p>
<p>Exception in thread &#8220;main&#8221;   java.lang.UnsupportedOperationException</p>
<p>at   java.util.Collections$UnmodifiableCollection.add(Unknown Source)</p>
<p>at   UnSupportedOperation.main(UnSupportedOperation.java:10)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<table style="text-align: center;" border="1" cellpadding="0">
<tbody>
<tr>
<td>
<h5><strong><span style="color: #993366;"><span style="color: #000000; font-size: small;"><span style="font-weight: normal; line-height: 19px;"><span style="font-size: small;">ArrayStore.java</span></span></span></span></strong></h5>
</td>
</tr>
<tr>
<td>&nbsp;</p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">public class ArrayStore {</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">public static   void main(String args[]) {</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">int a[]={};</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">double b[] = {2.4,5.3};</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">for(int i=0;i&lt;2;i++)</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">a[i]=b[i];</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">}</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">}</span></span></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">Output</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">******</span></span></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">Exception in thread &#8220;main&#8221; java.lang.Error:   Unresolved compilation problem:</span></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">Type mismatch:   cannot convert from double to int</span></span></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;">at   ArrayStore.main(ArrayStore.java:6)</span></span></span></p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<p style="text-align: center;">&nbsp;</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8056737521379800";
/* 468x60, created 5/11/11 */
google_ad_slot = "1294582345";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<div id="apf_post_footer">
<h4>Related Articles</h4>
<ul>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=3783">Jr NTR Dammu audio songs track list</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=2265">అసిన్ బికిని లో ఇలా !!!!</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/telugu-movie-news/budda-hoga-tera-baap-amitabh-bachchan2011-2.html">>BUDDA HOGA TERA BAAP &#8211; AMITABH BACHCHAN(2011)</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=1612">Bhanu Sri Mehra ready for lip-lock again! </a></li>
<li class="apf_footer"><a href="http://onetechstudio.com/?p=820">Trisha urged for marriage by her Mom</a></li>
</ul>
</div>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>

<h4>Incoming search terms:</h4><ul><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="example of array index exception in exception handling in java">example of array index exception in exception handling in java</a> (1)</li><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="java exception idea">java exception idea</a> (1)</li><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="robust java exception handling testing and debugging pdf">robust java exception handling testing and debugging pdf</a> (1)</li></ul><div id="wherego_related"><font color='red' size='4'>Readers who viewed this page, also viewed:</font><ul><font size='3' color='green'><li><font size='3' color='green'><a href="http://www.onetechstudio.com/shiridi-saibaba-seva-live-telecast" rel="bookmark"><img src="http://onetechstudio.com/wp-content/uploads/2010/01/livetelecast-150x80.png" alt="Shiridi Sai Baba Live Telecast &#038; Songs" title="Shiridi Sai Baba Live Telecast &#038; Songs" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/shiridi-saibaba-seva-live-telecast" rel="bookmark" class="wherego_title">Shiridi Sai Baba Live Telecast &#038; Songs</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html" rel="bookmark"><img src="http://onetechstudio.com/wp-content/plugins/where-did-they-go-from-here/default.png" alt="PL/SQL Exception Handling" title="PL/SQL Exception Handling" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html" rel="bookmark" class="wherego_title">PL/SQL Exception Handling</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/pawan%e2%80%99s-%e2%80%98komaram-puli%e2%80%99-updates.html" rel="bookmark"><img src="http://onetechstudio.com/wp-content/uploads/2010/01/pawankalyan11263722536.jpg" alt="Pawan’s ‘Komaram Puli’ updates!" title="Pawan’s ‘Komaram Puli’ updates!" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/pawan%e2%80%99s-%e2%80%98komaram-puli%e2%80%99-updates.html" rel="bookmark" class="wherego_title">Pawan’s ‘Komaram Puli’ updates!</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/%e2%80%98simha%e2%80%99-audio-launch-on-march-19th.html" rel="bookmark"><img src="http://way2online.com/wp-content/uploads/2010/03/Simha1.jpg" alt="‘Simha’ audio launch on March 19th" title="‘Simha’ audio launch on March 19th" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/%e2%80%98simha%e2%80%99-audio-launch-on-march-19th.html" rel="bookmark" class="wherego_title">‘Simha’ audio launch on March 19th</a></font></li><li><font size='3' color='green'>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></font></li></font></ul></div><p>Related posts:<ol>
<li><a href='http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html' rel='bookmark' title='PL/SQL Exception Handling'>PL/SQL Exception Handling</a> <small>Summary...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PL/SQL Exception Handling</title>
		<link>http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html</link>
		<comments>http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 16:30:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Telugu Movie News]]></category>
		<category><![CDATA[Exceptions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PL/SQL Exception Handling]]></category>

		<guid isPermaLink="false">http://onetechstudio.com/?p=314</guid>
		<description><![CDATA[Summary of Predefined PL/SQL Exceptions An internal exception is raised automatically if your PL/SQL program violates an Oracle rule or exceeds a system-dependent limit. PL/SQL predefines some common Oracle errors as exceptions. For example, PL/SQL raises the predefined exception NO_DATA_FOUND if a SELECT INTO statement returns no rows. You can use the pragma EXCEPTION_INIT to [...]
Related posts:<ol>
<li><a href='http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html' rel='bookmark' title='Java Exception Handling'>Java Exception Handling</a> <small>&nbsp;...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2><span style="font-family: arial, helvetica, sans-serif; color: #330099;">Summary of  Predefined PL/SQL Exceptions</span></h2>
<p><a name="sthref1182"></a>An internal exception is raised  automatically if your PL/SQL program violates an Oracle rule or exceeds a  system-dependent limit. PL/SQL predefines some common Oracle errors as  exceptions. For example, PL/SQL raises the predefined exception  <code>NO_DATA_FOUND</code> if a <code>SELECT</code> <code>INTO</code> statement  returns no rows.</p>
<p>You can use the pragma <code>EXCEPTION_INIT</code> to associate exception  names with other Oracle error codes that you can anticipate. To handle  unexpected Oracle errors, you can use the <code>OTHERS</code> handler. Within  this handler, you can call the functions <code>SQLCODE</code> and  <code>SQLERRM</code> to return the Oracle error code and message text. Once you  know the error code, you can use it with pragma <code>EXCEPTION_INIT</code> and  write a handler specifically for that error.</p>
<p><a name="sthref1183"></a>PL/SQL declares predefined exceptions  globally in package <code>STANDARD</code>. You need not declare them yourself.  You can write handlers for predefined exceptions using the names in the  following list:</p>
<h4><span style="line-height: normal;"><br />
</span></h4>
<table border="1" cellspacing="0" cellpadding="0" width="90%" align="left">
<thead>
<tr>
<td width="50%" valign="bottom">
<p style="padding-left: 270px; "><strong>Exception</strong><strong> </strong></p>
</td>
<td width="49%" valign="bottom">
<p align="center"><strong>Oracle Error</strong><strong> </strong></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">ACCESS_INTO_NULL</td>
<td valign="top">
<p align="center">ORA-06530</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">CASE_NOT_FOUND</td>
<td width="49%" valign="top">
<p align="center">ORA-06592</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">COLLECTION_IS_NULL</td>
<td width="49%" valign="top">
<p align="center">ORA-06531</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">CURSOR_ALREADY_OPEN</td>
<td width="49%" valign="top">
<p align="center">ORA-06511</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">DUP_VAL_ON_INDEX</td>
<td width="49%" valign="top">
<p align="center">ORA-00001</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">INVALID_CURSOR</td>
<td width="49%" valign="top">
<p align="center">ORA-01001</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">INVALID_NUMBER</td>
<td width="49%" valign="top">
<p align="center">ORA-01722</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">LOGIN_DENIED</td>
<td width="49%" valign="top">
<p align="center">ORA-01017</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">NO_DATA_FOUND</td>
<td width="49%" valign="top">
<p align="center">ORA-01403</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">NOT_LOGGED_ON</td>
<td width="49%" valign="top">
<p align="center">ORA-01012</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">PROGRAM_ERROR</td>
<td width="49%" valign="top">
<p align="center">ORA-06501</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">ROWTYPE_MISMATCH</td>
<td width="49%" valign="top">
<p align="center">ORA-06504</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">SELF_IS_NULL</td>
<td width="49%" valign="top">
<p align="center">ORA-30625</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">STORAGE_ERROR</td>
<td width="49%" valign="top">
<p align="center">ORA-06500</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">SUBSCRIPT_BEYOND_COUNT</td>
<td width="49%" valign="top">
<p align="center">ORA-06533</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">SUBSCRIPT_OUTSIDE_LIMIT</td>
<td width="49%" valign="top">
<p align="center">ORA-06532</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">SYS_INVALID_ROWID</td>
<td width="49%" valign="top">
<p align="center">ORA-01410</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">TIMEOUT_ON_RESOURCE</td>
<td width="49%" valign="top">
<p align="center">ORA-00051</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">TOO_MANY_ROWS</td>
<td width="49%" valign="top">
<p align="center">ORA-01422</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">VALUE_ERROR</td>
<td width="49%" valign="top">
<p align="center">ORA-06502</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">ZERO_DIVIDE</td>
<td width="49%" valign="top">
<p align="center">ORA-01476</p>
</td>
</tr>
</tbody>
</table>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4></h4>
<h4>Brief descriptions of the predefined exceptions follow:</h4>
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<td valign="bottom"><strong>Exception</strong></td>
<td valign="bottom"><strong>Raised when &#8230;</strong><strong> </strong></td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">ACCESS_INTO_NULL</td>
<td valign="top">Your program attempts to assign values   to the attributes of an uninitialized (atomically null) object.</td>
</tr>
<tr>
<td valign="top">CASE_NOT_FOUND</td>
<td valign="top">None of the choices in the WHEN   clauses of a CASE statement is selected, and there is no ELSE   clause.</td>
</tr>
<tr>
<td valign="top">COLLECTION_IS_NULL</td>
<td valign="top">Your program attempts to apply   collection methods other than EXISTS to an uninitialized (atomically null)   nested table or varray, or the program attempts to assign values to the   elements of an uninitialized nested table or varray.</td>
</tr>
<tr>
<td valign="top">CURSOR_ALREADY_OPEN</td>
<td valign="top">Your program attempts to open an   already open cursor. A cursor must be closed before it can be reopened. A   cursor FOR loop automatically opens the cursor to which it refers. So, your   program cannot open that cursor inside the loop.</td>
</tr>
<tr>
<td valign="top">DUP_VAL_ON_INDEX</td>
<td valign="top">Your program attempts to store   duplicate values in a database column that is constrained by a unique index.</td>
</tr>
<tr>
<td valign="top">INVALID_CURSOR</td>
<td valign="top">Your program attempts an illegal   cursor operation such as closing an unopened cursor.</td>
</tr>
<tr>
<td valign="top">INVALID_NUMBER</td>
<td valign="top">In a SQL statement, the conversion   of a character string into a number fails because the string does not   represent a valid number. (In procedural statements, VALUE_ERROR is raised.)   This exception is also raised when the LIMIT-clause   expression in a bulk FETCH statement does not evaluate to a positive number.</td>
</tr>
<tr>
<td valign="top">LOGIN_DENIED</td>
<td valign="top">Your program attempts to log on to   Oracle with an invalid username and/or password.</td>
</tr>
<tr>
<td valign="top">NO_DATA_FOUND</td>
<td valign="top">A SELECT INTO statement returns no   rows, or your program references a deleted element in a nested table or an   uninitialized element in an index-by table. SQL aggregate functions such as   AVG and SUM always return a value or a null. So, a SELECT INTO statement that   calls an aggregate function never raises NO_DATA_FOUND. The FETCH statement   is expected to return no rows eventually, so when that happens, no exception   is raised.</td>
</tr>
<tr>
<td valign="top">NOT_LOGGED_ON</td>
<td valign="top">Your program issues a database   call without being connected to Oracle.</td>
</tr>
<tr>
<td valign="top">PROGRAM_ERROR</td>
<td valign="top">PL/SQL has an internal problem.</td>
</tr>
<tr>
<td valign="top">ROWTYPE_MISMATCH</td>
<td valign="top">The host cursor variable and   PL/SQL cursor variable involved in an assignment have incompatible return   types. For example, when an open host cursor variable is passed to a stored   subprogram, the return types of the actual and formal parameters must be   compatible.</td>
</tr>
<tr>
<td valign="top">SELF_IS_NULL</td>
<td valign="top">Your program attempts to call a   MEMBER method on a null instance. That is, the built-in parameter SELF (which   is always the first parameter passed to a MEMBER method) is null.</td>
</tr>
<tr>
<td valign="top">STORAGE_ERROR</td>
<td valign="top">PL/SQL runs out of memory or   memory has been corrupted.</td>
</tr>
<tr>
<td valign="top">SUBSCRIPT_BEYOND_COUNT</td>
<td valign="top">Your program references a nested   table or varray element using an index number larger than the number of   elements in the collection.</td>
</tr>
<tr>
<td valign="top">SUBSCRIPT_OUTSIDE_LIMIT</td>
<td valign="top">Your program references a nested   table or varray element using an index number (-1 for example) that is   outside the legal range.</td>
</tr>
<tr>
<td valign="top">SYS_INVALID_ROWID</td>
<td valign="top">The conversion of a character   string into a universal rowid fails because the character string does not   represent a valid rowid.</td>
</tr>
<tr>
<td valign="top">TIMEOUT_ON_RESOURCE</td>
<td valign="top">A time-out occurs while Oracle is waiting   for a resource.</td>
</tr>
<tr>
<td valign="top">TOO_MANY_ROWS</td>
<td valign="top">A SELECT INTO statement returns   more than one row.</td>
</tr>
<tr>
<td valign="top">VALUE_ERROR</td>
<td valign="top">An arithmetic, conversion,   truncation, or size-constraint error occurs. For example, when your program   selects a column value into a character variable, if the value is longer than   the declared length of the variable, PL/SQL aborts the assignment and raises   VALUE_ERROR. In procedural statements, VALUE_ERROR is raised if the   conversion of a character string into a number fails. (In SQL statements,   INVALID_NUMBER is raised.)</td>
</tr>
<tr>
<td valign="top">ZERO_DIVIDE</td>
<td valign="top">Your program attempts to divide a   number by zero.</td>
</tr>
</tbody>
</table>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8056737521379800";
/* 468x60, created 5/11/11 */
google_ad_slot = "1294582345";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<div id="apf_post_footer">
<h4>Related Articles</h4>
<ul>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=3783">Jr NTR Dammu audio songs track list</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=2265">అసిన్ బికిని లో ఇలా !!!!</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/telugu-movie-news/budda-hoga-tera-baap-amitabh-bachchan2011-2.html">>BUDDA HOGA TERA BAAP &#8211; AMITABH BACHCHAN(2011)</a></li>
<li class="apf_footer"><a href="http://www.onetechstudio.com/?p=1612">Bhanu Sri Mehra ready for lip-lock again! </a></li>
<li class="apf_footer"><a href="http://onetechstudio.com/?p=820">Trisha urged for marriage by her Mom</a></li>
</ul>
</div>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>

<h4>Incoming search terms:</h4><ul><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="example of array index exception in exception handling in java">example of array index exception in exception handling in java</a> (1)</li><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="java exception idea">java exception idea</a> (1)</li><li><a href="http://www.onetechstudio.com/telugu-movie-news/java-exception-handling.html" title="robust java exception handling testing and debugging pdf">robust java exception handling testing and debugging pdf</a> (1)</li></ul><div id="wherego_related"><font color='red' size='4'>Readers who viewed this page, also viewed:</font><ul><font size='3' color='green'><li><font size='3' color='green'><a href="http://www.onetechstudio.com/shiridi-saibaba-seva-live-telecast" rel="bookmark"><img src="http://onetechstudio.com/wp-content/uploads/2010/01/livetelecast-150x80.png" alt="Shiridi Sai Baba Live Telecast &#038; Songs" title="Shiridi Sai Baba Live Telecast &#038; Songs" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/shiridi-saibaba-seva-live-telecast" rel="bookmark" class="wherego_title">Shiridi Sai Baba Live Telecast &#038; Songs</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html" rel="bookmark"><img src="http://onetechstudio.com/wp-content/plugins/where-did-they-go-from-here/default.png" alt="PL/SQL Exception Handling" title="PL/SQL Exception Handling" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html" rel="bookmark" class="wherego_title">PL/SQL Exception Handling</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/pawan%e2%80%99s-%e2%80%98komaram-puli%e2%80%99-updates.html" rel="bookmark"><img src="http://onetechstudio.com/wp-content/uploads/2010/01/pawankalyan11263722536.jpg" alt="Pawan’s ‘Komaram Puli’ updates!" title="Pawan’s ‘Komaram Puli’ updates!" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/pawan%e2%80%99s-%e2%80%98komaram-puli%e2%80%99-updates.html" rel="bookmark" class="wherego_title">Pawan’s ‘Komaram Puli’ updates!</a></font></li><li><font size='3' color='green'><a href="http://www.onetechstudio.com/telugu-movie-news/%e2%80%98simha%e2%80%99-audio-launch-on-march-19th.html" rel="bookmark"><img src="http://way2online.com/wp-content/uploads/2010/03/Simha1.jpg" alt="‘Simha’ audio launch on March 19th" title="‘Simha’ audio launch on March 19th" width="50" height="50" class="wherego_thumb" /></a> <a href="http://www.onetechstudio.com/telugu-movie-news/%e2%80%98simha%e2%80%99-audio-launch-on-march-19th.html" rel="bookmark" class="wherego_title">‘Simha’ audio launch on March 19th</a></font></li><li><font size='3' color='green'>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></font></li></font></ul></div><p>Related posts:<ol>
<li><a href='http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html' rel='bookmark' title='PL/SQL Exception Handling'>PL/SQL Exception Handling</a> <small>Summary...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.onetechstudio.com/telugu-movie-news/plsql-exception-handling.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>


<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic

Served from: onetechstudio.com @ 2012-02-06 01:32:39 -->
