title: How to catch JNI/Java Exception
body: <p>I have a JNI layer in my application. In some cases Java throws an exception. How can I get the Java exception in the JNI layer? I have the code something like as follows.</p>
  
  <pre><code>if((*(pConnDA-&gt;penv))-&gt;ExceptionCheck(pConnDA-&gt;penv))
  {
      (*(pConnDA-&gt;penv))-&gt;ExceptionDescribe(pConnDA-&gt;penv); 
      (*(pConnDA-&gt;penv))-&gt;ExceptionClear(pConnDA-&gt;penv);
  }
  </code></pre>
  
  <p>Will this block of code catch only JNI exceptions? Where will the exception description be logged in console(stderr)?  How do I get this into the buffer, so that I can pass it to my logger module?</p>