24#include <osl/thread.h>
28#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
29#include <com/sun/star/sdbc/ResultSetType.hpp>
30#include <com/sun/star/sdbc/FetchDirection.hpp>
42#define CHECK_RETURN(x) \
44 ADOS::ThrowException(m_pConnection->getConnection(),*this);
57 ,m_pConnection(_pConnection)
60 ,m_eLockType(adLockReadOnly)
61 ,m_eCursorType(adOpenForwardOnly)
107 OStatement_BASE::disposing();
112 OStatement_BASE::release();
117 Any aRet = OStatement_BASE::queryInterface(rType);
127 return ::comphelper::concatSequences(
aTypes.getTypes(),OStatement_BASE::getTypes());
133 ::osl::MutexGuard aGuard(
m_aMutex );
144 ::osl::MutexGuard aGuard(
m_aMutex );
160 ::osl::MutexGuard aGuard(
m_aMutex );
176 ::osl::MutexGuard aGuard(
m_aMutex );
183 if ( xCloseable.is() )
186 catch(
const DisposedException& ) { }
193 ::osl::MutexGuard aGuard(
m_aMutex );
207 ::osl::MutexGuard aGuard(
m_aMutex );
213 aInfo.
nType =
static_cast<sal_Int16
>(sqlType);
219 prec = std::max(prec,(*aIter).nPrecision);
232 ::osl::MutexGuard aGuard(
m_aMutex );
253 ::osl::MutexGuard aGuard(
m_aMutex );
263 ADORecordset* pSet =
nullptr;
269 catch (SQLWarning&
ex)
283 ::osl::MutexGuard aGuard(
m_aMutex );
319 ::osl::MutexGuard aGuard(
m_aMutex );
329 Any aRet = ::cppu::queryInterface(rType,
static_cast< XBatchExecution*
> (
this));
336 ::osl::MutexGuard aGuard(
m_aMutex );
345 ::osl::MutexGuard aGuard(
m_aMutex );
352 [](
const OUString& rRes,
const OUString& rStr) {
return rRes + rStr +
";"; });
367 ADORecordset* pSet=
nullptr;
369 sal_Int32* pArray = aRet.getArray();
370 for(sal_Int32 j=0;j<nLen;++j)
389 ::osl::MutexGuard aGuard(
m_aMutex );
396 ADORecordset* pSet =
nullptr;
400 catch (SQLWarning&
ex) {
416 ::osl::MutexGuard aGuard(
m_aMutex );
426 ::osl::MutexGuard aGuard(
m_aMutex );
439 ::osl::MutexGuard aGuard(
m_aMutex );
451 ADORecordset* pSet=
nullptr;
468 ::osl::MutexGuard aGuard(
m_aMutex );
478 ::osl::MutexGuard aGuard(
m_aMutex );
506 nValue = ResultSetConcurrency::READ_ONLY;
509 nValue = ResultSetConcurrency::UPDATABLE;
521 case adOpenUnspecified:
522 case adOpenForwardOnly:
523 nValue = ResultSetType::FORWARD_ONLY;
527 nValue = ResultSetType::SCROLL_INSENSITIVE;
530 nValue = ResultSetType::SCROLL_SENSITIVE;
538 return FetchDirection::FORWARD;
558 ::osl::MutexGuard aGuard(
m_aMutex );
567 ::osl::MutexGuard aGuard(
m_aMutex );
575 ::osl::MutexGuard aGuard(
m_aMutex );
580 case ResultSetConcurrency::READ_ONLY:
591 ::osl::MutexGuard aGuard(
m_aMutex );
597 case ResultSetType::FORWARD_ONLY:
600 case ResultSetType::SCROLL_INSENSITIVE:
603 case ResultSetType::SCROLL_SENSITIVE:
611 ::osl::MutexGuard aGuard(
m_aMutex );
618 ::osl::MutexGuard aGuard(
m_aMutex );
627 ::osl::MutexGuard aGuard(
m_aMutex );
634 ::osl::MutexGuard aGuard(
m_aMutex );
643 return new ::cppu::OPropertyArrayHelper
717 Any & rConvertedValue,
722 bool bModified =
false;
734 bModified = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, bValidAdoRS ?
getMaxRows() :
m_nMaxRows );
738 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getResultSetType());
741 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchSize());
747 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getQueryTimeOut());
750 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getMaxFieldSize());
753 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getCursorName());
756 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchDirection());
760 catch(
const Exception& )
763 OSL_FAIL(
"OStatement_Base::convertFastPropertyValue: caught something strange!" );
849 OStatement_BASE::acquire();
864 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.AStatement","com.sun.star.sdbc.Statement")
::cppu::IPropertyArrayHelper * getArrayHelper()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
static void ThrowException(ADOConnection *_pAdoCon, const css::uno::Reference< css::uno::XInterface > &_xInterface)
WpADOConnection & getConnection()
sal_Int32 getInt32() const
void setIDispatch(IDispatch *pDispInterface)
OConnection * m_pConnection
virtual void SAL_CALL cancel() override
std::vector< connectivity::OTypeInfo > m_aTypeInfo
sal_Int32 getResultSetConcurrency() const
void setQueryTimeOut(sal_Int32 _par0)
sal_Int32 getPrecision(sal_Int32 sqlType)
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL acquire() noexcept override
css::uno::WeakReference< css::sdbc::XResultSet > m_xResultSet
void setCursorName(std::u16string_view _par0)
OUString getCursorName() const
void setResultSetType(sal_Int32 _par0)
sal_Int32 getFetchSize() const
void assignRecordSet(ADORecordset *_pRS)
void setMaxFieldSize(sal_Int32 _par0)
CursorTypeEnum m_eCursorType
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
sal_Int32 getMaxRows() const
virtual sal_Bool SAL_CALL execute(const OUString &sql) override
static sal_Int32 getFetchDirection()
virtual sal_Int32 SAL_CALL executeUpdate(const OUString &sql) override
virtual sal_Int32 SAL_CALL getUpdateCount() override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
void setResultSetConcurrency(sal_Int32 _par0)
void setMaxRows(sal_Int32 _par0)
void setWarning(const css::sdbc::SQLWarning &ex)
virtual void SAL_CALL close() override
css::sdbc::SQLWarning m_aLastWarning
sal_Int32 getQueryTimeOut() const
virtual void SAL_CALL clearWarnings() override
virtual css::uno::Any SAL_CALL getWarnings() override
void setFetchDirection(sal_Int32 _par0)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual sal_Bool SAL_CALL getMoreResults() override
virtual void SAL_CALL disposing() override
OLEVariant m_RecordsAffected
sal_Int32 getResultSetType() const
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
static sal_Int32 getMaxFieldSize()
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(const OUString &sql) override
void setFetchSize(sal_Int32 _par0)
virtual void SAL_CALL release() noexcept override
std::vector< OUString > m_aBatchVector
WpADORecordset m_RecordSet
virtual void SAL_CALL addBatch(const OUString &sql) override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL clearBatch() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
sal_Int32 get_CommandTimeout() const
void put_CommandTimeout(sal_Int32 nRet)
bool Execute(OLEVariant &RecordsAffected, OLEVariant &Parameters, long Options, ADORecordset **ppiRset)
bool put_CommandText(std::u16string_view aCon)
bool put_Name(std::u16string_view Name)
bool putref_ActiveConnection(const WpADOConnection &rCon)
bool get_CacheSize(sal_Int32 &_nRet) const
bool put_MaxRecords(ADO_LONGPTR _nRet)
bool put_CacheSize(sal_Int32 _nRet)
bool UpdateBatch(AffectEnum AffectRecords)
bool Open(VARIANT Source, VARIANT ActiveConnection, CursorTypeEnum CursorType, LockTypeEnum LockType, sal_Int32 Options)
void PutRefDataSource(IUnknown *pIUnknown)
bool get_CursorType(CursorTypeEnum &_nRet) const
bool get_LockType(LockTypeEnum &_nRet) const
bool NextRecordset(OLEVariant &RecordsAffected, ADORecordset **ppiRset)
bool get_MaxRecords(ADO_LONGPTR &_nRet) const
bool get_RecordCount(ADO_LONGPTR &_nRet) const
mutable::osl::Mutex m_aMutex
css::uno::Type const & get()
sal_Int32 getINT32(const Any &_rAny)
OUString getString(const Any &_rAny)
::cppu::WeakComponentImplHelper< css::sdbc::XStatement, css::sdbc::XWarningsSupplier, css::util::XCancellable, css::sdbc::XCloseable, css::sdbc::XMultipleResults > OStatement_BASE
::cppu::ImplHelper1< css::sdbc::XStatement > OStatement_Base
void checkDisposed(bool _bThrow)
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_QUERYTIMEOUT
#define PROPERTY_ID_USEBOOKMARKS
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_MAXFIELDSIZE
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_MAXROWS
#define PROPERTY_ID_ESCAPEPROCESSING
#define PROPERTY_ID_FETCHDIRECTION