1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <ParameterSubstitution.hxx>
22 #include <FDatabaseMetaDataResultSet.hxx>
23 #include <FDatabaseMetaDataResultSetMetaData.hxx>
24 #include <com/sun/star/sdbc/ColumnSearch.hpp>
25 #include <com/sun/star/beans/PropertyAttribute.hpp>
26 #include <cppuhelper/typeprovider.hxx>
27 #include <comphelper/sequence.hxx>
28 #include <cppuhelper/supportsservice.hxx>
29 #include <connectivity/dbexception.hxx>
30 #include <o3tl/safeint.hxx>
31 #include <o3tl/unreachable.hxx>
32 #include <TConnection.hxx>
34 using namespace connectivity
;
35 using namespace dbtools
;
38 using namespace ::com::sun::star::beans
;
39 using namespace ::com::sun::star::uno
;
40 using namespace ::com::sun::star::sdbc
;
41 using namespace ::com::sun::star::container
;
42 using namespace ::com::sun::star::lang
;
44 ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet()
54 ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet( MetaDataResultSetType _eType
)
66 ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
70 void ODatabaseMetaDataResultSet::construct()
72 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE
), PROPERTY_ID_FETCHSIZE
, 0,&m_nFetchSize
, ::cppu::UnoType
<sal_Int32
>::get());
73 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE
), PROPERTY_ID_RESULTSETTYPE
, PropertyAttribute::READONLY
,&m_nResultSetType
, ::cppu::UnoType
<sal_Int32
>::get());
74 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION
), PROPERTY_ID_FETCHDIRECTION
, 0, &m_nFetchDirection
, ::cppu::UnoType
<sal_Int32
>::get());
75 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY
), PROPERTY_ID_RESULTSETCONCURRENCY
, PropertyAttribute::READONLY
,&m_nResultSetConcurrency
, ::cppu::UnoType
<sal_Int32
>::get());
78 void ODatabaseMetaDataResultSet::setType(MetaDataResultSetType _eType
)
82 case eCatalogs
: setCatalogsMap(); break;
83 case eSchemas
: setSchemasMap(); break;
84 case eColumnPrivileges
: setColumnPrivilegesMap(); break;
85 case eColumns
: setColumnsMap(); break;
86 case eTables
: setTablesMap(); break;
87 case eTableTypes
: setTableTypes(); break;
88 case eProcedureColumns
: setProcedureColumnsMap(); break;
89 case eProcedures
: setProceduresMap(); break;
90 case eExportedKeys
: setExportedKeysMap(); break;
91 case eImportedKeys
: setImportedKeysMap(); break;
92 case ePrimaryKeys
: setPrimaryKeysMap(); break;
93 case eIndexInfo
: setIndexInfoMap(); break;
94 case eTablePrivileges
: setTablePrivilegesMap(); break;
95 case eCrossReference
: setCrossReferenceMap(); break;
96 case eTypeInfo
: setTypeInfoMap(); break;
97 case eBestRowIdentifier
: setBestRowIdentifierMap(); break;
98 case eVersionColumns
: setVersionColumnsMap(); break;
99 case eUDTs
: setUDTsMap(); break;
101 OSL_FAIL("Wrong type!");
105 void ODatabaseMetaDataResultSet::disposing(std::unique_lock
<std::mutex
>& rGuard
)
107 OPropertySetHelper::disposing(rGuard
);
109 m_aStatement
.clear();
111 m_aRowsIter
= m_aRows
.end();
113 m_aRowsIter
= m_aRows
.end();
116 void SAL_CALL
ODatabaseMetaDataResultSet::acquire() noexcept
118 ODatabaseMetaDataResultSet_BASE::acquire();
121 void SAL_CALL
ODatabaseMetaDataResultSet::release() noexcept
123 ODatabaseMetaDataResultSet_BASE::release();
126 Any SAL_CALL
ODatabaseMetaDataResultSet::queryInterface( const Type
& rType
)
128 Any aRet
= OPropertySetHelper::queryInterface(rType
);
129 return aRet
.hasValue() ? aRet
: ODatabaseMetaDataResultSet_BASE::queryInterface(rType
);
132 Sequence
< Type
> SAL_CALL
ODatabaseMetaDataResultSet::getTypes( )
134 ::cppu::OTypeCollection
aTypes( cppu::UnoType
<css::beans::XMultiPropertySet
>::get(),
135 cppu::UnoType
<css::beans::XFastPropertySet
>::get(),
136 cppu::UnoType
<css::beans::XPropertySet
>::get());
138 return ::comphelper::concatSequences(aTypes
.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
141 void ODatabaseMetaDataResultSet::setRows(ORows
&& _rRows
)
143 m_aRows
= std::move(_rRows
);
145 m_bEOF
= m_aRows
.empty();
148 sal_Int32 SAL_CALL
ODatabaseMetaDataResultSet::findColumn( const OUString
& columnName
)
150 std::unique_lock
aGuard( m_aMutex
);
151 throwIfDisposed(aGuard
);
153 Reference
< XResultSetMetaData
> xMeta
= getMetaData(aGuard
);
154 sal_Int32 nLen
= xMeta
->getColumnCount();
158 if(xMeta
->isCaseSensitive(i
) ? columnName
== xMeta
->getColumnName(i
) :
159 columnName
.equalsIgnoreAsciiCase(xMeta
->getColumnName(i
))
164 ::dbtools::throwInvalidColumnException( columnName
, *this );
167 void ODatabaseMetaDataResultSet::checkIndex(std::unique_lock
<std::mutex
>& /*rGuard*/, sal_Int32 columnIndex
)
169 if(columnIndex
< 1 || o3tl::make_unsigned(columnIndex
) >= (*m_aRowsIter
).size())
170 ::dbtools::throwInvalidIndexException(*this);
173 Reference
< css::io::XInputStream
> SAL_CALL
ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32
/*columnIndex*/ )
178 Reference
< css::io::XInputStream
> SAL_CALL
ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32
/*columnIndex*/ )
184 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex
)
186 return getValue(columnIndex
).getBool();
190 sal_Int8 SAL_CALL
ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex
)
192 return getValue(columnIndex
).getInt8();
196 Sequence
< sal_Int8
> SAL_CALL
ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex
)
198 return getValue(columnIndex
).getSequence();
202 css::util::Date SAL_CALL
ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex
)
204 return getValue(columnIndex
).getDate();
208 double SAL_CALL
ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex
)
210 return getValue(columnIndex
).getDouble();
214 float SAL_CALL
ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex
)
216 return getValue(columnIndex
).getFloat();
220 sal_Int32 SAL_CALL
ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex
)
222 return getValue(columnIndex
).getInt32();
226 sal_Int32 SAL_CALL
ODatabaseMetaDataResultSet::getRow( )
232 sal_Int64 SAL_CALL
ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex
)
234 return getValue(columnIndex
).getLong();
238 Reference
< XResultSetMetaData
> SAL_CALL
ODatabaseMetaDataResultSet::getMetaData( )
240 std::unique_lock
aGuard( m_aMutex
);
241 return getMetaData(aGuard
);
244 Reference
< XResultSetMetaData
> ODatabaseMetaDataResultSet::getMetaData( std::unique_lock
<std::mutex
>& rGuard
)
246 throwIfDisposed(rGuard
);
248 if(!m_xMetaData
.is())
249 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
254 Reference
< XArray
> SAL_CALL
ODatabaseMetaDataResultSet::getArray( sal_Int32
/*columnIndex*/ )
260 Reference
< XClob
> SAL_CALL
ODatabaseMetaDataResultSet::getClob( sal_Int32
/*columnIndex*/ )
265 Reference
< XBlob
> SAL_CALL
ODatabaseMetaDataResultSet::getBlob( sal_Int32
/*columnIndex*/ )
271 Reference
< XRef
> SAL_CALL
ODatabaseMetaDataResultSet::getRef( sal_Int32
/*columnIndex*/ )
277 Any SAL_CALL
ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex
, const Reference
< css::container::XNameAccess
>& /*typeMap*/ )
279 return getValue(columnIndex
).makeAny();
283 sal_Int16 SAL_CALL
ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex
)
285 return getValue(columnIndex
).getInt16();
289 OUString SAL_CALL
ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex
)
291 return getValue(columnIndex
).getString();
295 css::util::Time SAL_CALL
ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex
)
297 return getValue(columnIndex
).getTime();
301 css::util::DateTime SAL_CALL
ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex
)
303 return getValue(columnIndex
).getDateTime();
307 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::isAfterLast()
312 bool ODatabaseMetaDataResultSet::isAfterLast( std::unique_lock
<std::mutex
>& /*rGuard*/)
317 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::isFirst( )
319 ::dbtools::throwFunctionSequenceException(*this);
322 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::isLast( )
324 ::dbtools::throwFunctionSequenceException(*this);
327 void SAL_CALL
ODatabaseMetaDataResultSet::beforeFirst( )
329 ::dbtools::throwFunctionSequenceException(*this);
332 void SAL_CALL
ODatabaseMetaDataResultSet::afterLast( )
334 ::dbtools::throwFunctionSequenceException(*this);
338 void SAL_CALL
ODatabaseMetaDataResultSet::close( )
341 std::unique_lock
aGuard( m_aMutex
);
342 throwIfDisposed(aGuard
);
347 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::first( )
349 ::dbtools::throwFunctionSequenceException(*this);
352 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::last( )
354 ::dbtools::throwFunctionSequenceException(*this);
357 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::absolute( sal_Int32
/*row*/ )
359 ::dbtools::throwFunctionSequenceException(*this);
362 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::relative( sal_Int32
/*row*/ )
364 ::dbtools::throwFunctionSequenceException(*this);
367 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::previous( )
369 ::dbtools::throwFunctionSequenceException(*this);
372 Reference
< XInterface
> SAL_CALL
ODatabaseMetaDataResultSet::getStatement( )
374 return m_aStatement
.get();
377 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::rowDeleted( )
379 ::dbtools::throwFunctionSequenceException(*this);
382 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::rowInserted( )
384 ::dbtools::throwFunctionSequenceException(*this);
387 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::rowUpdated( )
389 ::dbtools::throwFunctionSequenceException(*this);
392 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::isBeforeFirst()
397 bool ODatabaseMetaDataResultSet::isBeforeFirst(std::unique_lock
<std::mutex
>& /*rGuard*/)
402 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::next( )
404 std::unique_lock
aGuard( m_aMutex
);
408 bool ODatabaseMetaDataResultSet::next( std::unique_lock
<std::mutex
>& rGuard
)
410 throwIfDisposed(rGuard
);
414 m_aRowsIter
= m_aRows
.begin();
420 throwFunctionSequenceException( *this );
422 if ( m_aRowsIter
!= m_aRows
.end() )
426 bool bSuccess
= m_aRowsIter
!= m_aRows
.end();
430 m_bBOF
= m_aRows
.empty();
436 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::wasNull( )
438 std::unique_lock
aGuard( m_aMutex
);
439 throwIfDisposed(aGuard
);
441 if(m_aRowsIter
== m_aRows
.end() || !(*m_aRowsIter
)[m_nColPos
].is())
444 return (*m_aRowsIter
)[m_nColPos
]->getValue().isNull();
447 void SAL_CALL
ODatabaseMetaDataResultSet::refreshRow( )
452 void SAL_CALL
ODatabaseMetaDataResultSet::cancel( )
456 void SAL_CALL
ODatabaseMetaDataResultSet::clearWarnings( )
460 Any SAL_CALL
ODatabaseMetaDataResultSet::getWarnings( )
465 ::cppu::IPropertyArrayHelper
* ODatabaseMetaDataResultSet::createArrayHelper( ) const
467 Sequence
< Property
> aProps
;
468 describeProperties(aProps
);
469 return new ::cppu::OPropertyArrayHelper(aProps
);
472 ::cppu::IPropertyArrayHelper
& ODatabaseMetaDataResultSet::getInfoHelper()
474 return *getArrayHelper();
477 void ODatabaseMetaDataResultSet::setProceduresMap()
479 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
480 m_xMetaData
->setProceduresMap();
483 void ODatabaseMetaDataResultSet::setCatalogsMap()
485 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
486 m_xMetaData
->setCatalogsMap();
489 void ODatabaseMetaDataResultSet::setSchemasMap()
491 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
492 m_xMetaData
->setSchemasMap();
495 void ODatabaseMetaDataResultSet::setColumnPrivilegesMap()
497 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
498 m_xMetaData
->setColumnPrivilegesMap();
501 void ODatabaseMetaDataResultSet::setColumnsMap()
503 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
504 m_xMetaData
->setColumnsMap();
507 void ODatabaseMetaDataResultSet::setTablesMap()
509 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
510 m_xMetaData
->setTablesMap();
513 void ODatabaseMetaDataResultSet::setProcedureColumnsMap()
515 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
516 m_xMetaData
->setProcedureColumnsMap();
519 void ODatabaseMetaDataResultSet::setPrimaryKeysMap()
521 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
522 m_xMetaData
->setPrimaryKeysMap();
525 void ODatabaseMetaDataResultSet::setIndexInfoMap()
527 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
528 m_xMetaData
->setIndexInfoMap();
531 void ODatabaseMetaDataResultSet::setTablePrivilegesMap()
533 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
534 m_xMetaData
->setTablePrivilegesMap();
537 void ODatabaseMetaDataResultSet::setCrossReferenceMap()
539 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
540 m_xMetaData
->setCrossReferenceMap();
543 void ODatabaseMetaDataResultSet::setVersionColumnsMap()
545 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
546 m_xMetaData
->setVersionColumnsMap();
549 void ODatabaseMetaDataResultSet::setBestRowIdentifierMap()
551 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
552 m_xMetaData
->setBestRowIdentifierMap();
555 void ODatabaseMetaDataResultSet::setTypeInfoMap()
557 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
558 m_xMetaData
->setTypeInfoMap();
561 void ODatabaseMetaDataResultSet::setUDTsMap()
563 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
564 m_xMetaData
->setUDTsMap();
567 void ODatabaseMetaDataResultSet::setTableTypes()
569 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
570 m_xMetaData
->setTableTypes();
573 void ODatabaseMetaDataResultSet::setExportedKeysMap()
575 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
576 m_xMetaData
->setExportedKeysMap();
579 void ODatabaseMetaDataResultSet::setImportedKeysMap()
581 m_xMetaData
= new ODatabaseMetaDataResultSetMetaData();
582 m_xMetaData
->setImportedKeysMap();
585 Reference
< css::beans::XPropertySetInfo
> SAL_CALL
ODatabaseMetaDataResultSet::getPropertySetInfo( )
587 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
590 ORowSetValueDecorator
& ORowSetValueDecorator::operator=(const ORowSetValue
& _aValue
)
596 const ORowSetValue
& ODatabaseMetaDataResultSet::getValue(sal_Int32 columnIndex
)
598 std::unique_lock
aGuard( m_aMutex
);
599 throwIfDisposed(aGuard
);
601 if ( isBeforeFirst(aGuard
) || isAfterLast(aGuard
) )
602 ::dbtools::throwFunctionSequenceException( *this );
604 checkIndex(aGuard
, columnIndex
);
605 m_nColPos
= columnIndex
;
607 if(m_aRowsIter
!= m_aRows
.end() && (*m_aRowsIter
)[columnIndex
].is())
608 return *(*m_aRowsIter
)[columnIndex
];
609 return m_aEmptyValue
;
612 /// return an empty ORowSetValueDecorator
613 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getEmptyValue()
615 static ORowSetValueDecoratorRef aEmptyValueRef
= new ORowSetValueDecorator();
616 return aEmptyValueRef
;
619 /// return an ORowSetValueDecorator with 0 as value
620 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::get0Value()
622 static ORowSetValueDecoratorRef a0ValueRef
= new ORowSetValueDecorator(sal_Int32(0));
626 /// return an ORowSetValueDecorator with 1 as value
627 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::get1Value()
629 static ORowSetValueDecoratorRef a1ValueRef
= new ORowSetValueDecorator(sal_Int32(1));
633 /// return an ORowSetValueDecorator with ColumnSearch::BASIC as value
634 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getBasicValue()
636 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(ColumnSearch::BASIC
);
640 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getSelectValue()
642 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"SELECT"_ustr
);
646 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getInsertValue()
648 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"INSERT"_ustr
);
652 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getDeleteValue()
654 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"DELETE"_ustr
);
658 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getUpdateValue()
660 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"UPDATE"_ustr
);
664 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getCreateValue()
666 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"CREATE"_ustr
);
670 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getReadValue()
672 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"READ"_ustr
);
676 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getAlterValue()
678 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"ALTER"_ustr
);
682 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getDropValue()
684 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"DROP"_ustr
);
688 ORowSetValueDecoratorRef
const & ODatabaseMetaDataResultSet::getQuoteValue()
690 static ORowSetValueDecoratorRef aValueRef
= new ORowSetValueDecorator(u
"'"_ustr
);
694 void SAL_CALL
ODatabaseMetaDataResultSet::initialize( const Sequence
< Any
>& _aArguments
)
696 if ( _aArguments
.getLength() != 2 )
699 sal_Int32 nResultSetType
= 0;
700 if ( !(_aArguments
[0] >>= nResultSetType
))
703 setType(static_cast<MetaDataResultSetType
>(nResultSetType
));
704 Sequence
< Sequence
<Any
> > aRows
;
705 if ( !(_aArguments
[1] >>= aRows
) )
709 for (auto& row
: aRows
)
712 for (auto& field
: row
)
714 ORowSetValueDecoratorRef aValue
;
715 switch (field
.getValueTypeClass())
717 case TypeClass_BOOLEAN
:
721 aValue
= new ORowSetValueDecorator(ORowSetValue(bValue
));
728 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
731 case TypeClass_SHORT
:
732 case TypeClass_UNSIGNED_SHORT
:
736 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
740 case TypeClass_UNSIGNED_LONG
:
744 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
747 case TypeClass_HYPER
:
748 case TypeClass_UNSIGNED_HYPER
:
752 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
755 case TypeClass_FLOAT
:
759 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
762 case TypeClass_DOUBLE
:
766 aValue
= new ORowSetValueDecorator(ORowSetValue(nValue
));
769 case TypeClass_STRING
:
773 aValue
= new ORowSetValueDecorator(ORowSetValue(sValue
));
779 aRowToSet
.push_back(aValue
);
781 aRowsToSet
.push_back(aRowToSet
);
782 } // for (; pRowsIter != pRowsEnd;++pRowsIter
783 setRows(std::move(aRowsToSet
));
788 OUString SAL_CALL
ODatabaseMetaDataResultSet::getImplementationName( )
790 return u
"org.openoffice.comp.helper.DatabaseMetaDataResultSet"_ustr
;
793 sal_Bool SAL_CALL
ODatabaseMetaDataResultSet::supportsService( const OUString
& _rServiceName
)
795 return cppu::supportsService(this, _rServiceName
);
798 Sequence
< OUString
> SAL_CALL
ODatabaseMetaDataResultSet::getSupportedServiceNames( )
800 return Sequence
<OUString
>{ u
"com.sun.star.sdbc.ResultSet"_ustr
};
803 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
804 connectivity_dbtools_ODatabaseMetaDataResultSet_get_implementation(
805 css::uno::XComponentContext
* , css::uno::Sequence
<css::uno::Any
> const&)
807 return cppu::acquire(new ODatabaseMetaDataResultSet());
810 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */