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