Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » catch SQL exceptions
catch SQL exceptions [message #1272673] Tue, 18 March 2014 13:19 Go to next message
Shlomi Lanton is currently offline Shlomi LantonFriend
Messages: 7
Registered: May 2013
Junior Member
Hi all,

I would like to know if there is any way to apply an error catching mechanism for SQL when working with postgresql.

For now when I get an error message I see this section in the bottom of my report:
The following items have errors:

Table (id = 7482):
+ Cannot get the result set metadata.
    org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
SQL error #1:ERROR: syntax error at or near "SEsLECT"
  Position: 2
 ;
    org.postgresql.util.PSQLException: ERROR: syntax error at or near "SEsLECT"
  Position: 2

where table ( ID = 7482 ), is the table that uses the Data-set with the SQL error

Note: I know what is my SQL error in this case, I created it so I will have an example

what I would like to achieve is replace this message with my own, something like:
"There was an error please contact our support team, Have a great day"

in other part of the report I used the following logic:
try{
   CODE
}catch (e){
    ERROR HANDLING FUNCTION
}


this uses the JavaScript TRY and CATCH mechanism in order to print all my errors to a log file, but I can't use it in this case because I'm not running the Data-set (Birt does)

also I see that in this case only the "beforeOpen" and "afterOpen" event handlers are
called and that all other ("onFetch", "beforeClose" and "afterClose") aren't
and that the error message is a part of the TABLE and not the Data-set, and there
the "last" event handler that I can call is the table Header Row "onCreate".

Please help me
Waiting for a reply
Have a great week
Shlomi
Re: catch SQL exceptions [message #1275446 is a reply to message #1272673] Sun, 23 March 2014 03:41 Go to previous message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Shlomi Lanton <forums-noreply@xxxxxxxx> wrote:
> Hi all,
>
> I would like to know if there is any way to apply an error catching
> mechanism for SQL when working with postgresql.
>

You could use a stored procedure dataset, with your message returned as a
result when you catch the exception in the stored procedure.


--
Colin Sutton
Previous Topic:How BIRT embed fonts into PDF
Next Topic:Hide cascading group on selection of radio group parameter
Goto Forum:
  


Current Time: Fri Apr 19 22:36:05 GMT 2024

Powered by FUDForum. Page generated in 0.02479 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top