Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC error feedback like in SQL*Plus

Re: JDBC error feedback like in SQL*Plus

From: Sunil <zunilp_at_gmail.com>
Date: 13 Sep 2004 02:13:05 -0700
Message-ID: <8e0c3fab.0409130113.8c1b639@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US