Best technique to handle Database exception

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sbokhari
Posts: 3
Joined: Wed 26 May 2010 08:21

Best technique to handle Database exception

Post by sbokhari » Mon 28 Jun 2010 00:16

Hi,

I am looking for best technique to handle database exception in the entire application.
I am using multiple database server such has FireBird and MySQL in one application.

I have looked at EUniError, EIBCError and EMySqlException.

Please tell me
1. How and where (in code) to implement database exception handling technique. So that my entire application uses standard way to handle DB exceptions?

2. Which exception class should I used? EUniError (for both FB and MySQL), EIBCError for FB and EMySqlException for MySQL individually .

Thanks in advance.

S. Bokhari

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 29 Jun 2010 14:00

You can process exceptions after every operation or handling the Application.OnException event.
UniDAC converts EIBCError and EMySqlException to the EUniError exception. You can use the EUniError.InnerError property to get inner exception.

Post Reply