22#include <com/sun/star/sdbc/DataType.hpp>
23#include <com/sun/star/sdbc/KeyRule.hpp>
24#include <com/sun/star/sdbc/IndexType.hpp>
25#include <com/sun/star/sdbcx/CompareBookmark.hpp>
27#include <com/sun/star/lang/DisposedException.hpp>
28#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
29#include <com/sun/star/sdbc/ResultSetType.hpp>
30#include <com/sun/star/sdbc/FetchDirection.hpp>
34#include <com/sun/star/beans/PropertyAttribute.hpp>
45#define CHECK_RETURN(x) \
47 ADOS::ThrowException(m_pStmt->m_pConnection->getConnection(),*this);
57OUString SAL_CALL OResultSet::getImplementationName( )
59 return "com.sun.star.sdbcx.ado.ResultSet";
64 return {
"com.sun.star.sdbc.ResultSet",
"com.sun.star.sdbcx.ResultSet"};
74 ,m_pRecordSet(_pRecordSet)
79 ,m_bOnFirstAfterOpen(false)
85 ,m_pRecordSet(_pRecordSet)
89 ,m_bOnFirstAfterOpen(false)
98 OSL_FAIL(
"OResultSet::construct: no RecordSet!" );
104 VARIANT_BOOL bIsAtBOF;
130 return aRet.hasValue() ? aRet : OResultSet_BASE::queryInterface(rType);
139 return ::comphelper::concatSequences(
aTypes.getTypes(),OResultSet_BASE::getTypes());
145 ::osl::MutexGuard aGuard(
m_aMutex );
150 sal_Int32 nLen = xMeta->getColumnCount();
154 if(xMeta->isCaseSensitive(
i) ?
columnName == xMeta->getColumnName(
i) :
155 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(
i)))
163#define BLOCK_SIZE 256
167 ::osl::MutexGuard aGuard(
m_aMutex );
186 HRESULT
hr = ::SafeArrayGetElement(
m_aValue.parray,&index2,&chData);
197 return new ::comphelper::SequenceInputStream(
aData);
213 ::osl::MutexGuard aGuard(
m_aMutex );
265 ::osl::MutexGuard aGuard(
m_aMutex );
269 PositionEnum_Param aPos;
271 return (aPos > 0) ?
static_cast<sal_Int32
>(aPos) :
m_nRowPos;
285 ::osl::MutexGuard aGuard(
m_aMutex );
353 ::osl::MutexGuard aGuard(
m_aMutex );
357 VARIANT_BOOL bIsAtEOF;
359 return bIsAtEOF == VARIANT_TRUE;
364 ::osl::MutexGuard aGuard(
m_aMutex );
373 ::osl::MutexGuard aGuard(
m_aMutex );
382 ::osl::MutexGuard aGuard(
m_aMutex );
392 ::osl::MutexGuard aGuard(
m_aMutex );
405 ::osl::MutexGuard aGuard(
m_aMutex );
415 ::osl::MutexGuard aGuard(
m_aMutex );
431 ::osl::MutexGuard aGuard(
m_aMutex );
446 ::osl::MutexGuard aGuard(
m_aMutex );
459 while(++row < 0 && bCheck)
479 ::osl::MutexGuard aGuard(
m_aMutex );
485 sal_Int32 nNewPos = row;
499 ::osl::MutexGuard aGuard(
m_aMutex );
513 ::osl::MutexGuard aGuard(
m_aMutex );
521 ::osl::MutexGuard aGuard(
m_aMutex );
527 bool bRet = (RecordStatusEnum(eRec) & adRecDeleted) == adRecDeleted;
534{ ::osl::MutexGuard aGuard(
m_aMutex );
540 bool bRet = (RecordStatusEnum(eRec) & adRecNew) == adRecNew;
548 ::osl::MutexGuard aGuard(
m_aMutex );
554 return (RecordStatusEnum(eRec) & adRecModified) == adRecModified;
560 ::osl::MutexGuard aGuard(
m_aMutex );
564 OSL_ENSURE(!
m_nRowPos,
"OResultSet::isBeforeFirst: Error in setting m_nRowPos!");
565 VARIANT_BOOL bIsAtBOF = VARIANT_TRUE;
568 OSL_ENSURE(!
m_nRowPos,
"OResultSet::isBeforeFirst: Error in setting m_nRowPos!");
571 return bIsAtBOF == VARIANT_TRUE;
577 ::osl::MutexGuard aGuard(
m_aMutex );
593 VARIANT_BOOL bIsAtEOF;
595 bRet = bIsAtEOF != VARIANT_TRUE;
608 ::osl::MutexGuard aGuard(
m_aMutex );
618 ::osl::MutexGuard aGuard(
m_aMutex );
636 ::osl::MutexGuard aGuard(
m_aMutex );
647 ::osl::MutexGuard aGuard(
m_aMutex );
658 ::osl::MutexGuard aGuard(
m_aMutex );
669 ::osl::MutexGuard aGuard(
m_aMutex );
692 ::osl::MutexGuard aGuard(
m_aMutex );
778 x->readBytes(aSeq,length);
788 x->readBytes(aSeq,length);
794 ::osl::MutexGuard aGuard(
m_aMutex );
804 throw SQLException();
811 throw SQLException();
817 ::osl::MutexGuard aGuard(
m_aMutex );
832 ::osl::MutexGuard aGuard(
m_aMutex );
838 OSL_ENSURE(nPos >= 0 && nPos <
static_cast<sal_Int32
>(
m_aBookmarks.size()),
"Invalid Index for vector");
839 if(nPos < 0 || nPos >=
static_cast<sal_Int32
>(
m_aBookmarks.size()))
847 ::osl::MutexGuard aGuard(
m_aMutex );
854 OSL_ENSURE(nPos >= 0 && nPos <
static_cast<sal_Int32
>(
m_aBookmarks.size()),
"Invalid Index for vector");
855 if(nPos < 0 || nPos >=
static_cast<sal_Int32
>(
m_aBookmarks.size()))
862 ::osl::MutexGuard aGuard(
m_aMutex );
870 return css::sdbcx::CompareBookmark::EQUAL;
872 OSL_ENSURE((nPos1 >= 0 && nPos1 <
static_cast<sal_Int32
>(
m_aBookmarks.size())) || (nPos1 >= 0 && nPos2 <
static_cast<sal_Int32
>(
m_aBookmarks.size())),
"Invalid Index for vector");
876 return static_cast<sal_Int32
>(eNum) - 1;
881 ::osl::MutexGuard aGuard(
m_aMutex );
888 OSL_ENSURE(aProps.
IsValid(),
"There are no properties at the connection");
905 ::osl::MutexGuard aGuard(
m_aMutex );
917 ::osl::MutexGuard aGuard(
m_aMutex );
925 SAFEARRAYBOUND rgsabound[1];
926 rgsabound[0].lLbound = 0;
927 rgsabound[0].cElements = rows.getLength();
928 SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
930 const Any* pBegin = rows.getConstArray();
931 const Any* pEnd = pBegin + rows.getLength();
932 for(sal_Int32 i=0;pBegin != pEnd ;++pBegin,++
i)
949 sal_Int32* pSeq =
aSeq.getArray();
953 OSL_ENSURE(i<
aSeq.getLength(),
"Index greater than length of sequence");
955 if(pSeq[i++] == adRecDeleted)
965 sal_Int32
nValue=ResultSetConcurrency::READ_ONLY;
972 nValue = ResultSetConcurrency::READ_ONLY;
975 nValue = ResultSetConcurrency::UPDATABLE;
990 case adOpenUnspecified:
991 case adOpenForwardOnly:
992 nValue = ResultSetType::FORWARD_ONLY;
996 nValue = ResultSetType::SCROLL_INSENSITIVE;
999 nValue = ResultSetType::SCROLL_SENSITIVE;
1008 return FetchDirection::FORWARD;
1036 return new ::cppu::OPropertyArrayHelper
1069 Any & rConvertedValue,
1080 throw css::lang::IllegalArgumentException();
1083 return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchDirection());
1085 return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchSize());
1100 throw Exception(
"cannot set prop " + OUString::number(nHandle),
nullptr);
1121 rValue <<= (bBool == VARIANT_TRUE);
1144 OResultSet_BASE::acquire();
1149 OResultSet_BASE::release();
1154 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
::cppu::IPropertyArrayHelper * getArrayHelper()
void disposing(std::unique_lock< std::mutex > &rGuard)
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)
static WpADOField getField(ADORecordset *_pRecordSet, sal_Int32 _nColumnIndex)
WpADOConnection & getConnection()
css::uno::Any makeAny() const
css::util::Date getDate() const
OUString getString() const
css::util::DateTime getDateTime() const
css::util::Time getTime() const
css::uno::Sequence< sal_Int8 > getByteSequence() const
void setArray(SAFEARRAY *pSafeArray, VARTYPE vtType)
sal_Int32 getInt32() const
sal_Int16 getInt16() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
sal_Int32 getResultSetType() const
virtual sal_Bool SAL_CALL rowUpdated() override
void setFetchSize(sal_Int32 _par0)
virtual void SAL_CALL updateBytes(sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
virtual sal_Int32 SAL_CALL compareBookmarks(const css::uno::Any &first, const css::uno::Any &second) override
virtual sal_Bool SAL_CALL first() override
virtual void SAL_CALL updateTime(sal_Int32 columnIndex, const css::util::Time &x) override
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
sal_Int32 getFetchSize() const
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void SAL_CALL updateDouble(sal_Int32 columnIndex, double x) override
static sal_Int32 getFetchDirection()
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL deleteRow() override
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
virtual void SAL_CALL clearWarnings() override
static OUString getCursorName()
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual void SAL_CALL close() override
virtual sal_Bool SAL_CALL isLast() override
css::uno::Reference< css::uno::XInterface > m_xStatement
OStatement_Base * m_pStmt
virtual void SAL_CALL updateString(sal_Int32 columnIndex, const OUString &x) override
virtual sal_Bool SAL_CALL isFirst() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL hasOrderedBookmarks() override
virtual void SAL_CALL updateLong(sal_Int32 columnIndex, sal_Int64 x) override
virtual sal_Bool SAL_CALL next() override
virtual void SAL_CALL beforeFirst() override
virtual void SAL_CALL updateByte(sal_Int32 columnIndex, sal_Int8 x) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual ~OResultSet() override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual void SAL_CALL updateFloat(sal_Int32 columnIndex, float x) override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex, sal_Bool x) override
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual void SAL_CALL updateInt(sal_Int32 columnIndex, sal_Int32 x) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
virtual void SAL_CALL moveToInsertRow() 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 css::uno::Any SAL_CALL getBookmark() override
void setFetchDirection(sal_Int32 _par0)
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual sal_Int32 SAL_CALL findColumn(const OUString &columnName) override
virtual sal_Bool SAL_CALL isAfterLast() override
virtual void SAL_CALL afterLast() override
virtual void SAL_CALL release() noexcept override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex, const css::util::DateTime &x) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual sal_Bool SAL_CALL last() override
virtual void SAL_CALL insertRow() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL updateRow() override
OLEVariant getValue(sal_Int32 columnIndex)
virtual void SAL_CALL updateShort(sal_Int32 columnIndex, sal_Int16 x) override
virtual void SAL_CALL refreshRow() override
virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, sal_Int32 scale) override
virtual void SAL_CALL updateNull(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL moveToBookmark(const css::uno::Any &bookmark) override
std::vector< OLEVariant > m_aBookmarks
virtual sal_Bool SAL_CALL previous() override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
sal_Int32 getResultSetConcurrency() const
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
void updateValue(sal_Int32 columnIndex, const OLEVariant &x)
virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL rowInserted() override
virtual void SAL_CALL cancel() override
virtual void SAL_CALL moveToCurrentRow() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const css::uno::Sequence< css::uno::Any > &rows) override
ADORecordset * m_pRecordSet
virtual sal_Bool SAL_CALL moveRelativeToBookmark(const css::uno::Any &bookmark, sal_Int32 rows) override
OResultSet(ADORecordset *_pRecordSet, OStatement_Base *pStmt)
virtual sal_Int32 SAL_CALL hashBookmark(const css::uno::Any &bookmark) override
virtual sal_Bool SAL_CALL wasNull() override
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const css::uno::Any &x) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual void SAL_CALL cancelRowUpdates() override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual sal_Int32 SAL_CALL getRow() override
virtual void SAL_CALL updateDate(sal_Int32 columnIndex, const css::util::Date &x) override
OConnection * m_pConnection
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
OLEVariant GetChunk(long Length) const
void get_Value(OLEVariant &aValVar) const
sal_Int32 GetActualSize() const
bool PutValue(const OLEVariant &aVariant)
sal_Int32 GetAttributes() const
OLEVariant GetValue() const
WrapT GetItem(sal_Int32 index) const
mutable::osl::Mutex m_aMutex
css::uno::Type const & get()
Sequence< sal_Int8 > aSeq
constexpr OUStringLiteral aData
sal_Int32 getINT32(const Any &_rAny)
::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, css::sdbc::XWarningsSupplier, css::sdbc::XResultSetUpdate, css::sdbc::XRowUpdate, css::sdbc::XCloseable, css::sdbc::XColumnLocate, css::sdbcx::XRowLocate, css::sdbcx::XDeleteRows, css::lang::XServiceInfo > OResultSet_BASE
void checkDisposed(bool _bThrow)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define PROPERTY_ID_ISBOOKMARKABLE
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_FETCHDIRECTION