1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
39 #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
40 #include <com/sun/star/sdbc/XRowUpdate.hpp>
42 #include "pq_resultset.hxx"
44 namespace pq_sdbc_driver
46 /** necessary to avoid crashes in OOo, when an updateable result set is requested,
47 but cannot be delivered.
49 class FakedUpdateableResultSet
:
51 public css::sdbc::XResultSetUpdate
,
52 public css::sdbc::XRowUpdate
57 FakedUpdateableResultSet(
58 const ::rtl::Reference
< comphelper::RefCountedMutex
> & mutex
,
59 const css::uno::Reference
< css::uno::XInterface
> &owner
,
60 ConnectionSettings
**pSettings
,
62 const OUString
&schema
,
63 const OUString
&table
,
67 virtual void SAL_CALL
acquire() noexcept override
{ ResultSet::acquire(); }
68 virtual void SAL_CALL
release() noexcept override
{ ResultSet::release(); }
69 virtual css::uno::Any SAL_CALL
queryInterface(
70 const css::uno::Type
& reqType
) override
;
72 public: // XTypeProvider
73 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
74 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
76 public: // XResultSetUpdate
77 virtual void SAL_CALL
insertRow( ) override
;
78 virtual void SAL_CALL
updateRow( ) override
;
79 virtual void SAL_CALL
deleteRow( ) override
;
80 virtual void SAL_CALL
cancelRowUpdates( ) override
;
81 virtual void SAL_CALL
moveToInsertRow( ) override
;
82 virtual void SAL_CALL
moveToCurrentRow( ) override
;
85 virtual void SAL_CALL
updateNull( sal_Int32 columnIndex
) override
;
86 virtual void SAL_CALL
updateBoolean( sal_Int32 columnIndex
, sal_Bool x
) override
;
87 virtual void SAL_CALL
updateByte( sal_Int32 columnIndex
, sal_Int8 x
) override
;
88 virtual void SAL_CALL
updateShort( sal_Int32 columnIndex
, sal_Int16 x
) override
;
89 virtual void SAL_CALL
updateInt( sal_Int32 columnIndex
, sal_Int32 x
) override
;
90 virtual void SAL_CALL
updateLong( sal_Int32 columnIndex
, sal_Int64 x
) override
;
91 virtual void SAL_CALL
updateFloat( sal_Int32 columnIndex
, float x
) override
;
92 virtual void SAL_CALL
updateDouble( sal_Int32 columnIndex
, double x
) override
;
93 virtual void SAL_CALL
updateString( sal_Int32 columnIndex
, const OUString
& x
) override
;
94 virtual void SAL_CALL
updateBytes( sal_Int32 columnIndex
, const css::uno::Sequence
< sal_Int8
>& x
) override
;
95 virtual void SAL_CALL
updateDate( sal_Int32 columnIndex
, const css::util::Date
& x
) override
;
96 virtual void SAL_CALL
updateTime( sal_Int32 columnIndex
, const css::util::Time
& x
) override
;
97 virtual void SAL_CALL
updateTimestamp( sal_Int32 columnIndex
, const css::util::DateTime
& x
) override
;
98 virtual void SAL_CALL
updateBinaryStream( sal_Int32 columnIndex
, const css::uno::Reference
< css::io::XInputStream
>& x
, sal_Int32 length
) override
;
99 virtual void SAL_CALL
updateCharacterStream( sal_Int32 columnIndex
, const css::uno::Reference
< css::io::XInputStream
>& x
, sal_Int32 length
) override
;
100 virtual void SAL_CALL
updateObject( sal_Int32 columnIndex
, const css::uno::Any
& x
) override
;
101 virtual void SAL_CALL
updateNumericObject( sal_Int32 columnIndex
, const css::uno::Any
& x
, sal_Int32 scale
) override
;
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */