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 "StatementCommonBase.hxx" 23 24 #include <cppuhelper/implbase1.hxx> 25 #include <com/sun/star/sdbc/XBatchExecution.hpp> 26 27 namespace connectivity::firebird 28 { 29 30 typedef ::cppu::ImplHelper1< css::sdbc::XStatement > 31 OStatement_Base; 32 33 class OStatement : public OStatementCommonBase, 34 public OStatement_Base, 35 public css::sdbc::XBatchExecution, 36 public css::lang::XServiceInfo 37 { 38 XSQLDA* m_pSqlda; 39 protected: ~OStatement()40 virtual ~OStatement() override {} 41 42 public: 43 // a constructor, which is required for returning objects: OStatement(Connection * _pConnection)44 explicit OStatement( Connection* _pConnection) 45 : OStatementCommonBase( _pConnection), 46 m_pSqlda(nullptr) 47 {} 48 49 virtual void disposeResultSet() override; 50 51 DECLARE_SERVICE_INFO(); 52 53 virtual void SAL_CALL acquire() noexcept override; 54 virtual void SAL_CALL release() noexcept override; 55 56 // XStatement 57 virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL 58 executeQuery(const OUString& sql) override; 59 virtual sal_Int32 SAL_CALL executeUpdate(const OUString& sqlIn) override; 60 virtual sal_Bool SAL_CALL 61 execute(const OUString& sql) override; 62 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL 63 getConnection() override; 64 65 // XBatchExecution - UNSUPPORTED 66 virtual void SAL_CALL addBatch( const OUString& sql ) override; 67 virtual void SAL_CALL clearBatch( ) override; 68 virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override; 69 70 // XInterface 71 virtual css::uno::Any SAL_CALL 72 queryInterface(const css::uno::Type & rType) override; 73 74 //XTypeProvider 75 virtual css::uno::Sequence< css::uno::Type > SAL_CALL 76 getTypes() override; 77 // OComponentHelper 78 virtual void SAL_CALL disposing() override; 79 80 }; 81 82 } 83 84 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ 85