Use COMReference to handle COM pointers in CreateShortcut
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_fakedupdateableresultset.cxx
blob216a252203554ac3fb5320d3429620aad060b1fb
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,
18 * MA 02111-1307 USA
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 ************************************************************************/
37 #include "pq_fakedupdateableresultset.hxx"
38 #include <com/sun/star/sdbc/SQLException.hpp>
39 #include <cppuhelper/typeprovider.hxx>
40 #include <cppuhelper/queryinterface.hxx>
41 #include <utility>
44 using com::sun::star::uno::Sequence;
45 using com::sun::star::uno::Any;
46 using com::sun::star::uno::Type;
48 using com::sun::star::sdbc::SQLException;
49 using com::sun::star::sdbc::XResultSetUpdate;
50 using com::sun::star::sdbc::XRowUpdate;
52 namespace pq_sdbc_driver
55 FakedUpdateableResultSet::FakedUpdateableResultSet(
56 const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
57 const css::uno::Reference< css::uno::XInterface > &owner,
58 ConnectionSettings **pSettings,
59 PGresult *result,
60 const OUString &schema,
61 const OUString &table,
62 OUString aReason )
63 : ResultSet( mutex, owner, pSettings, result, schema, table ),
64 m_aReason(std::move( aReason ))
68 css::uno::Any FakedUpdateableResultSet::queryInterface(
69 const css::uno::Type & reqType )
71 Any ret = ResultSet::queryInterface( reqType );
72 if( ! ret.hasValue() )
73 ret = ::cppu::queryInterface(
74 reqType,
75 static_cast< XResultSetUpdate * > ( this ),
76 static_cast< XRowUpdate * > ( this ) );
77 return ret;
81 css::uno::Sequence< css::uno::Type > FakedUpdateableResultSet::getTypes()
83 static cppu::OTypeCollection s_collection(
84 cppu::UnoType<XResultSetUpdate>::get(),
85 cppu::UnoType<XRowUpdate>::get(),
86 ResultSet::getTypes());
88 return s_collection.getTypes();
92 css::uno::Sequence< sal_Int8> FakedUpdateableResultSet::getImplementationId()
94 return css::uno::Sequence<sal_Int8>();
97 void FakedUpdateableResultSet::insertRow( )
99 throw SQLException( m_aReason, *this, OUString(),1,Any() );
102 void FakedUpdateableResultSet::updateRow( )
104 throw SQLException( m_aReason, *this, OUString(),1,Any() );
107 void FakedUpdateableResultSet::deleteRow( )
109 throw SQLException( m_aReason, *this, OUString(),1,Any() );
112 void FakedUpdateableResultSet::cancelRowUpdates( )
114 throw SQLException( m_aReason, *this, OUString(),1,Any() );
117 void FakedUpdateableResultSet::moveToInsertRow( )
119 throw SQLException( m_aReason, *this, OUString(),1,Any() );
122 void FakedUpdateableResultSet::moveToCurrentRow( )
124 throw SQLException( m_aReason, *this, OUString(),1,Any() );
128 void FakedUpdateableResultSet::updateNull( sal_Int32 /* columnIndex */ )
130 throw SQLException( m_aReason, *this, OUString(),1,Any() );
133 void FakedUpdateableResultSet::updateBoolean( sal_Int32 /* columnIndex */, sal_Bool /* x */ )
135 throw SQLException( m_aReason, *this, OUString(),1,Any() );
138 void FakedUpdateableResultSet::updateByte( sal_Int32 /* columnIndex */, sal_Int8 /* x */ )
140 throw SQLException( m_aReason, *this, OUString(),1,Any() );
143 void FakedUpdateableResultSet::updateShort( sal_Int32 /* columnIndex */, sal_Int16 /* x */ )
145 throw SQLException( m_aReason, *this, OUString(),1,Any() );
148 void FakedUpdateableResultSet::updateInt( sal_Int32 /* columnIndex */, sal_Int32 /* x */ )
150 throw SQLException( m_aReason, *this, OUString(),1,Any() );
153 void FakedUpdateableResultSet::updateLong( sal_Int32 /* columnIndex */, sal_Int64 /* x */ )
155 throw SQLException( m_aReason, *this, OUString(),1,Any() );
158 void FakedUpdateableResultSet::updateFloat( sal_Int32 /* columnIndex */, float /* x */ )
160 throw SQLException( m_aReason, *this, OUString(),1,Any() );
163 void FakedUpdateableResultSet::updateDouble( sal_Int32 /* columnIndex */, double /* x */ )
165 throw SQLException( m_aReason, *this, OUString(),1,Any() );
168 void FakedUpdateableResultSet::updateString( sal_Int32 /* columnIndex */, const OUString& /* x */ )
170 throw SQLException( m_aReason, *this, OUString(),1,Any() );
173 void FakedUpdateableResultSet::updateBytes( sal_Int32 /* columnIndex */, const css::uno::Sequence< sal_Int8 >& /* x */ )
175 throw SQLException( m_aReason, *this, OUString(),1,Any() );
178 void FakedUpdateableResultSet::updateDate( sal_Int32 /* columnIndex */, const css::util::Date& /* x */ )
180 throw SQLException( m_aReason, *this, OUString(),1,Any() );
183 void FakedUpdateableResultSet::updateTime( sal_Int32 /* columnIndex */, const css::util::Time& /* x */ )
185 throw SQLException( m_aReason, *this, OUString(),1,Any() );
188 void FakedUpdateableResultSet::updateTimestamp( sal_Int32 /* columnIndex */, const css::util::DateTime& /* x */ )
190 throw SQLException( m_aReason, *this, OUString(),1,Any() );
193 void FakedUpdateableResultSet::updateBinaryStream( sal_Int32 /* columnIndex */, const css::uno::Reference< css::io::XInputStream >& /* x */, sal_Int32 /* length */ )
195 throw SQLException( m_aReason, *this, OUString(),1,Any() );
198 void FakedUpdateableResultSet::updateCharacterStream( sal_Int32 /* columnIndex */, const css::uno::Reference< css::io::XInputStream >& /* x */, sal_Int32 /* length */ )
200 throw SQLException( m_aReason, *this, OUString(),1,Any() );
203 void FakedUpdateableResultSet::updateObject( sal_Int32 /* columnIndex */, const css::uno::Any& /* x */ )
205 throw SQLException( m_aReason, *this, OUString(),1,Any() );
208 void FakedUpdateableResultSet::updateNumericObject( sal_Int32 /* columnIndex */, const css::uno::Any& /* x */, sal_Int32 /* scale */ )
210 throw SQLException( m_aReason, *this, OUString(),1,Any() );
215 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */