1*9b5730f6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9b5730f6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9b5730f6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9b5730f6SAndrew Rist * distributed with this work for additional information 6*9b5730f6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9b5730f6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9b5730f6SAndrew Rist * "License"); you may not use this file except in compliance 9*9b5730f6SAndrew Rist * with the License. You may obtain a copy of the License at 10*9b5730f6SAndrew Rist * 11*9b5730f6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9b5730f6SAndrew Rist * 13*9b5730f6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9b5730f6SAndrew Rist * software distributed under the License is distributed on an 15*9b5730f6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9b5730f6SAndrew Rist * KIND, either express or implied. See the License for the 17*9b5730f6SAndrew Rist * specific language governing permissions and limitations 18*9b5730f6SAndrew Rist * under the License. 19*9b5730f6SAndrew Rist * 20*9b5730f6SAndrew Rist *************************************************************/ 21*9b5730f6SAndrew Rist 22*9b5730f6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_connectivity.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "connectivity/sqlerror.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir /** === begin UNO includes === **/ 30cdf0e10cSrcweir #include <com/sun/star/sdbc/SQLException.hpp> 31cdf0e10cSrcweir /** === end UNO includes === **/ 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <comphelper/officeresourcebundle.hxx> 34cdf0e10cSrcweir #include <cppuhelper/exc_hlp.hxx> 35cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include <string.h> 38cdf0e10cSrcweir 39cdf0e10cSrcweir //........................................................................ 40cdf0e10cSrcweir namespace connectivity 41cdf0e10cSrcweir { 42cdf0e10cSrcweir //........................................................................ 43cdf0e10cSrcweir 44cdf0e10cSrcweir /** === begin UNO using === **/ 45cdf0e10cSrcweir using ::com::sun::star::uno::Reference; 46cdf0e10cSrcweir using ::com::sun::star::uno::UNO_QUERY; 47cdf0e10cSrcweir using ::com::sun::star::uno::UNO_QUERY_THROW; 48cdf0e10cSrcweir using ::com::sun::star::uno::Exception; 49cdf0e10cSrcweir using ::com::sun::star::uno::RuntimeException; 50cdf0e10cSrcweir using ::com::sun::star::uno::Any; 51cdf0e10cSrcweir using ::com::sun::star::uno::makeAny; 52cdf0e10cSrcweir using ::com::sun::star::uno::XInterface; 53cdf0e10cSrcweir using ::com::sun::star::sdbc::SQLException; 54cdf0e10cSrcweir using ::com::sun::star::uno::Type; 55cdf0e10cSrcweir /** === end UNO using === **/ 56cdf0e10cSrcweir 57cdf0e10cSrcweir //using SQLError::ParamValue; // GCC (unxlngi6) does not like this 58cdf0e10cSrcweir namespace 59cdf0e10cSrcweir { 60cdf0e10cSrcweir typedef SQLError::ParamValue ParamValue; 61cdf0e10cSrcweir } 62cdf0e10cSrcweir 63cdf0e10cSrcweir //==================================================================== 64cdf0e10cSrcweir //= SQLError_Impl - declaration 65cdf0e10cSrcweir //==================================================================== 66cdf0e10cSrcweir class SQLError_Impl 67cdf0e10cSrcweir { 68cdf0e10cSrcweir public: 69cdf0e10cSrcweir SQLError_Impl( const ::comphelper::ComponentContext& _rContext ); 70cdf0e10cSrcweir ~SQLError_Impl(); 71cdf0e10cSrcweir 72cdf0e10cSrcweir // versions of the public SQLError methods which are just delegated to this impl-class 73cdf0e10cSrcweir static const ::rtl::OUString& getMessagePrefix(); 74cdf0e10cSrcweir ::rtl::OUString getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 75cdf0e10cSrcweir ::rtl::OUString getSQLState( const ErrorCondition _eCondition ); 76cdf0e10cSrcweir static ErrorCode getErrorCode( const ErrorCondition _eCondition ); 77cdf0e10cSrcweir void raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 78cdf0e10cSrcweir void raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 79cdf0e10cSrcweir void raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 80cdf0e10cSrcweir SQLException getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir private: 83cdf0e10cSrcweir /// returns the basic error message associated with the given error condition, without any parameter replacements 84cdf0e10cSrcweir ::rtl::OUString 85cdf0e10cSrcweir impl_getErrorMessage( const ErrorCondition& _eCondition ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir /// returns the SQLState associated with the given error condition 88cdf0e10cSrcweir ::rtl::OUString 89cdf0e10cSrcweir impl_getSQLState( const ErrorCondition& _eCondition ); 90cdf0e10cSrcweir 91cdf0e10cSrcweir /// returns an SQLException describing the given error condition 92cdf0e10cSrcweir SQLException 93cdf0e10cSrcweir impl_buildSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 94cdf0e10cSrcweir const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ); 95cdf0e10cSrcweir 96cdf0e10cSrcweir /// initializes our resource bundle 97cdf0e10cSrcweir bool impl_initResources(); 98cdf0e10cSrcweir 99cdf0e10cSrcweir private: 100cdf0e10cSrcweir ::osl::Mutex m_aMutex; 101cdf0e10cSrcweir ::comphelper::ComponentContext m_aContext; 102cdf0e10cSrcweir ::std::auto_ptr< ::comphelper::OfficeResourceBundle > m_pResources; 103cdf0e10cSrcweir bool m_bAttemptedInit; 104cdf0e10cSrcweir }; 105cdf0e10cSrcweir 106cdf0e10cSrcweir //==================================================================== 107cdf0e10cSrcweir //= SQLError_Impl - implementation 108cdf0e10cSrcweir //==================================================================== 109cdf0e10cSrcweir //-------------------------------------------------------------------- SQLError_Impl(const::comphelper::ComponentContext & _rContext)110cdf0e10cSrcweir SQLError_Impl::SQLError_Impl( const ::comphelper::ComponentContext& _rContext ) 111cdf0e10cSrcweir :m_aContext( _rContext ) 112cdf0e10cSrcweir ,m_pResources( ) 113cdf0e10cSrcweir ,m_bAttemptedInit( false ) 114cdf0e10cSrcweir { 115cdf0e10cSrcweir } 116cdf0e10cSrcweir 117cdf0e10cSrcweir //-------------------------------------------------------------------- ~SQLError_Impl()118cdf0e10cSrcweir SQLError_Impl::~SQLError_Impl() 119cdf0e10cSrcweir { 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir //-------------------------------------------------------------------- getMessagePrefix()123cdf0e10cSrcweir const ::rtl::OUString& SQLError_Impl::getMessagePrefix() 124cdf0e10cSrcweir { 125cdf0e10cSrcweir static ::rtl::OUString s_sMessagePrefix( RTL_CONSTASCII_USTRINGPARAM( "[OOoBase]" ) ); 126cdf0e10cSrcweir return s_sMessagePrefix; 127cdf0e10cSrcweir } 128cdf0e10cSrcweir 129cdf0e10cSrcweir //-------------------------------------------------------------------- 130cdf0e10cSrcweir namespace 131cdf0e10cSrcweir { 132cdf0e10cSrcweir //................................................................ 133cdf0e10cSrcweir /** substitutes a given placeholder in the given message with the given value 134cdf0e10cSrcweir */ lcl_substitutePlaceholder(::rtl::OUString & _rMessage,const sal_Char * _pPlaceholder,ParamValue _rParamValue)135cdf0e10cSrcweir void lcl_substitutePlaceholder( ::rtl::OUString& _rMessage, const sal_Char* _pPlaceholder, ParamValue _rParamValue ) 136cdf0e10cSrcweir { 137cdf0e10cSrcweir size_t nPlaceholderLen( strlen( _pPlaceholder ) ); 138cdf0e10cSrcweir sal_Int32 nIndex = _rMessage.indexOfAsciiL( _pPlaceholder, nPlaceholderLen ); 139cdf0e10cSrcweir 140cdf0e10cSrcweir bool bHasPlaceholder = ( nIndex != -1 ); 141cdf0e10cSrcweir bool bWantsPlaceholder = _rParamValue.is(); 142cdf0e10cSrcweir OSL_ENSURE( bHasPlaceholder == bWantsPlaceholder, "lcl_substitutePlaceholder: placeholder where none is expected, or no placeholder where one is needed!" ); 143cdf0e10cSrcweir 144cdf0e10cSrcweir if ( bHasPlaceholder && bWantsPlaceholder ) 145cdf0e10cSrcweir _rMessage = _rMessage.replaceAt( nIndex, nPlaceholderLen, *_rParamValue ); 146cdf0e10cSrcweir } 147cdf0e10cSrcweir 148cdf0e10cSrcweir //................................................................ lcl_getResourceID(const ErrorCondition _eCondition,bool _bSQLState)149cdf0e10cSrcweir sal_Int32 lcl_getResourceID( const ErrorCondition _eCondition, bool _bSQLState ) 150cdf0e10cSrcweir { 151cdf0e10cSrcweir return 256 152cdf0e10cSrcweir + 2 * ::sal::static_int_cast< sal_Int32, ErrorCondition >( _eCondition ) 153cdf0e10cSrcweir + ( _bSQLState ? 1 : 0 ); 154cdf0e10cSrcweir } 155cdf0e10cSrcweir } 156cdf0e10cSrcweir 157cdf0e10cSrcweir //-------------------------------------------------------------------- getErrorMessage(const ErrorCondition _eCondition,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)158cdf0e10cSrcweir ::rtl::OUString SQLError_Impl::getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 159cdf0e10cSrcweir { 160cdf0e10cSrcweir ::rtl::OUString sErrorMessage( impl_getErrorMessage( _eCondition ) ); 161cdf0e10cSrcweir 162cdf0e10cSrcweir lcl_substitutePlaceholder( sErrorMessage, "$1$", _rParamValue1 ); 163cdf0e10cSrcweir lcl_substitutePlaceholder( sErrorMessage, "$2$", _rParamValue2 ); 164cdf0e10cSrcweir lcl_substitutePlaceholder( sErrorMessage, "$3$", _rParamValue3 ); 165cdf0e10cSrcweir 166cdf0e10cSrcweir return sErrorMessage; 167cdf0e10cSrcweir } 168cdf0e10cSrcweir 169cdf0e10cSrcweir //-------------------------------------------------------------------- getSQLState(const ErrorCondition _eCondition)170cdf0e10cSrcweir ::rtl::OUString SQLError_Impl::getSQLState( const ErrorCondition _eCondition ) 171cdf0e10cSrcweir { 172cdf0e10cSrcweir return impl_getSQLState( _eCondition ); 173cdf0e10cSrcweir } 174cdf0e10cSrcweir 175cdf0e10cSrcweir //-------------------------------------------------------------------- getErrorCode(const ErrorCondition _eCondition)176cdf0e10cSrcweir ErrorCode SQLError_Impl::getErrorCode( const ErrorCondition _eCondition ) 177cdf0e10cSrcweir { 178cdf0e10cSrcweir return 0 - ::sal::static_int_cast< ErrorCode, ErrorCondition >( _eCondition ); 179cdf0e10cSrcweir } 180cdf0e10cSrcweir 181cdf0e10cSrcweir //-------------------------------------------------------------------- raiseException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)182cdf0e10cSrcweir void SQLError_Impl::raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 183cdf0e10cSrcweir { 184cdf0e10cSrcweir raiseTypedException( 185cdf0e10cSrcweir _eCondition, 186cdf0e10cSrcweir _rxContext, 187cdf0e10cSrcweir ::cppu::UnoType< SQLException >::get(), 188cdf0e10cSrcweir _rParamValue1, 189cdf0e10cSrcweir _rParamValue2, 190cdf0e10cSrcweir _rParamValue3 191cdf0e10cSrcweir ); 192cdf0e10cSrcweir } 193cdf0e10cSrcweir 194cdf0e10cSrcweir //-------------------------------------------------------------------- raiseException(const ErrorCondition _eCondition,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)195cdf0e10cSrcweir void SQLError_Impl::raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 196cdf0e10cSrcweir { 197cdf0e10cSrcweir raiseTypedException( 198cdf0e10cSrcweir _eCondition, 199cdf0e10cSrcweir NULL, 200cdf0e10cSrcweir ::cppu::UnoType< SQLException >::get(), 201cdf0e10cSrcweir _rParamValue1, 202cdf0e10cSrcweir _rParamValue2, 203cdf0e10cSrcweir _rParamValue3 204cdf0e10cSrcweir ); 205cdf0e10cSrcweir } 206cdf0e10cSrcweir 207cdf0e10cSrcweir //-------------------------------------------------------------------- raiseTypedException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const Type & _rExceptionType,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)208cdf0e10cSrcweir void SQLError_Impl::raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 209cdf0e10cSrcweir const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 210cdf0e10cSrcweir { 211cdf0e10cSrcweir if ( !::cppu::UnoType< SQLException >::get().isAssignableFrom( _rExceptionType ) ) 212cdf0e10cSrcweir throw ::std::bad_cast(); 213cdf0e10cSrcweir 214cdf0e10cSrcweir // default-construct an exception of the desired type 215cdf0e10cSrcweir Any aException( NULL, _rExceptionType ); 216cdf0e10cSrcweir 217cdf0e10cSrcweir // fill it 218cdf0e10cSrcweir SQLException* pException = static_cast< SQLException* >( aException.pData ); 219cdf0e10cSrcweir *pException = impl_buildSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 ); 220cdf0e10cSrcweir 221cdf0e10cSrcweir // throw it 222cdf0e10cSrcweir ::cppu::throwException( aException ); 223cdf0e10cSrcweir } 224cdf0e10cSrcweir 225cdf0e10cSrcweir //-------------------------------------------------------------------- getSQLException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)226cdf0e10cSrcweir SQLException SQLError_Impl::getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 227cdf0e10cSrcweir const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 228cdf0e10cSrcweir { 229cdf0e10cSrcweir return impl_buildSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 ); 230cdf0e10cSrcweir } 231cdf0e10cSrcweir 232cdf0e10cSrcweir //-------------------------------------------------------------------- impl_buildSQLException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3)233cdf0e10cSrcweir SQLException SQLError_Impl::impl_buildSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 234cdf0e10cSrcweir const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir return SQLException( 237cdf0e10cSrcweir getErrorMessage( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 ), 238cdf0e10cSrcweir _rxContext, 239cdf0e10cSrcweir getSQLState( _eCondition ), 240cdf0e10cSrcweir getErrorCode( _eCondition ), 241cdf0e10cSrcweir Any() 242cdf0e10cSrcweir ); 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir //-------------------------------------------------------------------- impl_getErrorMessage(const ErrorCondition & _eCondition)246cdf0e10cSrcweir ::rtl::OUString SQLError_Impl::impl_getErrorMessage( const ErrorCondition& _eCondition ) 247cdf0e10cSrcweir { 248cdf0e10cSrcweir ::rtl::OUStringBuffer aMessage; 249cdf0e10cSrcweir 250cdf0e10cSrcweir if ( impl_initResources() ) 251cdf0e10cSrcweir { 252cdf0e10cSrcweir ::rtl::OUString sResMessage( m_pResources->loadString( lcl_getResourceID( _eCondition, false ) ) ); 253cdf0e10cSrcweir OSL_ENSURE( sResMessage.getLength(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" ); 254cdf0e10cSrcweir aMessage.append( getMessagePrefix() ).appendAscii( " " ).append( sResMessage ); 255cdf0e10cSrcweir } 256cdf0e10cSrcweir 257cdf0e10cSrcweir return aMessage.makeStringAndClear(); 258cdf0e10cSrcweir } 259cdf0e10cSrcweir 260cdf0e10cSrcweir //-------------------------------------------------------------------- impl_getSQLState(const ErrorCondition & _eCondition)261cdf0e10cSrcweir ::rtl::OUString SQLError_Impl::impl_getSQLState( const ErrorCondition& _eCondition ) 262cdf0e10cSrcweir { 263cdf0e10cSrcweir ::rtl::OUString sState; 264cdf0e10cSrcweir 265cdf0e10cSrcweir if ( impl_initResources() ) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir sal_Int32 nResourceId( lcl_getResourceID( _eCondition, true ) ); 268cdf0e10cSrcweir if ( m_pResources->hasString( nResourceId ) ) 269cdf0e10cSrcweir sState = m_pResources->loadString( nResourceId ); 270cdf0e10cSrcweir } 271cdf0e10cSrcweir 272cdf0e10cSrcweir if ( !sState.getLength() ) 273cdf0e10cSrcweir sState = ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) ); 274cdf0e10cSrcweir 275cdf0e10cSrcweir return sState; 276cdf0e10cSrcweir } 277cdf0e10cSrcweir 278cdf0e10cSrcweir //-------------------------------------------------------------------- impl_initResources()279cdf0e10cSrcweir bool SQLError_Impl::impl_initResources() 280cdf0e10cSrcweir { 281cdf0e10cSrcweir if ( m_pResources.get() ) 282cdf0e10cSrcweir return true; 283cdf0e10cSrcweir if ( m_bAttemptedInit ) 284cdf0e10cSrcweir return false; 285cdf0e10cSrcweir 286cdf0e10cSrcweir ::osl::MutexGuard aGuard( m_aMutex ); 287cdf0e10cSrcweir m_bAttemptedInit = true; 288cdf0e10cSrcweir 289cdf0e10cSrcweir m_pResources.reset( new ::comphelper::OfficeResourceBundle( m_aContext.getUNOContext(), "sdberr" ) ); 290cdf0e10cSrcweir return m_pResources.get() != NULL; 291cdf0e10cSrcweir } 292cdf0e10cSrcweir 293cdf0e10cSrcweir //==================================================================== 294cdf0e10cSrcweir //= SQLError 295cdf0e10cSrcweir //==================================================================== 296cdf0e10cSrcweir //-------------------------------------------------------------------- SQLError(const::comphelper::ComponentContext & _rContext)297cdf0e10cSrcweir SQLError::SQLError( const ::comphelper::ComponentContext& _rContext ) 298cdf0e10cSrcweir :m_pImpl( new SQLError_Impl( _rContext ) ) 299cdf0e10cSrcweir { 300cdf0e10cSrcweir } 301cdf0e10cSrcweir 302cdf0e10cSrcweir //-------------------------------------------------------------------- ~SQLError()303cdf0e10cSrcweir SQLError::~SQLError() 304cdf0e10cSrcweir { 305cdf0e10cSrcweir } 306cdf0e10cSrcweir 307cdf0e10cSrcweir //-------------------------------------------------------------------- getMessagePrefix()308cdf0e10cSrcweir const ::rtl::OUString& SQLError::getMessagePrefix() 309cdf0e10cSrcweir { 310cdf0e10cSrcweir return SQLError_Impl::getMessagePrefix(); 311cdf0e10cSrcweir } 312cdf0e10cSrcweir 313cdf0e10cSrcweir //-------------------------------------------------------------------- getErrorMessage(const ErrorCondition _eCondition,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3) const314cdf0e10cSrcweir ::rtl::OUString SQLError::getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const 315cdf0e10cSrcweir { 316cdf0e10cSrcweir return m_pImpl->getErrorMessage( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 ); 317cdf0e10cSrcweir } 318cdf0e10cSrcweir 319cdf0e10cSrcweir //-------------------------------------------------------------------- getSQLState(const ErrorCondition _eCondition) const320cdf0e10cSrcweir ::rtl::OUString SQLError::getSQLState( const ErrorCondition _eCondition ) const 321cdf0e10cSrcweir { 322cdf0e10cSrcweir return m_pImpl->getSQLState( _eCondition ); 323cdf0e10cSrcweir } 324cdf0e10cSrcweir 325cdf0e10cSrcweir //-------------------------------------------------------------------- getErrorCode(const ErrorCondition _eCondition)326cdf0e10cSrcweir ErrorCode SQLError::getErrorCode( const ErrorCondition _eCondition ) 327cdf0e10cSrcweir { 328cdf0e10cSrcweir return SQLError_Impl::getErrorCode( _eCondition ); 329cdf0e10cSrcweir } 330cdf0e10cSrcweir 331cdf0e10cSrcweir //-------------------------------------------------------------------- raiseException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3) const332cdf0e10cSrcweir void SQLError::raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const 333cdf0e10cSrcweir { 334cdf0e10cSrcweir m_pImpl->raiseException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 ); 335cdf0e10cSrcweir } 336cdf0e10cSrcweir 337cdf0e10cSrcweir //-------------------------------------------------------------------- raiseException(const ErrorCondition _eCondition,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3) const338cdf0e10cSrcweir void SQLError::raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const 339cdf0e10cSrcweir { 340cdf0e10cSrcweir m_pImpl->raiseException( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 ); 341cdf0e10cSrcweir } 342cdf0e10cSrcweir 343cdf0e10cSrcweir //-------------------------------------------------------------------- raiseTypedException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const Type & _rExceptionType,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3) const344cdf0e10cSrcweir void SQLError::raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 345cdf0e10cSrcweir const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const 346cdf0e10cSrcweir { 347cdf0e10cSrcweir m_pImpl->raiseTypedException( _eCondition, _rxContext, _rExceptionType, _rParamValue1, _rParamValue2, _rParamValue3 ); 348cdf0e10cSrcweir } 349cdf0e10cSrcweir 350cdf0e10cSrcweir //-------------------------------------------------------------------- getSQLException(const ErrorCondition _eCondition,const Reference<XInterface> & _rxContext,const ParamValue & _rParamValue1,const ParamValue & _rParamValue2,const ParamValue & _rParamValue3) const351cdf0e10cSrcweir SQLException SQLError::getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, 352cdf0e10cSrcweir const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const 353cdf0e10cSrcweir { 354cdf0e10cSrcweir return m_pImpl->getSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 ); 355cdf0e10cSrcweir } 356cdf0e10cSrcweir 357cdf0e10cSrcweir //........................................................................ 358cdf0e10cSrcweir } // namespace connectivity 359cdf0e10cSrcweir //........................................................................ 360