protected void setError(Env env, SQLException e)
        {
            log.log(Level.FINE, e.getMessage(), e);

            _e            = e;
            _errorMessage = e.getMessage();
            _errorCode    = e.getErrorCode();
        }
        protected void saveErrors(SQLException e)
        {
            _exception = e;

            _errorMessage = e.getMessage();
            if (_errorMessage == null || "".equals(_errorMessage))
            {
                _errorMessage = e.ToString();
            }

            _errorCode = e.getErrorCode();
        }
예제 #3
0
        /**
         * Save an error for subsequent calls to
         * {@link #errorCode} and {@link #errorInfo},
         * and depending on the value of {@link #setErrmode}
         * show nothing, show a warning, or throw an exception.
         */
        public void error(Env env, Throwable exception)
        {
            log.log(Level.FINE, exception.ToString(), exception);

            string errorCode;
            string errorMessage;
            int    driverError;

            if (exception instanceof SQLException)
            {
                SQLException sqlException = (SQLException)exception;
                errorCode    = sqlException.getSQLState();
                errorMessage = sqlException.getMessage();
                driverError  = sqlException.getErrorCode();
            }