43#include <com/sun/star/script/CannotConvertException.hpp>
44#include <com/sun/star/sdbc/SQLException.hpp>
50using com::sun::star::beans::XPropertySetInfo;
52using com::sun::star::uno::Any;
53using com::sun::star::uno::Type;
56using com::sun::star::uno::XInterface;
58using com::sun::star::lang::IllegalArgumentException;
60using com::sun::star::sdbc::SQLException;
63using com::sun::star::beans::Property;
74 static ::cppu::OPropertyArrayHelper arrayHelper(
80 "EscapeProcessing", 1,
92 "ResultSetConcurrency", 5,
102 const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
111 , m_xMutex( refMutex )
113 , m_rowCount( rowCount )
114 , m_fieldCount( colCount )
128 Any aRet = BaseResultSet_BASE::queryInterface(rType);
129 return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
151 ::comphelper::concatSequences(
152 OPropertySetHelper::getTypes(),
153 BaseResultSet_BASE::getTypes()));
159 return css::uno::Sequence<sal_Int8>();
171 MutexGuard guard(
m_xMutex->GetMutex() );
179 MutexGuard guard(
m_xMutex->GetMutex() );
186 MutexGuard guard(
m_xMutex->GetMutex() );
193 MutexGuard guard(
m_xMutex->GetMutex() );
200 MutexGuard guard(
m_xMutex->GetMutex() );
207 MutexGuard guard(
m_xMutex->GetMutex() );
214 MutexGuard guard(
m_xMutex->GetMutex() );
221 MutexGuard guard(
m_xMutex->GetMutex() );
231 MutexGuard guard(
m_xMutex->GetMutex() );
241 MutexGuard guard(
m_xMutex->GetMutex() );
248 MutexGuard guard(
m_xMutex->GetMutex() );
267 MutexGuard guard(
m_xMutex->GetMutex() );
273 else if (
m_row < -1 )
280 MutexGuard guard(
m_xMutex->GetMutex() );
282 bool bRet = (
m_row != -1 );
310 MutexGuard guard(
m_xMutex->GetMutex() );
328 aRet =
m_tc->convertTo( val ,
type );
330 catch( css::lang::IllegalArgumentException & )
332 catch( css::script::CannotConvertException & )
339 MutexGuard guard(
m_xMutex->GetMutex() );
346 if( str.getLength() > 0 )
364 MutexGuard guard(
m_xMutex->GetMutex() );
375 MutexGuard guard(
m_xMutex->GetMutex() );
386 MutexGuard guard(
m_xMutex->GetMutex());
398 MutexGuard guard(
m_xMutex->GetMutex() );
409 MutexGuard guard(
m_xMutex->GetMutex() );
420 MutexGuard guard(
m_xMutex->GetMutex() );
431 MutexGuard guard(
m_xMutex->GetMutex() );
441 MutexGuard guard(
m_xMutex->GetMutex() );
448 if( ! (
getValue( columnIndex ) >>= ustr) )
456 char * res =
reinterpret_cast<char*
>(PQunescapeBytea(
reinterpret_cast<unsigned char const *
>(val.getStr()), &
length));
524 Any & , Any & , sal_Int32 nHandle,
const Any& rValue )
532 bRet = ( rValue >>= val );
540 bRet = ( rValue >>= val );
550 bRet = ( rValue >>= val );
556 throw IllegalArgumentException(
557 "pq_resultset: Invalid property handle (" + OUString::number(
nHandle ) +
")",
566 sal_Int32 nHandle,
const Any& rValue )
591 "pq_resultset: index out of range ("
592 + OUString::number(
index )
593 +
", allowed range is 1 to " + OUString::number(
m_fieldCount )
595 *
this, OUString(), 1,
Any() );
605 "pq_baseresultset: row index out of range, allowed is 0 to " + OUString::number(
m_rowCount -1 )
606 +
", got " + OUString::number(
m_row ),
607 *
this, OUString(),1,
Any() );
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
css::uno::Reference< css::uno::XInterface > m_owner
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
BaseResultSet(const ::rtl::Reference< comphelper::RefCountedMutex > &mutex, const css::uno::Reference< css::uno::XInterface > &owner, sal_Int32 rowCount, sal_Int32 columnCount, const css::uno::Reference< css::script::XTypeConverter > &tc)
virtual sal_Bool SAL_CALL rowUpdated() override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL rowInserted() override
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
virtual void checkClosed()=0
mutex should be locked before called
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL previous() override
virtual void SAL_CALL beforeFirst() override
virtual sal_Int32 SAL_CALL getRow() override
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
css::uno::Reference< css::script::XTypeConverter > m_tc
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isAfterLast() override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
::rtl::Reference< comphelper::RefCountedMutex > m_xMutex
void checkColumnIndex(sal_Int32 index)
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual void SAL_CALL disposing() override
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL last() 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::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL wasNull() override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
css::uno::Any convertTo(const css::uno::Any &str, const css::uno::Type &type)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isLast() override
virtual sal_Bool SAL_CALL next() override
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
css::uno::Any m_props[BASERESULTSET_SIZE]
virtual void SAL_CALL refreshRow() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &reqType) override
void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual ~BaseResultSet() override
virtual css::uno::Any getValue(sal_Int32 columnIndex)=0
virtual sal_Bool SAL_CALL first() override
virtual void SAL_CALL afterLast() override
virtual sal_Bool SAL_CALL isFirst() override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
const sal_Int32 BASERESULTSET_RESULT_SET_CONCURRENCY
const sal_Int32 BASERESULTSET_FETCH_DIRECTION
const sal_Int32 BASERESULTSET_IS_BOOKMARKABLE
::cppu::IPropertyArrayHelper & getResultSetPropertyArrayHelper()
const sal_Int32 BASERESULTSET_RESULT_SET_TYPE
::cppu::WeakComponentImplHelper< css::sdbc::XCloseable, css::sdbc::XResultSetMetaDataSupplier, css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XColumnLocate > BaseResultSet_BASE
const sal_Int32 BASERESULTSET_CURSOR_NAME
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const sal_Int32 BASERESULTSET_ESCAPE_PROCESSING
const sal_Int32 BASERESULTSET_FETCH_SIZE
std::vector< Any > parseArray(std::u16string_view str)