Subject Re: SQLException
Author rrokytskyy
Thanks a lot! I will incorporate you changes into main CVS tree.

Best regards,
Roman

P.S. If somebody with CVS write access already started doing this,
please tell me, we do not want to do same job twice :)

--- In Firebird-Java@y..., "Ken Richard" <kenr@a...> wrote:
> Here are the minimum changes for the error handling to introduce the
> FBSQLException class. All it does right now is let the user call
> getErrorCode() to get the native firebird error code (which is all I
> needed it to do for today). I can work on the rest later.
>
> Diff of existing modules:
>
> cvs server: Diffing client-java
> cvs server: Diffing client-java/bin
> cvs server: Diffing client-java/lib
> cvs server: Diffing client-java/src
> cvs server: Diffing client-java/src/build
> cvs server: Diffing client-java/src/etc
> cvs server: Diffing client-java/src/jdbcTest
> cvs server: Diffing client-java/src/jdbcTest/callableStatement
> cvs server: Diffing client-java/src/jdbcTest/connection
> cvs server: Diffing client-java/src/jdbcTest/data
> cvs server: Diffing client-java/src/jdbcTest/dbmetadata
> cvs server: Diffing client-java/src/jdbcTest/example
> cvs server: Diffing client-java/src/jdbcTest/harness
> cvs server: Diffing client-java/src/jdbcTest/preparedStatement
> cvs server: Diffing client-java/src/jdbcTest/resultSet
> cvs server: Diffing client-java/src/jdbcTest/rsmetadata
> cvs server: Diffing client-java/src/jdbcTest/statement
> cvs server: Diffing client-java/src/jdbcTestResources
> cvs server: Diffing client-java/src/jdbcTestResources/firebird-
resources
> cvs server: Diffing client-java/src/lib
> cvs server: Diffing client-java/src/org
> cvs server: Diffing client-java/src/org/firebirdsql
> cvs server: Diffing client-java/src/org/firebirdsql/gds
> Index: client-java/src/org/firebirdsql/gds/GDSException.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-
java/src/org/firebirdsql/gds/GDSException.jav
> a,v
> retrieving revision 1.6
> diff -r1.6 GDSException.java
> 103a104,107
> >
> > public int getIntParam() {
> > return intParam;
> > }
> cvs server: Diffing client-java/src/org/firebirdsql/jca
> cvs server: Diffing client-java/src/org/firebirdsql/jdbc
> Index: client-java/src/org/firebirdsql/jdbc/FBPreparedStatement.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-
java/src/org/firebirdsql/jdbc/FBPreparedState
> ment.java,v
> retrieving revision 1.19
> diff -r1.19 FBPreparedStatement.java
> 92c92
> < throw new SQLException("GDSException: " + ge);
> ---
> > throw new FBSQLException(ge);
> 491c491
> < throw new SQLException("GDS exception: " + ge.toString
());
> ---
> > throw new FBSQLException(ge);
> Index: client-java/src/org/firebirdsql/jdbc/FBStatement.java
> ===================================================================
> RCS file:
> /cvsroot/firebird/client-
java/src/org/firebirdsql/jdbc/FBStatement.jav
> a,v
> retrieving revision 1.17
> diff -r1.17 FBStatement.java
> 131c131
> < throw new SQLException("GDSException: " + ge);
> ---
> > throw new FBSQLException(ge);
> 172c172
> < throw new SQLException("GDSException: " + ge);
> ---
> > throw new FBSQLException(ge);
> 490c490
> < throw new SQLException("GDSException: " + ge);
> ---
> > throw new FBSQLException(ge);
> cvs server: Diffing client-java/src/org/firebirdsql/jgds
> cvs server: Diffing client-java/src/org/firebirdsql/logging
> cvs server: Diffing client-java/src/org/firebirdsql/management
> cvs server: Diffing client-java/src/resources
> cvs server: cannot find client-java/src/resources/log4j.properties
> cvs server: Diffing client-java/src/resources/META-INF
> cvs server: Diffing client-java/src/stylesheets
>
> New Module:
> /*
> * The contents of this file are subject to the Mozilla Public
> * License Version 1.1 (the "License"); you may not use this file
> * except in compliance with the License. You may obtain a copy of
> * the License at http://www.mozilla.org/MPL/
> * Alternatively, the contents of this file may be used under the
> * terms of the GNU Lesser General Public License Version 2 or
later
> (the
> * "LGPL"), in which case the provisions of the GPL are applicable
> * instead of those above. You may obtain a copy of the Licence at
> * http://www.gnu.org/copyleft/lgpl.html
> *
> * This program is distributed in the hope that it will be useful,
> * but WITHOUT ANY WARRANTY; without even the implied warranty of
> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> * relevant License for more details.
> *
> * This file was created by members of the firebird development
team.
> * All individual contributions remain the Copyright (C) of those
> * individuals. Contributors to this file are either listed here
or
> * can be obtained from a CVS history command.
> *
> * All rights reserved.
> */
> package org.firebirdsql.jdbc;
>
> // imports --------------------------------------
> import java.sql.SQLException;
> import org.firebirdsql.gds.GDSException;
>
> /**
> *@author Ken Richard
> *@created May 30, 2002
> *@see <related>
> *@version $ $
> */
>
> public class FBSQLException extends SQLException {
>
> GDSException original = null;
>
> public FBSQLException(GDSException ex) {
> super("GDS Exception: " + ex);
> original = ex;
> }
>
> public int getErrorCode() {
> return original.getIntParam();
> }
>
> public Exception getInternalException() {
> return original;
> }
>
> }