24#include <osl/diagnose.h>
25#include <com/sun/star/sdb/SQLContext.hpp>
26#include <com/sun/star/sdbc/SQLWarning.hpp>
27#include <com/sun/star/sdb/SQLErrorEvent.hpp>
70 aError.Message = _rSimpleErrorMessage;
164SQLExceptionInfo::operator
const css::sdbc::SQLException*()
const
166 OSL_ENSURE(isKindOf(TYPE::SQLException),
"SQLExceptionInfo::operator SQLException* : invalid call !");
167 return o3tl::doAccess<css::sdbc::SQLException>(
m_aContent);
171SQLExceptionInfo::operator
const css::sdb::SQLContext*()
const
173 OSL_ENSURE(isKindOf(TYPE::SQLContext),
"SQLExceptionInfo::operator SQLException* : invalid call !");
174 return o3tl::doAccess<css::sdb::SQLContext>(
m_aContent);
180 SQLException aException;
181 aException.Message = _rErrorMessage;
182 aException.ErrorCode = 0;
183 aException.SQLState =
"S1000";
197 aAppend <<= SQLException();
200 aAppend <<= SQLWarning();
203 aAppend <<= SQLContext();
206 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"SQLExceptionInfo::createException: invalid exception type: this will crash!");
210 SQLException& pAppendException =
const_cast<SQLException &
>(*o3tl::forceAccess<SQLException>(aAppend));
211 pAppendException.Message = rErrorMessage;
212 pAppendException.SQLState = rSQLState;
213 pAppendException.ErrorCode = nErrorCode;
221 SQLException* pException = pLastException;
224 pException =
const_cast<SQLException*
>(o3tl::tryAccess<SQLException>(pException->NextException));
227 pLastException = pException;
229 return pLastException;
242 pLastException->NextException = aAppend;
252 if (
m_aContent.getValueTypeClass() == TypeClass_EXCEPTION )
258 :m_pCurrent( nullptr )
270 :m_pCurrent( &_rChainStart )
285 _out_rInfo = *
static_cast< const SQLWarning*
>(
m_pCurrent );
289 _out_rInfo = *
static_cast< const SQLContext*
>(
m_pCurrent );
301 OSL_ENSURE(
hasMoreElements(),
"SQLExceptionIteratorHelper::next : invalid call (please use hasMoreElements)!" );
303 const css::sdbc::SQLException* pReturn =
m_pCurrent;
362 const css::uno::Any& Next)
375 const css::uno::Reference<css::uno::XInterface>& _rxContext)
379 STR_UNSUPPORTED_FUNCTION,
380 "$functionname$", _rFunctionName
392 const css::uno::Reference<css::uno::XInterface>& _rxContext)
396 STR_UNSUPPORTED_FUNCTION,
397 "$functionname$", _rFunctionName
420 STR_UNSUPPORTED_FEATURE,
421 "$featurename$", _rFeatureName
437 STR_UNSUPPORTED_FEATURE,
438 "$featurename$", _rFeatureName
448 STR_INVALID_COLUMNNAME,
449 "$columnname$",_rColumnName) );
454 const Reference< XInterface >& _rxContext,
const sal_Int32 _nErrorCode )
467 const Reference< XInterface >& _rxContext,
const sal_Int32 _nErrorCode )
487 default:
return "HY001";
helper class for accessing resources shared by different libraries in the connectivity module
OUString getResourceString(TranslateId pResId) const
loads a string from the shared resource file
OUString getResourceStringWithSubstitution(TranslateId pResId, const char *_pAsciiPatternToReplace, const OUString &_rStringToSubstitute) const
loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
css::uno::Type const & get()
#define TOOLS_WARN_EXCEPTION(area, stream)
const EnumerationType m_eType
bool isAssignableFrom(const Type &_rAssignable, const Type &_rFrom)
::ucbhelper::Content m_aContent