Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / connectivity / source / drivers / ado / AStatement.cxx
blobc2a09385dee63b84015711c3daa6ecfee5034cd3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <ado/AStatement.hxx>
21 #include <ado/AConnection.hxx>
22 #include <ado/AResultSet.hxx>
23 #include <comphelper/property.hxx>
24 #include <osl/thread.h>
25 #include <cppuhelper/typeprovider.hxx>
26 #include <cppuhelper/queryinterface.hxx>
27 #include <comphelper/sequence.hxx>
28 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
29 #include <com/sun/star/sdbc/ResultSetType.hpp>
30 #include <com/sun/star/sdbc/FetchDirection.hpp>
31 #include <connectivity/dbexception.hxx>
32 #include <comphelper/types.hxx>
33 #include <rtl/ref.hxx>
35 #undef max
37 #include <algorithm>
38 #include <numeric>
40 using namespace ::comphelper;
42 #define CHECK_RETURN(x) \
43 if(!x) \
44 ADOS::ThrowException(m_pConnection->getConnection(),*this);
47 using namespace connectivity::ado;
50 using namespace com::sun::star::uno;
51 using namespace com::sun::star::lang;
52 using namespace com::sun::star::beans;
53 using namespace com::sun::star::sdbc;
55 OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE(m_aMutex)
56 ,OPropertySetHelper(OStatement_BASE::rBHelper)
57 ,m_pConnection(_pConnection)
58 ,m_nMaxRows(0)
59 ,m_nFetchSize(1)
60 ,m_eLockType(adLockReadOnly)
61 ,m_eCursorType(adOpenForwardOnly)
63 osl_atomic_increment( &m_refCount );
65 m_Command.Create();
66 if(m_Command.IsValid())
67 m_Command.putref_ActiveConnection(m_pConnection->getConnection());
68 else
69 ADOS::ThrowException(m_pConnection->getConnection(),*this);
71 m_RecordsAffected.setNoArg();
72 m_Parameters.setNoArg();
74 m_pConnection->acquire();
76 osl_atomic_decrement( &m_refCount );
79 void OStatement_Base::disposeResultSet()
81 // free the cursor if alive
82 Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
83 if (xComp.is())
84 xComp->dispose();
85 m_xResultSet.clear();
89 void OStatement_Base::disposing()
91 ::osl::MutexGuard aGuard(m_aMutex);
94 disposeResultSet();
96 if ( m_Command.IsValid() )
97 m_Command.putref_ActiveConnection({});
98 m_Command.clear();
100 if ( m_RecordSet.IsValid() )
101 m_RecordSet.PutRefDataSource( nullptr );
102 m_RecordSet.clear();
104 if (m_pConnection)
105 m_pConnection->release();
107 OStatement_BASE::disposing();
110 void SAL_CALL OStatement_Base::release() noexcept
112 OStatement_BASE::release();
115 Any SAL_CALL OStatement_Base::queryInterface( const Type & rType )
117 Any aRet = OStatement_BASE::queryInterface(rType);
118 return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
121 css::uno::Sequence< css::uno::Type > SAL_CALL OStatement_Base::getTypes( )
123 ::cppu::OTypeCollection aTypes( cppu::UnoType<css::beans::XMultiPropertySet>::get(),
124 cppu::UnoType<css::beans::XFastPropertySet>::get(),
125 cppu::UnoType<css::beans::XPropertySet>::get());
127 return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
131 void SAL_CALL OStatement_Base::cancel( )
133 ::osl::MutexGuard aGuard( m_aMutex );
134 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
137 CHECK_RETURN(m_Command.Cancel())
141 void SAL_CALL OStatement_Base::close( )
144 ::osl::MutexGuard aGuard( m_aMutex );
145 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
148 dispose();
152 void SAL_CALL OStatement::clearBatch( )
158 void OStatement_Base::reset()
160 ::osl::MutexGuard aGuard( m_aMutex );
161 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
164 clearWarnings ();
166 if (m_xResultSet.get().is())
167 clearMyResultSet();
170 // clearMyResultSet
171 // If a ResultSet was created for this Statement, close it
174 void OStatement_Base::clearMyResultSet ()
176 ::osl::MutexGuard aGuard( m_aMutex );
177 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
181 Reference<XCloseable> xCloseable(
182 m_xResultSet.get(), css::uno::UNO_QUERY);
183 if ( xCloseable.is() )
184 xCloseable->close();
186 catch( const DisposedException& ) { }
188 m_xResultSet.clear();
191 sal_Int32 OStatement_Base::getRowCount ()
193 ::osl::MutexGuard aGuard( m_aMutex );
194 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
197 return m_RecordsAffected.getInt32();
200 // getPrecision
201 // Given a SQL type, return the maximum precision for the column.
202 // Returns -1 if not known
205 sal_Int32 OStatement_Base::getPrecision ( sal_Int32 sqlType)
207 ::osl::MutexGuard aGuard( m_aMutex );
208 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
211 sal_Int32 prec = -1;
212 OTypeInfo aInfo;
213 aInfo.nType = static_cast<sal_Int16>(sqlType);
214 if (!m_aTypeInfo.empty())
216 std::vector<OTypeInfo>::const_iterator aIter = std::find(m_aTypeInfo.begin(),m_aTypeInfo.end(),aInfo);
217 for(;aIter != m_aTypeInfo.end();++aIter)
219 prec = std::max(prec,(*aIter).nPrecision);
223 return prec;
226 // setWarning
227 // Sets the warning
230 void OStatement_Base::setWarning (const SQLWarning &ex)
232 ::osl::MutexGuard aGuard( m_aMutex );
233 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
236 m_aLastWarning = ex;
239 void OStatement_Base::assignRecordSet( ADORecordset* _pRS )
241 WpADORecordset aOldRS( m_RecordSet );
242 m_RecordSet.set( _pRS );
244 if ( aOldRS.IsValid() )
245 aOldRS.PutRefDataSource( nullptr );
247 if ( m_RecordSet.IsValid() )
248 m_RecordSet.PutRefDataSource( static_cast<IDispatch*>(m_Command) );
251 sal_Bool SAL_CALL OStatement_Base::execute( const OUString& sql )
253 ::osl::MutexGuard aGuard( m_aMutex );
254 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
257 // Reset the statement handle and warning
259 reset();
263 ADORecordset* pSet = nullptr;
264 CHECK_RETURN(m_Command.put_CommandText(sql))
265 CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdText,&pSet))
267 assignRecordSet( pSet );
269 catch (SQLWarning& ex)
272 // Save pointer to warning and save with ResultSet
273 // object once it is created.
275 m_aLastWarning = ex;
278 return m_RecordSet.IsValid();
281 Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const OUString& sql )
283 ::osl::MutexGuard aGuard( m_aMutex );
284 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
287 reset();
289 m_xResultSet = WeakReference<XResultSet>(nullptr);
291 WpADORecordset aSet;
292 aSet.Create();
293 CHECK_RETURN(m_Command.put_CommandText(sql))
294 OLEVariant aCmd;
295 aCmd.setIDispatch(m_Command);
296 OLEVariant aCon;
297 aCon.setNoArg();
298 CHECK_RETURN(aSet.put_CacheSize(m_nFetchSize))
299 CHECK_RETURN(aSet.put_MaxRecords(m_nMaxRows))
300 CHECK_RETURN(aSet.Open(aCmd,aCon,m_eCursorType,m_eLockType,adOpenUnspecified))
303 CHECK_RETURN(aSet.get_CacheSize(m_nFetchSize))
304 CHECK_RETURN(aSet.get_MaxRecords(m_nMaxRows))
305 CHECK_RETURN(aSet.get_CursorType(m_eCursorType))
306 CHECK_RETURN(aSet.get_LockType(m_eLockType))
308 rtl::Reference<OResultSet> pSet = new OResultSet(aSet,this);
309 pSet->construct();
311 m_xResultSet = WeakReference<XResultSet>(pSet);
313 return pSet;
317 Reference< XConnection > SAL_CALL OStatement_Base::getConnection( )
319 ::osl::MutexGuard aGuard( m_aMutex );
320 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
323 return static_cast<Reference< XConnection >>(m_pConnection);
327 Any SAL_CALL OStatement::queryInterface( const Type & rType )
329 Any aRet = ::cppu::queryInterface(rType,static_cast< XBatchExecution*> (this));
330 return aRet.hasValue() ? aRet : OStatement_Base::queryInterface(rType);
334 void SAL_CALL OStatement::addBatch( const OUString& sql )
336 ::osl::MutexGuard aGuard( m_aMutex );
337 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
340 m_aBatchVector.push_back(sql);
343 Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( )
345 ::osl::MutexGuard aGuard( m_aMutex );
346 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
349 reset();
351 OUString aBatchSql = std::accumulate(m_aBatchVector.begin(), m_aBatchVector.end(), OUString(),
352 [](const OUString& rRes, const OUString& rStr) { return rRes + rStr + ";"; });
353 sal_Int32 nLen = m_aBatchVector.size();
356 if ( m_RecordSet.IsValid() )
357 m_RecordSet.PutRefDataSource( nullptr );
358 m_RecordSet.clear();
359 m_RecordSet.Create();
361 CHECK_RETURN(m_Command.put_CommandText(aBatchSql))
362 if ( m_RecordSet.IsValid() )
363 m_RecordSet.PutRefDataSource(static_cast<IDispatch*>(m_Command));
365 CHECK_RETURN(m_RecordSet.UpdateBatch(adAffectAll))
367 ADORecordset* pSet=nullptr;
368 Sequence< sal_Int32 > aRet(nLen);
369 sal_Int32* pArray = aRet.getArray();
370 for(sal_Int32 j=0;j<nLen;++j)
372 pSet = nullptr;
373 OLEVariant aRecordsAffected;
374 if(m_RecordSet.NextRecordset(aRecordsAffected,&pSet) && pSet)
376 assignRecordSet( pSet );
378 ADO_LONGPTR nValue;
379 if(m_RecordSet.get_RecordCount(nValue))
380 pArray[j] = nValue;
383 return aRet;
387 sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const OUString& sql )
389 ::osl::MutexGuard aGuard( m_aMutex );
390 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
393 reset();
395 try {
396 ADORecordset* pSet = nullptr;
397 CHECK_RETURN(m_Command.put_CommandText(sql))
398 CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,long(adCmdText)|long(adExecuteNoRecords),&pSet))
400 catch (SQLWarning& ex) {
402 // Save pointer to warning and save with ResultSet
403 // object once it is created.
405 m_aLastWarning = ex;
407 if(!m_RecordsAffected.isEmpty() && !m_RecordsAffected.isNull() && m_RecordsAffected.getType() != VT_ERROR)
408 return m_RecordsAffected.getInt32();
410 return 0;
414 Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( )
416 ::osl::MutexGuard aGuard( m_aMutex );
417 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
420 return m_xResultSet;
424 sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( )
426 ::osl::MutexGuard aGuard( m_aMutex );
427 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
430 ADO_LONGPTR nRet;
431 if(m_RecordSet.IsValid() && m_RecordSet.get_RecordCount(nRet))
432 return nRet;
433 return -1;
437 sal_Bool SAL_CALL OStatement_Base::getMoreResults( )
439 ::osl::MutexGuard aGuard( m_aMutex );
440 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
443 // clear previous warnings
445 clearWarnings ();
447 // Call SQLMoreResults
451 ADORecordset* pSet=nullptr;
452 OLEVariant aRecordsAffected;
453 if(m_RecordSet.IsValid() && m_RecordSet.NextRecordset(aRecordsAffected,&pSet) && pSet)
454 assignRecordSet( pSet );
456 catch (SQLWarning &)
459 //TODO: Save pointer to warning and save with ResultSet
460 // object once it is created.
462 return m_RecordSet.IsValid();
466 Any SAL_CALL OStatement_Base::getWarnings( )
468 ::osl::MutexGuard aGuard( m_aMutex );
469 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
472 return Any(m_aLastWarning);
476 void SAL_CALL OStatement_Base::clearWarnings( )
478 ::osl::MutexGuard aGuard( m_aMutex );
479 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
482 m_aLastWarning = SQLWarning();
486 sal_Int32 OStatement_Base::getQueryTimeOut() const
488 return m_Command.get_CommandTimeout();
491 sal_Int32 OStatement_Base::getMaxRows() const
493 ADO_LONGPTR nRet=-1;
494 if(!(m_RecordSet.IsValid() && m_RecordSet.get_MaxRecords(nRet)))
495 ::dbtools::throwFunctionSequenceException(nullptr);
496 return nRet;
499 sal_Int32 OStatement_Base::getResultSetConcurrency() const
501 sal_Int32 nValue;
503 switch(m_eLockType)
505 case adLockReadOnly:
506 nValue = ResultSetConcurrency::READ_ONLY;
507 break;
508 default:
509 nValue = ResultSetConcurrency::UPDATABLE;
510 break;
513 return nValue;
516 sal_Int32 OStatement_Base::getResultSetType() const
518 sal_Int32 nValue=0;
519 switch(m_eCursorType)
521 case adOpenUnspecified:
522 case adOpenForwardOnly:
523 nValue = ResultSetType::FORWARD_ONLY;
524 break;
525 case adOpenStatic:
526 case adOpenKeyset:
527 nValue = ResultSetType::SCROLL_INSENSITIVE;
528 break;
529 case adOpenDynamic:
530 nValue = ResultSetType::SCROLL_SENSITIVE;
531 break;
533 return nValue;
536 sal_Int32 OStatement_Base::getFetchDirection()
538 return FetchDirection::FORWARD;
541 sal_Int32 OStatement_Base::getFetchSize() const
543 return m_nFetchSize;
546 sal_Int32 OStatement_Base::getMaxFieldSize()
548 return 0;
551 OUString OStatement_Base::getCursorName() const
553 return m_Command.GetName();
556 void OStatement_Base::setQueryTimeOut(sal_Int32 seconds)
558 ::osl::MutexGuard aGuard( m_aMutex );
559 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
562 m_Command.put_CommandTimeout(seconds);
565 void OStatement_Base::setMaxRows(sal_Int32 _par0)
567 ::osl::MutexGuard aGuard( m_aMutex );
568 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
570 m_nMaxRows = _par0;
573 void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0)
575 ::osl::MutexGuard aGuard( m_aMutex );
576 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
578 switch(_par0)
580 case ResultSetConcurrency::READ_ONLY:
581 m_eLockType = adLockReadOnly;
582 break;
583 default:
584 m_eLockType = adLockOptimistic;
585 break;
589 void OStatement_Base::setResultSetType(sal_Int32 _par0)
591 ::osl::MutexGuard aGuard( m_aMutex );
592 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
595 switch(_par0)
597 case ResultSetType::FORWARD_ONLY:
598 m_eCursorType = adOpenForwardOnly;
599 break;
600 case ResultSetType::SCROLL_INSENSITIVE:
601 m_eCursorType = adOpenKeyset;
602 break;
603 case ResultSetType::SCROLL_SENSITIVE:
604 m_eCursorType = adOpenDynamic;
605 break;
609 void OStatement_Base::setFetchDirection(sal_Int32 /*_par0*/)
611 ::osl::MutexGuard aGuard( m_aMutex );
612 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
613 ::dbtools::throwFeatureNotImplementedSQLException( "Statement::FetchDirection", *this );
616 void OStatement_Base::setFetchSize(sal_Int32 _par0)
618 ::osl::MutexGuard aGuard( m_aMutex );
619 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
622 m_nFetchSize = _par0;
625 void OStatement_Base::setMaxFieldSize(sal_Int32 /*_par0*/)
627 ::osl::MutexGuard aGuard( m_aMutex );
628 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
629 ::dbtools::throwFeatureNotImplementedSQLException( "Statement::MaxFieldSize", *this );
632 void OStatement_Base::setCursorName(std::u16string_view _par0)
634 ::osl::MutexGuard aGuard( m_aMutex );
635 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
637 m_Command.put_Name(_par0);
641 ::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
643 return new ::cppu::OPropertyArrayHelper
647 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME),
648 PROPERTY_ID_CURSORNAME,
649 cppu::UnoType<OUString>::get(),
653 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ESCAPEPROCESSING),
654 PROPERTY_ID_ESCAPEPROCESSING,
655 cppu::UnoType<bool>::get(),
659 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION),
660 PROPERTY_ID_FETCHDIRECTION,
661 cppu::UnoType<sal_Int32>::get(),
665 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE),
666 PROPERTY_ID_FETCHSIZE,
667 cppu::UnoType<sal_Int32>::get(),
671 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXFIELDSIZE),
672 PROPERTY_ID_MAXFIELDSIZE,
673 cppu::UnoType<sal_Int32>::get(),
677 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXROWS),
678 PROPERTY_ID_MAXROWS,
679 cppu::UnoType<sal_Int32>::get(),
683 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_QUERYTIMEOUT),
684 PROPERTY_ID_QUERYTIMEOUT,
685 cppu::UnoType<sal_Int32>::get(),
689 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY),
690 PROPERTY_ID_RESULTSETCONCURRENCY,
691 cppu::UnoType<sal_Int32>::get(),
695 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE),
696 PROPERTY_ID_RESULTSETTYPE,
697 cppu::UnoType<sal_Int32>::get(),
701 ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_USEBOOKMARKS),
702 PROPERTY_ID_USEBOOKMARKS,
703 cppu::UnoType<bool>::get(),
711 ::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
713 return *getArrayHelper();
716 sal_Bool OStatement_Base::convertFastPropertyValue(
717 Any & rConvertedValue,
718 Any & rOldValue,
719 sal_Int32 nHandle,
720 const Any& rValue )
722 bool bModified = false;
724 bool bValidAdoRS = m_RecordSet.IsValid();
725 // some of the properties below, when set, are remembered in a member, and applied in the next execute
726 // For these properties, the record set does not need to be valid to allow setting them.
727 // For all others (where the values are forwarded to the ADO RS directly), the recordset must be valid.
731 switch(nHandle)
733 case PROPERTY_ID_MAXROWS:
734 bModified = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, bValidAdoRS ? getMaxRows() : m_nMaxRows );
735 break;
737 case PROPERTY_ID_RESULTSETTYPE:
738 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetType());
739 break;
740 case PROPERTY_ID_FETCHSIZE:
741 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
742 break;
743 case PROPERTY_ID_RESULTSETCONCURRENCY:
744 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetConcurrency());
745 break;
746 case PROPERTY_ID_QUERYTIMEOUT:
747 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getQueryTimeOut());
748 break;
749 case PROPERTY_ID_MAXFIELDSIZE:
750 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxFieldSize());
751 break;
752 case PROPERTY_ID_CURSORNAME:
753 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getCursorName());
754 break;
755 case PROPERTY_ID_FETCHDIRECTION:
756 bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
757 break;
760 catch( const Exception& )
762 bModified = true; // will ensure that the property is set
763 OSL_FAIL( "OStatement_Base::convertFastPropertyValue: caught something strange!" );
765 return bModified;
768 void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
770 switch(nHandle)
772 case PROPERTY_ID_QUERYTIMEOUT:
773 setQueryTimeOut(comphelper::getINT32(rValue));
774 break;
775 case PROPERTY_ID_MAXFIELDSIZE:
776 setMaxFieldSize(comphelper::getINT32(rValue));
777 break;
778 case PROPERTY_ID_MAXROWS:
779 setMaxRows(comphelper::getINT32(rValue));
780 break;
781 case PROPERTY_ID_CURSORNAME:
782 setCursorName(comphelper::getString(rValue));
783 break;
784 case PROPERTY_ID_RESULTSETCONCURRENCY:
785 setResultSetConcurrency(comphelper::getINT32(rValue));
786 break;
787 case PROPERTY_ID_RESULTSETTYPE:
788 setResultSetType(comphelper::getINT32(rValue));
789 break;
790 case PROPERTY_ID_FETCHDIRECTION:
791 setFetchDirection(comphelper::getINT32(rValue));
792 break;
793 case PROPERTY_ID_FETCHSIZE:
794 setFetchSize(comphelper::getINT32(rValue));
795 break;
796 case PROPERTY_ID_ESCAPEPROCESSING:
797 // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
798 case PROPERTY_ID_USEBOOKMARKS:
799 // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
800 default:
805 void OStatement_Base::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
807 switch(nHandle)
809 case PROPERTY_ID_QUERYTIMEOUT:
810 rValue <<= getQueryTimeOut();
811 break;
812 case PROPERTY_ID_MAXFIELDSIZE:
813 rValue <<= getMaxFieldSize();
814 break;
815 case PROPERTY_ID_MAXROWS:
816 rValue <<= getMaxRows();
817 break;
818 case PROPERTY_ID_CURSORNAME:
819 rValue <<= getCursorName();
820 break;
821 case PROPERTY_ID_RESULTSETCONCURRENCY:
822 rValue <<= getResultSetConcurrency();
823 break;
824 case PROPERTY_ID_RESULTSETTYPE:
825 rValue <<= getResultSetType();
826 break;
827 case PROPERTY_ID_FETCHDIRECTION:
828 rValue <<= getFetchDirection();
829 break;
830 case PROPERTY_ID_FETCHSIZE:
831 rValue <<= getFetchSize();
832 break;
833 case PROPERTY_ID_ESCAPEPROCESSING:
834 rValue <<= true;
835 break;
836 case PROPERTY_ID_USEBOOKMARKS:
837 default:
842 OStatement::~OStatement()
845 IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.AStatement","com.sun.star.sdbc.Statement");
847 void SAL_CALL OStatement_Base::acquire() noexcept
849 OStatement_BASE::acquire();
852 void SAL_CALL OStatement::acquire() noexcept
854 OStatement_Base::acquire();
857 void SAL_CALL OStatement::release() noexcept
859 OStatement_Base::release();
862 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( )
864 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
867 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */