| GNADE User's Guide: GNADE, The GNat Ada Database Environment; Version 1.2.0; Document Revision $Revision: 1.26 $ | ||
|---|---|---|
| Prev | Appendix A. Frequently asked questions | Next | 
Intercept the DATABASE_ERROR exception as shown below.
Example A-2. Intercpetion connection errors
      begin
         EXEC SQL CONNECT $DBUSER 
                  IDENTIFIED BY $DBPASSWD
                  BY DB01 
                  TO $DBSOURCE ;    -- Hallo Test
         ...............
      exception
         when GNU.DB.SQLCLI.DATABASE_ERROR =>
            Put_Line("Connection Error");
            .....................
      when Others =>
         raise;
      In addition GNADE esql provide the ON clause in the CONNECT statement which allows to intercept communication and authorization errors.