1 #include "pq_fakedupdateableresultset.hxx"
2 #include <cppuhelper/typeprovider.hxx>
3 #include <cppuhelper/queryinterface.hxx>
9 using com::sun::star::uno::Reference
;
10 using com::sun::star::uno::makeAny
;
11 using com::sun::star::uno::Sequence
;
12 using com::sun::star::uno::UNO_QUERY
;
13 using com::sun::star::uno::Any
;
14 using com::sun::star::uno::Type
;
15 using com::sun::star::uno::RuntimeException
;
17 using com::sun::star::sdbc::SQLException
;
18 using com::sun::star::sdbc::XResultSet
;
19 using com::sun::star::sdbc::XResultSetUpdate
;
20 using com::sun::star::sdbc::XRowUpdate
;
21 using com::sun::star::sdbc::XRow
;
22 using com::sun::star::sdbc::XStatement
;
24 namespace pq_sdbc_driver
27 FakedUpdateableResultSet::FakedUpdateableResultSet(
28 const ::rtl::Reference
< RefCountedMutex
> & mutex
,
29 const com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> &owner
,
30 ConnectionSettings
**pSettings
,
32 const rtl::OUString
&schema
,
33 const rtl::OUString
&table
,
34 const rtl::OUString
&aReason
)
35 : ResultSet( mutex
, owner
, pSettings
, result
, schema
, table
),
40 com::sun::star::uno::Any
FakedUpdateableResultSet::queryInterface(
41 const com::sun::star::uno::Type
& reqType
)
42 throw (com::sun::star::uno::RuntimeException
)
44 Any ret
= ResultSet::queryInterface( reqType
);
45 if( ! ret
.hasValue() )
46 ret
= ::cppu::queryInterface(
48 static_cast< XResultSetUpdate
* > ( this ),
49 static_cast< XRowUpdate
* > ( this ) );
54 com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> FakedUpdateableResultSet::getTypes()
55 throw( com::sun::star::uno::RuntimeException
)
57 static cppu::OTypeCollection
*pCollection
;
60 MutexGuard
guard( osl::Mutex::getGlobalMutex() );
63 static cppu::OTypeCollection
collection(
64 getCppuType( (Reference
< XResultSetUpdate
> *) 0 ),
65 getCppuType( (Reference
< XRowUpdate
> *) 0 ),
66 ResultSet::getTypes());
67 pCollection
= &collection
;
70 return pCollection
->getTypes();
74 com::sun::star::uno::Sequence
< sal_Int8
> FakedUpdateableResultSet::getImplementationId()
75 throw( com::sun::star::uno::RuntimeException
)
77 static cppu::OImplementationId
*pId
;
80 MutexGuard
guard( osl::Mutex::getGlobalMutex() );
83 static cppu::OImplementationId
id(sal_False
);
87 return pId
->getImplementationId();
90 void FakedUpdateableResultSet::insertRow( ) throw (SQLException
, RuntimeException
)
92 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
95 void FakedUpdateableResultSet::updateRow( ) throw (SQLException
, RuntimeException
)
97 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
100 void FakedUpdateableResultSet::deleteRow( ) throw (SQLException
, RuntimeException
)
102 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
105 void FakedUpdateableResultSet::cancelRowUpdates( ) throw (SQLException
, RuntimeException
)
107 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
110 void FakedUpdateableResultSet::moveToInsertRow( ) throw (SQLException
, RuntimeException
)
112 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
115 void FakedUpdateableResultSet::moveToCurrentRow( ) throw (SQLException
, RuntimeException
)
117 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
121 void FakedUpdateableResultSet::updateNull( sal_Int32 columnIndex
) throw (SQLException
, RuntimeException
)
123 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
126 void FakedUpdateableResultSet::updateBoolean( sal_Int32 columnIndex
, sal_Bool x
) throw (SQLException
, RuntimeException
)
128 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
131 void FakedUpdateableResultSet::updateByte( sal_Int32 columnIndex
, sal_Int8 x
) throw (SQLException
, RuntimeException
)
133 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
136 void FakedUpdateableResultSet::updateShort( sal_Int32 columnIndex
, sal_Int16 x
) throw (SQLException
, RuntimeException
)
138 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
141 void FakedUpdateableResultSet::updateInt( sal_Int32 columnIndex
, sal_Int32 x
) throw (SQLException
, RuntimeException
)
143 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
146 void FakedUpdateableResultSet::updateLong( sal_Int32 columnIndex
, sal_Int64 x
) throw (SQLException
, RuntimeException
)
148 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
151 void FakedUpdateableResultSet::updateFloat( sal_Int32 columnIndex
, float x
) throw (SQLException
, RuntimeException
)
153 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
156 void FakedUpdateableResultSet::updateDouble( sal_Int32 columnIndex
, double x
) throw (SQLException
, RuntimeException
)
158 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
161 void FakedUpdateableResultSet::updateString( sal_Int32 columnIndex
, const ::rtl::OUString
& x
) throw (SQLException
, RuntimeException
)
163 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
166 void FakedUpdateableResultSet::updateBytes( sal_Int32 columnIndex
, const ::com::sun::star::uno::Sequence
< sal_Int8
>& x
) throw (SQLException
, RuntimeException
)
168 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
171 void FakedUpdateableResultSet::updateDate( sal_Int32 columnIndex
, const ::com::sun::star::util::Date
& x
) throw (SQLException
, RuntimeException
)
173 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
176 void FakedUpdateableResultSet::updateTime( sal_Int32 columnIndex
, const ::com::sun::star::util::Time
& x
) throw (SQLException
, RuntimeException
)
178 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
181 void FakedUpdateableResultSet::updateTimestamp( sal_Int32 columnIndex
, const ::com::sun::star::util::DateTime
& x
) throw (SQLException
, RuntimeException
)
183 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
186 void FakedUpdateableResultSet::updateBinaryStream( sal_Int32 columnIndex
, const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& x
, sal_Int32 length
) throw (SQLException
, RuntimeException
)
188 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
191 void FakedUpdateableResultSet::updateCharacterStream( sal_Int32 columnIndex
, const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& x
, sal_Int32 length
) throw (SQLException
, RuntimeException
)
193 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
196 void FakedUpdateableResultSet::updateObject( sal_Int32 columnIndex
, const ::com::sun::star::uno::Any
& x
) throw (SQLException
, RuntimeException
)
198 throw SQLException( m_aReason
, *this, OUString(),1,Any() );
201 void FakedUpdateableResultSet::updateNumericObject( sal_Int32 columnIndex
, const ::com::sun::star::uno::Any
& x
, sal_Int32 scale
) throw (SQLException
, RuntimeException
)
203 throw SQLException( m_aReason
, *this, OUString(),1,Any() );