LibreOffice Module connectivity (master) 1
StatementCommonBase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <string_view>
25
26#include "Connection.hxx"
27#include "SubComponent.hxx"
28
29#include <ibase.h>
30
32#include <rtl/ref.hxx>
33
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>
38
40 {
41
42 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier,
43 css::util::XCancellable,
44 css::sdbc::XCloseable,
45 css::sdbc::XMultipleResults> OStatementCommonBase_Base;
46
49 public OPropertyArrayUsageHelper<OStatementCommonBase>
50
51 {
52 protected:
53 ::osl::Mutex m_aMutex;
54
55 css::uno::Reference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
56 // for this Statement
57
59
60 ISC_STATUS_ARRAY m_statusVector;
61 isc_stmt_handle m_aStatementHandle;
62
63 protected:
64 virtual void disposeResultSet();
67
68 // OPropertyArrayUsageHelper
69 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
70 // OPropertySetHelper
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,
76 sal_Int32 nHandle,
77 const css::uno::Any& rValue ) override;
78 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
79 sal_Int32 nHandle,
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;
85
87 void prepareAndDescribeStatement(std::u16string_view sqlIn, XSQLDA*& pOutSqlda);
88
90 short getSqlInfoItem(char aInfoItem);
92 bool isDDLStatement();
94 sal_Int32 getStatementChangeCount();
95
96 public:
97
98 explicit OStatementCommonBase(Connection* _pConnection);
99 using OStatementCommonBase_Base::operator css::uno::Reference< css::uno::XInterface >;
100
101 // OComponentHelper
102 virtual void SAL_CALL disposing() override {
104 OStatementCommonBase_Base::disposing();
105 }
106 // XInterface
107 virtual void SAL_CALL release() noexcept override;
108 virtual void SAL_CALL acquire() noexcept override;
109 // XInterface
110 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
111 //XTypeProvider
112 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
113
114 // XPropertySet
115 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
116
117 // XWarningsSupplier - UNSUPPORTED
118 virtual css::uno::Any SAL_CALL getWarnings( ) override;
119 virtual void SAL_CALL clearWarnings( ) override;
120 // XMultipleResults - UNSUPPORTED
121 virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
122 virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
123 virtual sal_Bool SAL_CALL getMoreResults( ) override;
124
125 // XCancellable
126 virtual void SAL_CALL cancel( ) override;
127 // XCloseable
128 virtual void SAL_CALL close( ) override;
129
130 };
131
132}
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override final
virtual void SAL_CALL release() noexcept override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
used to implement the creation of the array helper which is shared amongst all instances of the class...
virtual sal_Bool SAL_CALL getMoreResults() override
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() 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 void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual sal_Int32 SAL_CALL getUpdateCount() override
void prepareAndDescribeStatement(std::u16string_view sqlIn, XSQLDA *&pOutSqlda)
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet() override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL clearWarnings() override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Type
::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier, css::util::XCancellable, css::sdbc::XCloseable, css::sdbc::XMultipleResults > OStatementCommonBase_Base
unsigned char sal_Bool