Hi, i'm a brazilian student.
I'm need, in my student project, capture the type of Exception
throwable for JVM.
For example :
if when compiling any source,
the jvm to return that "a signal ; it is required " or outher comum
error,
i'm need to identify this error and save in table of mysql.
I'm use Runtime.exec , i'm use the code the Michel Daconta em your
article:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
for capture the text message throwable for JVM , but i'm liked to
know if exist outher way to identify the error.
Sorry for my language.
Cézar
Tim Hemig - 17 Apr 2007 00:11 GMT
> Hi, i'm a brazilian student.
> I'm need, in my student project, capture the type of Exception
[quoted text clipped - 5 lines]
> error,
> i'm need to identify this error and save in table of mysql.
If you mean the errors from the compiler while compiling the source, that
are no exceptions like the thrown Exception while the runtime of your
compiled programm itself.
for compiler errors I see no other way than parsing the output with the help
of another programm, or cunsulting the dokumentation of javac, perhaps the
compiler has some more machine-readable output.
for Exeptions in runtime you just have to catch the Events, ask with the
help of 'if(var instanceof Class)' for the Type and write a method, that
puts Exceptions into a Database. Bu be carefull with writing into the
database - an Exception, that should be written into the database could
cause more Exceptions and so on, leading to an infinite recursion.
Hope i got the right opinion of your problem so far,
Tim
Greg R. Broderick - 17 Apr 2007 00:16 GMT
> Hi, i'm a brazilian student.
> I'm need, in my student project, capture the type of Exception
[quoted text clipped - 5 lines]
> error,
> i'm need to identify this error and save in table of mysql.
Exception (and its subclasses) is just another Class in Java, so you can do
instance.getClass() to get the specific subclass of exception that has been
thrown, within a try/catch block.
Cheers!

Signature
---------------------------------------------------------------------
Greg R. Broderick gregb+usenet200612@blackholio.dyndns.org
A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
CezarAntonio - 24 Apr 2007 14:40 GMT
Very good.
Thank's for retry.
I'm try here.
Cézar