1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 .
22 #include <sal/config.h>
24 #include <string_view>
26 #include "Connection.hxx"
27 #include "SubComponent.hxx"
31 #include <cppuhelper/compbase.hxx>
32 #include <rtl/ref.hxx>
34 #include <com/sun/star/sdbc/XCloseable.hpp>
35 #include <com/sun/star/sdbc/XMultipleResults.hpp>
36 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
37 #include <com/sun/star/util/XCancellable.hpp>
39 namespace connectivity::firebird
42 typedef ::cppu::WeakComponentImplHelper
< css::sdbc::XWarningsSupplier
,
43 css::util::XCancellable
,
44 css::sdbc::XCloseable
,
45 css::sdbc::XMultipleResults
> OStatementCommonBase_Base
;
47 class OStatementCommonBase
: public OStatementCommonBase_Base
,
48 public ::cppu::OPropertySetHelper
,
49 public OPropertyArrayUsageHelper
<OStatementCommonBase
>
53 ::osl::Mutex m_aMutex
;
55 css::uno::Reference
< css::sdbc::XResultSet
> m_xResultSet
; // The last ResultSet created
58 ::rtl::Reference
<Connection
> m_pConnection
;
60 ISC_STATUS_ARRAY m_statusVector
;
61 isc_stmt_handle m_aStatementHandle
;
64 virtual void disposeResultSet();
65 /// @throws css::sdbc::SQLException
66 void freeStatementHandle();
68 // OPropertyArrayUsageHelper
69 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const override
;
71 using OPropertySetHelper::getFastPropertyValue
;
72 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
73 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
74 css::uno::Any
& rConvertedValue
,
75 css::uno::Any
& rOldValue
,
77 const css::uno::Any
& rValue
) override
;
78 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
80 const css::uno::Any
& rValue
) override
;
81 virtual void SAL_CALL
getFastPropertyValue(
82 css::uno::Any
& rValue
,
83 sal_Int32 nHandle
) const override
;
84 virtual ~OStatementCommonBase() override
;
86 /// @throws css::sdbc::SQLException
87 void prepareAndDescribeStatement(std::u16string_view sqlIn
,
89 XSQLDA
* pInSqlda
=nullptr);
91 /// @throws css::sdbc::SQLException
92 short getSqlInfoItem(char aInfoItem
);
93 /// @throws css::sdbc::SQLException
94 bool isDDLStatement();
95 /// @throws css::sdbc::SQLException
96 sal_Int32
getStatementChangeCount();
100 explicit OStatementCommonBase(Connection
* _pConnection
);
101 using OStatementCommonBase_Base::operator css::uno::Reference
< css::uno::XInterface
>;
104 virtual void SAL_CALL
disposing() override
{
106 OStatementCommonBase_Base::disposing();
109 virtual void SAL_CALL
release() noexcept override
;
110 virtual void SAL_CALL
acquire() noexcept override
;
112 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
114 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
117 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
119 // XWarningsSupplier - UNSUPPORTED
120 virtual css::uno::Any SAL_CALL
getWarnings( ) override
;
121 virtual void SAL_CALL
clearWarnings( ) override
;
122 // XMultipleResults - UNSUPPORTED
123 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getResultSet( ) override
;
124 virtual sal_Int32 SAL_CALL
getUpdateCount( ) override
;
125 virtual sal_Bool SAL_CALL
getMoreResults( ) override
;
128 virtual void SAL_CALL
cancel( ) override
;
130 virtual void SAL_CALL
close( ) override
;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */