LibreOffice Module connectivity (master) 1
FPreparedStatement.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
21#include <o3tl/safeint.hxx>
22#include <osl/diagnose.h>
24#include <com/sun/star/sdbc/DataType.hpp>
33#include <comphelper/types.hxx>
34#include <com/sun/star/sdbc/ColumnValue.hpp>
35#include <strings.hrc>
36
37using namespace connectivity;
38using namespace comphelper;
39using namespace ::dbtools;
40using namespace connectivity::file;
41using namespace com::sun::star::uno;
42using namespace com::sun::star::lang;
43using namespace com::sun::star::beans;
44using namespace com::sun::star::sdbc;
45using namespace com::sun::star::sdbcx;
46using namespace com::sun::star::container;
47using namespace com::sun::star;
48
49IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbc.driver.file.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
50
51OPreparedStatement::OPreparedStatement( OConnection* _pConnection)
52 : OStatement_BASE2( _pConnection )
53{
54}
55
56
58{
59}
60
61
63{
64 ::osl::MutexGuard aGuard(m_aMutex);
65
67
68 m_xParamColumns = nullptr;
69 m_xMetaData.clear();
70 if(m_aParameterRow.is())
71 {
72 m_aParameterRow->clear();
73 m_aParameterRow = nullptr;
74 }
75}
76
78{
80
82 m_aParameterRow->push_back(new ORowSetValueDecorator(sal_Int32(0)) );
83
84 Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
85
88 else
89 {
91 // describe all parameters need for the resultset
93 }
94
95 OValueRefRow aTemp;
97}
98
100{
102
104 m_xResultSet = uno::Reference<uno::XWeak>(xResultSet);
105 initializeResultSet(xResultSet.get());
106 initResultSet(xResultSet.get());
107 return xResultSet;
108}
109
110Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType )
111{
113 return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
114 static_cast< XPreparedStatement*>(this),
115 static_cast< XParameters*>(this),
116 static_cast< XResultSetMetaDataSupplier*>(this));
117}
118
119css::uno::Sequence< css::uno::Type > SAL_CALL OPreparedStatement::getTypes( )
120{
124
125 return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE2::getTypes());
126}
127
128
130{
131 ::osl::MutexGuard aGuard( m_aMutex );
132 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
133
134
135 if(!m_xMetaData.is())
137 return m_xMetaData;
138}
139
140
142{
143 ::osl::MutexGuard aGuard( m_aMutex );
144 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
145
147}
148
149
151{
152 ::osl::MutexGuard aGuard( m_aMutex );
153 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
154
156 // since we don't support the XMultipleResults interface, nobody will ever get that ResultSet...
157 if(xRS.is())
158 xRS->dispose();
159
161}
162
163
165{
166 ::osl::MutexGuard aGuard( m_aMutex );
167 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
168
170 if(xRS.is())
171 {
172 const sal_Int32 res(xRS->getRowCountResult());
173 // nobody will ever get that ResultSet...
174 xRS->dispose();
175 return res;
176 }
177 else
178 return 0;
179}
180
181
182void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x )
183{
184 setParameter(parameterIndex,x);
185}
186
187
189{
190 ::osl::MutexGuard aGuard( m_aMutex );
191 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
192
193 return m_pConnection;
194}
195
196
198{
199 ::osl::MutexGuard aGuard( m_aMutex );
200 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
201
202 return makeResultSet();
203}
204
205
206void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
207{
208 setParameter(parameterIndex,static_cast<bool>(x));
209}
210
211void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x )
212{
213 setParameter(parameterIndex,x);
214}
215
216
217void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const util::Date& aData )
218{
219 setParameter(parameterIndex,DBTypeConversion::toDouble(aData));
220}
221
222void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const util::Time& aVal )
223{
224 setParameter(parameterIndex,DBTypeConversion::toDouble(aVal));
225}
226
227
228void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const util::DateTime& aVal )
229{
230 setParameter(parameterIndex,DBTypeConversion::toDouble(aVal));
231}
232
233
234void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x )
235{
236 setParameter(parameterIndex,x);
237}
238
239
240void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
241{
242 setParameter(parameterIndex,x);
243}
244
245
246void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x )
247{
248 setParameter(parameterIndex,x);
249}
250
251
252void SAL_CALL OPreparedStatement::setLong( sal_Int32 /*parameterIndex*/, sal_Int64 /*aVal*/ )
253{
254 throwFeatureNotImplementedSQLException( "XParameters::setLong", *this );
255}
256
257
258void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ )
259{
260 ::osl::MutexGuard aGuard( m_aMutex );
261 checkAndResizeParameters(parameterIndex);
262
263 if ( m_aAssignValues.is() )
264 (*m_aAssignValues)[m_aParameterIndexes[parameterIndex]]->setNull();
265 else
266 (*m_aParameterRow)[parameterIndex]->setNull();
267}
268
269
270void SAL_CALL OPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ )
271{
272 throwFeatureNotImplementedSQLException( "XParameters::setClob", *this );
273}
274
275
276void SAL_CALL OPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ )
277{
278 throwFeatureNotImplementedSQLException( "XParameters::setBlob", *this );
279}
280
281
282void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ )
283{
284 throwFeatureNotImplementedSQLException( "XParameters::setArray", *this );
285}
286
287
288void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ )
289{
290 throwFeatureNotImplementedSQLException( "XParameters::setRef", *this );
291}
292
293
294void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale )
295{
296 switch(sqlType)
297 {
298 case DataType::DECIMAL:
299 case DataType::NUMERIC:
300 setString(parameterIndex,::comphelper::getString(x));
301 break;
302 default:
303 ::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale);
304 break;
305 }
306}
307
308
309void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& /*typeName*/ )
310{
311 setNull(parameterIndex,sqlType);
312}
313
314
315void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x )
316{
317 if(!::dbtools::implSetObject(this,parameterIndex,x))
318 {
319 const OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
320 STR_UNKNOWN_PARA_TYPE,
321 "$position$", OUString::number(parameterIndex)
322 ) );
324 }
325 // setObject (parameterIndex, x, sqlType, 0);
326}
327
328
329void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x )
330{
331 setParameter(parameterIndex,x);
332}
333
334
335void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x )
336{
337 setParameter(parameterIndex,x);
338}
339
340
341void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
342{
343 setBinaryStream(parameterIndex,x,length );
344}
345
346
347void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
348{
349 if(!x.is())
351
353 x->readBytes(aSeq,length);
354 setParameter(parameterIndex,aSeq);
355}
356
357
359{
360 ::osl::MutexGuard aGuard( m_aMutex );
361 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
362
363 m_aParameterRow->clear();
364 m_aParameterRow->push_back(new ORowSetValueDecorator(sal_Int32(0)) );
365}
366
368{
369 return new OResultSet(this,m_aSQLIterator);
370}
371
373{
374 // check if we got enough parameters
375 if ( (m_aParameterRow.is() && ( m_aParameterRow->size() -1 ) < m_xParamColumns->size()) ||
376 (m_xParamColumns.is() && !m_aParameterRow.is() && !m_aParameterRow->empty()) )
377 m_pConnection->throwGenericSQLException(STR_INVALID_PARA_COUNT,*this);
378
379 pResultSet->OpenImpl();
380 pResultSet->setMetaData(getMetaData());
381}
382
383void SAL_CALL OPreparedStatement::acquire() noexcept
384{
386}
387
388void SAL_CALL OPreparedStatement::release() noexcept
389{
391}
392
394{
395 ::connectivity::checkDisposed(OStatement_BASE::rBHelper.bDisposed);
396 if ( m_aAssignValues.is() && (parameterIndex < 1 || o3tl::make_unsigned(parameterIndex) >= m_aParameterIndexes.size()) )
398 else if ( static_cast<sal_Int32>(m_aParameterRow->size()) <= parameterIndex )
399 {
400 sal_Int32 i = m_aParameterRow->size();
401 m_aParameterRow->resize(parameterIndex+1);
402 for ( ; i <= parameterIndex; ++i)
403 {
404 if ( !(*m_aParameterRow)[i].is() )
405 (*m_aParameterRow)[i] = new ORowSetValueDecorator;
406 }
407 }
408}
409
410void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x)
411{
412 ::osl::MutexGuard aGuard( m_aMutex );
413 checkAndResizeParameters(parameterIndex);
414
415 if(m_aAssignValues.is())
416 *(*m_aAssignValues)[m_aParameterIndexes[parameterIndex]] = x;
417 else
418 *((*m_aParameterRow)[parameterIndex]) = x;
419}
420
422{
423 OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument is not a parameter");
424 OSL_ENSURE(pParameter->count() > 0,"OResultSet: Error in Parse Tree");
425
426 OUString sParameterName;
427 // set up Parameter-Column:
428 sal_Int32 eType = DataType::VARCHAR;
429 sal_uInt32 nPrecision = 255;
430 sal_Int32 nScale = 0;
431 sal_Int32 nNullable = ColumnValue::NULLABLE;
432
433 if (_xCol.is())
434 {
435 // Use type, precision, scale ... from the given column,
436 // because this Column will get a value assigned or
437 // with this Column the value will be compared.
438 _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= eType;
439 _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nPrecision;
440 _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
441 _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nNullable;
442 _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sParameterName;
443 }
444
445 Reference<XPropertySet> xParaColumn = new connectivity::parse::OParseColumn(sParameterName
446 ,OUString()
447 ,OUString()
448 ,OUString()
449 ,nNullable
450 ,nPrecision
451 ,nScale
452 ,eType
453 ,false
454 ,false
456 ,OUString()
457 ,OUString()
458 ,OUString());
459 m_xParamColumns->push_back(xParaColumn);
460 return m_xParamColumns->size();
461}
462
463void OPreparedStatement::describeColumn(OSQLParseNode const * _pParameter, OSQLParseNode const * _pNode,const OSQLTable& _xTable)
464{
466 if(SQL_ISRULE(_pNode,column_ref))
467 {
468 OUString sColumnName,sTableRange;
469 m_aSQLIterator.getColumnRange(_pNode,sColumnName,sTableRange);
470 if ( !sColumnName.isEmpty() )
471 {
472 Reference<XNameAccess> xNameAccess = _xTable->getColumns();
473 if(xNameAccess->hasByName(sColumnName))
474 xNameAccess->getByName(sColumnName) >>= xProp;
475 AddParameter(_pParameter,xProp);
476 }
477 }
478 // else
479 // AddParameter(_pParameter,xProp);
480}
481
483{
484 std::vector< OSQLParseNode*> aParseNodes;
485 scanParameter(m_pParseTree,aParseNodes);
486 if ( aParseNodes.empty() )
487 return;
488
489 // m_xParamColumns = new OSQLColumns();
490 const OSQLTables& rTabs = m_aSQLIterator.getTables();
491 if( !rTabs.empty() )
492 {
493 OSQLTable xTable = rTabs.begin()->second;
494 for (auto const& parseNode : aParseNodes)
495 {
496 describeColumn(parseNode,parseNode->getParent()->getChild(0),xTable);
497 }
498 }
499}
501{
503
504 // Substitute parameter (AssignValues and criteria):
505 if (m_xParamColumns->empty())
506 return;
507
508 // begin with AssignValues
509 sal_uInt16 nParaCount=0; // gives the current number of previously set Parameters
510
511 // search for parameters to be substituted:
512 size_t nCount = m_aAssignValues.is() ? m_aAssignValues->size() : 1; // 1 is important for the Criteria
513 for (size_t j = 1; j < nCount; j++)
514 {
515 sal_uInt32 nParameter = (*m_aAssignValues).getParameterIndex(j);
516 if (nParameter == SQL_NO_PARAMETER)
517 continue; // this AssignValue is no Parameter
518
519 ++nParaCount; // now the Parameter is valid
520 }
521
522 if (m_aParameterRow.is() && (m_xParamColumns->size()+1) != m_aParameterRow->size() )
523 {
524 sal_Int32 i = m_aParameterRow->size();
525 sal_Int32 nParamColumns = m_xParamColumns->size()+1;
526 m_aParameterRow->resize(nParamColumns);
527 for ( ;i < nParamColumns; ++i )
528 {
529 if ( !(*m_aParameterRow)[i].is() )
530 (*m_aParameterRow)[i] = new ORowSetValueDecorator;
531 }
532 }
533 if (m_aParameterRow.is() && nParaCount < m_aParameterRow->size() )
534 m_pSQLAnalyzer->bindParameterRow(m_aParameterRow);
535}
536
537void OPreparedStatement::parseParamterElem(const OUString& _sColumnName, OSQLParseNode* pRow_Value_Constructor_Elem)
538{
540 m_xColNames->getByName(_sColumnName) >>= xCol;
541 sal_Int32 nParameter = -1;
542 if(m_xParamColumns.is())
543 {
544 OSQLColumns::const_iterator aIter = find(m_xParamColumns->begin(),m_xParamColumns->end(),_sColumnName,::comphelper::UStringMixEqual(m_pTable->isCaseSensitive()));
545 if(aIter != m_xParamColumns->end())
546 nParameter = m_xParamColumns->size() - (m_xParamColumns->end() - aIter) + 1;// +1 because the rows start at 1
547 }
548 if(nParameter == -1)
549 nParameter = AddParameter(pRow_Value_Constructor_Elem,xCol);
550 // Save number of parameter in the variable:
551 SetAssignValue(_sColumnName, OUString(), true, nParameter);
552}
553
554
555/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static double toDouble(std::string_view rString)
Definition: DTable.cxx:1635
IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbc.driver.file.PreparedStatement","com.sun.star.sdbc.PreparedStatement")
#define SQL_NO_PARAMETER
Definition: FValue.hxx:470
::dbtools::OPropertyMap & getPropMap()
Definition: TConnection.cxx:68
ORowSetValueDecorator decorates an ORowSetValue so the value is "refcounted".
Definition: FValue.hxx:402
const ::rtl::Reference< OSQLColumns > & getParameters() const
const ::rtl::Reference< OSQLColumns > & getSelectColumns() const
const OSQLTables & getTables() const
void getColumnRange(const OSQLParseNode *_pColumnRef, OUString &_rColumnName, OUString &_rTableRange) const
return the columname and the table range
OSQLStatementType getStatementType() const
virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const css::util::DateTime &x) override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual rtl::Reference< OResultSet > createResultSet() override
virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const css::util::Date &x) override
virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef > &x) override
sal_uInt32 AddParameter(connectivity::OSQLParseNode const *pParameter, const css::uno::Reference< css::beans::XPropertySet > &_xCol)
void setParameter(sal_Int32 parameterIndex, const ORowSetValue &x)
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery() override
virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) override
virtual void construct(const OUString &sql) override
virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString &typeName) override
::rtl::Reference< OResultSet > makeResultSet()
void checkAndResizeParameters(sal_Int32 parameterIndex)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) override
virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob > &x) override
void describeColumn(OSQLParseNode const *_pParameter, OSQLParseNode const *_pNode, const OSQLTable &_xTable)
virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) override
virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray > &x) override
virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) override
::rtl::Reference< connectivity::OSQLColumns > m_xParamColumns
virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) override
virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob > &x) override
virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual void SAL_CALL setString(sal_Int32 parameterIndex, const OUString &x) override
virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) override
virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const css::util::Time &x) override
virtual sal_Int32 SAL_CALL executeUpdate() override
virtual void parseParamterElem(const OUString &_sColumnName, OSQLParseNode *pRow_Value_Constructor_Elem) override
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const css::uno::Any &x) override
virtual void initializeResultSet(OResultSet *_pResult) override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual sal_Bool SAL_CALL execute() override
virtual void SAL_CALL clearParameters() override
virtual void SAL_CALL disposing() override
void scanParameter(OSQLParseNode *pParseNode, std::vector< OSQLParseNode * > &_rParaNodes)
virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const css::uno::Any &x, sal_Int32 targetSqlType, sal_Int32 scale) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL close() override
virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) override
virtual void SAL_CALL setLong(sal_Int32 parameterIndex, sal_Int64 x) override
virtual void SAL_CALL acquire() noexcept override
static void setBoundedColumns(const OValueRefRow &_rRow, const OValueRefRow &_rSelectRow, const ::rtl::Reference< connectivity::OSQLColumns > &_rxColumns, const css::uno::Reference< css::container::XIndexAccess > &_xNames, bool _bSetColumnMapping, const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData, std::vector< sal_Int32 > &_rColMapping)
void setMetaData(const css::uno::Reference< css::sdbc::XResultSetMetaData > &_xMetaData)
Definition: FResultSet.hxx:270
virtual void SAL_CALL disposing() override
Definition: FStatement.cxx:103
virtual void SAL_CALL release() noexcept override
Definition: FStatement.cxx:138
std::unique_ptr< OSQLAnalyzer > m_pSQLAnalyzer
Definition: FStatement.hxx:75
std::vector< sal_Int32 > m_aColMapping
Definition: FStatement.hxx:59
connectivity::OSQLParseTreeIterator m_aSQLIterator
Definition: FStatement.hxx:71
css::uno::Reference< css::container::XNameAccess > m_xColNames
Definition: FStatement.hxx:67
virtual void construct(const OUString &sql)
Definition: FStatement.cxx:368
connectivity::OSQLParseNode * m_pParseTree
Definition: FStatement.hxx:74
virtual void initializeResultSet(OResultSet *_pResult)
Definition: FStatement.cxx:452
rtl::Reference< OConnection > m_pConnection
Definition: FStatement.hxx:73
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
rtl::Reference< OFileTable > m_pTable
Definition: FStatement.hxx:77
css::uno::WeakReference< css::sdbc::XResultSet > m_xResultSet
Definition: FStatement.hxx:65
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: FStatement.cxx:149
std::vector< sal_Int32 > m_aParameterIndexes
Definition: FStatement.hxx:60
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xDBMetaData
Definition: FStatement.hxx:66
virtual void SAL_CALL acquire() noexcept override
Definition: FStatement.cxx:133
void SetAssignValue(const OUString &aColumnName, const OUString &aValue, bool bSetNull=false, sal_uInt32 nParameter=SQL_NO_PARAMETER)
Definition: FStatement.cxx:639
mutable::osl::Mutex m_aMutex
int nCount
float x
DocumentType eType
sal_Int32 nNullable
Sequence< sal_Int8 > aSeq
size
Type
std::map< OUString, OSQLTable, comphelper::UStringMixLess > OSQLTables
Definition: CommonTools.hxx:56
ORefVector< css::uno::Reference< css::beans::XPropertySet > > OSQLColumns
Definition: CommonTools.hxx:95
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
Definition: dbtools.cxx:1958
css::uno::Reference< css::sdbcx::XColumnsSupplier > OSQLTable
Definition: CommonTools.hxx:54
void checkDisposed(bool _bThrow)
Definition: dbtools.cxx:1951
void throwFunctionSequenceException(const Reference< XInterface > &Context, const Any &Next)
void throwInvalidIndexException(const css::uno::Reference< css::uno::XInterface > &Context, const css::uno::Any &Next)
throw an invalid index sqlexception
bool implSetObject(const Reference< XParameters > &_rxParameters, const sal_Int32 _nColumnIndex, const Any &_rValue)
Definition: dbtools.cxx:1516
void throwFeatureNotImplementedSQLException(const OUString &_rFeatureName, const Reference< XInterface > &_rxContext, const Any &_rNextException)
void setObjectWithInfo(const Reference< XParameters > &_xParams, sal_Int32 parameterIndex, const Any &x, sal_Int32 sqlType, sal_Int32 scale)
Definition: dbtools.cxx:1765
void throwGenericSQLException(const OUString &_rMsg, const css::uno::Reference< css::uno::XInterface > &_rxSource)
throw a generic SQLException, i.e.
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 scale
Definition: pq_statics.cxx:62
#define PROPERTY_ID_NAME
Definition: propertyids.hxx:50
#define PROPERTY_ID_TYPE
Definition: propertyids.hxx:51
#define PROPERTY_ID_ISNULLABLE
Definition: propertyids.hxx:55
#define PROPERTY_ID_PRECISION
Definition: propertyids.hxx:53
#define PROPERTY_ID_SCALE
Definition: propertyids.hxx:54
#define SQL_ISRULE(pParseNode, eRule)
Definition: sqlnode.hxx:439
unsigned char sal_Bool
signed char sal_Int8
const SvXMLTokenMapEntry aTypes[]