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