Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC error feedback like in SQL*Plus
yfain_at_hotmail.com (Yakov) wrote in message news:<b04e2170.0409100639.59a2dcb5_at_posting.google.com>...
> When you get SQLException, use SQLException.getNextException() in a
> loop to get all error messages.
>
> Regards,
> Yakov
Hi,
I think both thin and OCI JDBC driver for oracle provides this
information.
In java pu t the code in a try-catch block and catch the
SQLException(part of java.sql package) thrown by the driver.
SQLException.getMessage() will give you the error message as given by
sqlplus.
Ex: Select * from invalidtable
on sqlplus gives you
*
ERROR at line 1:
ORA-00942: table or view does not exist
Using a java program same statement throws you exception
ORA-00942: table or view does not exist
Regards
Zunil
Cordys
Received on Mon Sep 13 2004 - 04:13:05 CDT
![]() |
![]() |