Files
libreoffice/connectivity/source/drivers/ado/APreparedStatement.cxx

558 lines
21 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-12 22:04:38 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "connectivity/sqlparse.hxx"
2000-09-18 15:18:56 +00:00
#include "ado/APreparedStatement.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
#include "ado/AResultSetMetaData.hxx"
#include "ado/AResultSet.hxx"
#include "ado/ADriver.hxx"
2000-09-18 15:18:56 +00:00
#include <com/sun/star/lang/DisposedException.hpp>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/processfactory.hxx>
2000-10-09 10:26:03 +00:00
#include <comphelper/sequence.hxx>
2001-05-14 10:42:44 +00:00
#include "connectivity/dbexception.hxx"
#include "connectivity/dbtools.hxx"
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
#include "resource/ado_res.hrc"
#include <limits>
2000-09-18 15:18:56 +00:00
#define CHECK_RETURN(x) \
if(!x) \
ADOS::ThrowException(*m_pConnection->getConnection(),*this);
CWS-TOOLING: integrate CWS boost134 2009-09-09 10:30:24 +0200 fs r275970 : #i100127# provided by rene: check whether system-boost's function.hpp compiles without exception support 2009-09-04 21:58:00 +0200 fs r275832 : indention 2009-09-04 21:57:10 +0200 fs r275831 : #i10000# type in boost/spirit check. Thanks to thb 2009-09-04 10:58:54 +0200 fs r275787 : #i100127# provided by tono@openoffice.org: mingw needs using directives for std::min/max 2009-09-04 10:31:54 +0200 fs r275782 : #i100127# (approved by hjs) on Solaris, set GNUTAR to /usr/sfw/bin/gtar, this is available on baseline machines (Solaris 10.x), but not necessarily available in LD_LIBRARY_PATH 2009-08-19 21:47:55 +0200 rene r275161 : #i10000# check for the header actually used now 2009-08-17 21:55:31 +0200 fs r275073 : CWS-TOOLING: rebase CWS boost134 to trunk@275001 (milestone: DEV300:m55) 2009-07-16 09:39:25 +0200 fs r274031 : #i100127# extract download/% with GNUTAR instead of TAR 2009-07-14 09:18:15 +0200 fs r273960 : CWS-TOOLING: rebase CWS boost134 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 09:55:14 +0200 fs r273919 : #i100127# use boost 1.39, not 1.34 2009-07-13 09:45:57 +0200 fs r273918 : use GNUTAR when extracting download/%.tar.gz, not TAR (necessary with boost 1.39 tarball) 2009-07-10 21:10:52 +0200 fs r273905 : #i100127# spirit now part of boost 2009-07-06 12:12:13 +0200 fs r273732 : #i10000# lngconvex, used in src/wizards, is built in shell => added missing module dependency 2009-07-02 15:34:51 +0200 fs r273660 : #i100127# 2009-07-02 13:35:24 +0200 fs r273645 : #i100127# MSVC needs some hinting when using boost::bind on (some) member functions 2009-07-02 10:33:59 +0200 fs r273625 : removed unused include (lead to an internal compiler error with MSVC and boost 1.34+) 2009-07-02 09:44:35 +0200 fs r273619 : change some include orders, prevents 'internal compiler errors' with MSVC 2009-07-01 09:19:25 +0200 fs r273547 : #i100127# who the heck is defining max as something unusable? 2009-07-01 09:17:28 +0200 fs r273546 : #i100127# defining min/max is causing trouble now 2009-07-01 09:15:40 +0200 fs r273545 : #i100127# reverted previous patch, and properly fixed the problem by defining BOOST_MEM_FN_ENABLE_CDECL, and disabling warning 4180 2009-07-01 09:14:23 +0200 fs r273544 : #i100127# re-disable warning 4180, still needed for some files 2009-07-01 09:07:33 +0200 fs r273543 : #i100127# reverted previous patch, and properly fixed the problem by defining BOOST_MEM_FN_ENABLE_CDECL 2009-06-24 11:00:32 +0200 fs r273319 : oops, re-introduced some inc locations 2009-06-23 22:10:02 +0200 fs r273304 : #i100127# disable warning C4180 2009-06-23 22:08:36 +0200 fs r273303 : #i100127# disable warning C4180 2009-06-16 12:26:49 +0200 fs r273015 : #i10000# (provided by mst@openoffice.org) 2009-06-15 09:10:27 +0200 fs r272962 : #i10000# use -r instead of -a when copying the include files, this prevents the spurious 'failed to preserve ownership' errors 2009-06-11 23:55:06 +0200 fs r272902 : #i100127# 2009-06-11 23:54:47 +0200 fs r272901 : #i100127# 2009-06-11 23:54:05 +0200 fs r272900 : make compile on unxsol[i|s]4 2009-06-10 10:12:22 +0200 fs r272798 : #i100127# don't deliver from within unxlngi6/misc/build/boost, but from a 'normalized' location unxlngi6/inc 2009-06-10 09:48:00 +0200 fs r272795 : #i100127# use 1.34.1 unconditionally on all platforms
2009-09-17 10:11:42 +00:00
#ifdef max
# undef max
#endif
2000-09-18 15:18:56 +00:00
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using namespace connectivity::ado;
using namespace connectivity;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
using namespace com::sun::star::util;
IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.APreparedStatement","com.sun.star.sdbc.PreparedStatement");
OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const OTypeInfoMap& _TypeInfo,const OUString& sql)
2001-04-12 11:33:30 +00:00
: OStatement_Base( _pConnection )
,m_aTypeInfo(_TypeInfo)
2000-09-18 15:18:56 +00:00
{
osl_atomic_increment( &m_refCount );
2000-09-18 15:18:56 +00:00
OSQLParser aParser(comphelper::getComponentContext(_pConnection->getDriver()->getORB()));
OUString sErrorMessage;
OUString sNewSql;
OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,sql);
if(pNode)
{ // special handling for parameters
// we recusive replace all occurrences of ? in the statement and
// replace them with name like "parame" */
sal_Int32 nParameterCount = 0;
OUString sDefaultName( "parame" );
replaceParameterNodeName(pNode,sDefaultName,nParameterCount);
pNode->parseNodeToStr( sNewSql, _pConnection );
delete pNode;
}
else
sNewSql = sql;
CHECK_RETURN(m_Command.put_CommandText(sNewSql))
2000-09-18 15:18:56 +00:00
CHECK_RETURN(m_Command.put_Prepared(VARIANT_TRUE))
m_pParameters = m_Command.get_Parameters();
m_pParameters->AddRef();
m_pParameters->Refresh();
osl_atomic_decrement( &m_refCount );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
OPreparedStatement::~OPreparedStatement()
{
if (m_pParameters)
{
OSL_FAIL( "OPreparedStatement::~OPreparedStatement: not disposed!" );
m_pParameters->Release();
m_pParameters = NULL;
}
}
2000-09-18 15:18:56 +00:00
// -------------------------------------------------------------------------
Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
{
Any aRet = OStatement_Base::queryInterface(rType);
return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
2000-09-18 15:18:56 +00:00
static_cast< XPreparedStatement*>(this),
static_cast< XParameters*>(this),
static_cast< XPreparedBatchExecution*>(this),
static_cast< XResultSetMetaDataSupplier*>(this));
}
// -------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
{
::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedStatement > *)0 ),
::getCppuType( (const ::com::sun::star::uno::Reference< XParameters > *)0 ),
::getCppuType( (const ::com::sun::star::uno::Reference< XResultSetMetaDataSupplier > *)0 ),
::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedBatchExecution > *)0 ));
2000-10-09 10:26:03 +00:00
return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_Base::getTypes());
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
{
if(!m_xMetaData.is() && m_RecordSet.IsValid())
2001-01-09 11:39:19 +00:00
m_xMetaData = new OResultSetMetaData(m_RecordSet);
return m_xMetaData;
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void OPreparedStatement::disposing()
{
m_xMetaData.clear();
if (m_pParameters)
{
2000-09-18 15:18:56 +00:00
m_pParameters->Release();
m_pParameters = NULL;
}
2000-09-18 15:18:56 +00:00
OStatement_Base::disposing();
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
{
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
}
dispose();
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
SQLWarning warning;
// Reset warnings
clearWarnings ();
// Reset the statement handle, warning and saved Resultset
2001-04-12 11:33:30 +00:00
// reset();
2000-09-18 15:18:56 +00:00
// Call SQLExecute
try {
ADORecordset* pSet=NULL;
CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdUnknown,&pSet))
m_RecordSet = WpADORecordset(pSet);
}
catch (SQLWarning& ex)
{
// Save pointer to warning and save with ResultSet
// object once it is created.
warning = ex;
}
return m_RecordSet.IsValid();
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
ADORecordset* pSet=NULL;
CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdUnknown,&pSet))
if ( VT_ERROR == m_RecordsAffected.getType() )
{
ADOS::ThrowException(*m_pConnection->getConnection(),*this);
// to be sure that we get the error really thrown
throw SQLException();
}
2000-09-18 15:18:56 +00:00
m_RecordSet = WpADORecordset(pSet);
return static_cast<sal_Int32>(m_RecordsAffected);
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const DataTypeEnum& _eType,
const sal_Int32& _nSize,const OLEVariant& _Val) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
sal_Int32 nCount = 0;
m_pParameters->get_Count(&nCount);
2001-12-11 08:10:12 +00:00
if(nCount < (parameterIndex-1))
2000-09-18 15:18:56 +00:00
{
OUString sDefaultName( "parame" );
sDefaultName += OUString::number(parameterIndex);
2001-12-11 08:10:12 +00:00
ADOParameter* pParam = m_Command.CreateParameter(sDefaultName,_eType,adParamInput,_nSize,_Val);
2000-09-18 15:18:56 +00:00
if(pParam)
{
2000-09-18 15:18:56 +00:00
m_pParameters->Append(pParam);
#if OSL_DEBUG_LEVEL > 0
ADOParameter* pParam = NULL;
m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
WpADOParameter aParam(pParam);
if(pParam)
{
DataTypeEnum eType = aParam.GetADOType();
(void)eType;
}
#endif
}
2000-09-18 15:18:56 +00:00
}
else
{
ADOParameter* pParam = NULL;
2001-04-12 11:33:30 +00:00
m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
WpADOParameter aParam(pParam);
2000-09-18 15:18:56 +00:00
if(pParam)
2001-04-12 11:33:30 +00:00
{
#if OSL_DEBUG_LEVEL > 0
OUString sParam = aParam.GetName();
#endif // OSL_DEBUG_LEVEL
DataTypeEnum eType = aParam.GetADOType();
if ( _eType != eType && _eType != adDBTimeStamp )
{
aParam.put_Type(_eType);
eType = _eType;
aParam.put_Size(_nSize);
}
if ( adVarBinary == eType && aParam.GetAttributes() == adParamLong )
{
aParam.AppendChunk(_Val);
}
else
CHECK_RETURN(aParam.PutValue(_Val));
2001-04-12 11:33:30 +00:00
}
2000-09-18 15:18:56 +00:00
}
ADOS::ThrowException(*m_pConnection->getConnection(),*this);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
setParameter( parameterIndex, adLongVarWChar, ::std::numeric_limits< sal_Int32 >::max(), x );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
return (Reference< XConnection >)m_pConnection;
}
// -------------------------------------------------------------------------
Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
2001-04-12 11:33:30 +00:00
// first clear the old things
m_xMetaData.clear();
2001-04-12 11:33:30 +00:00
disposeResultSet();
if(m_RecordSet.IsValid())
m_RecordSet.Close();
m_RecordSet.clear();
// the create the new onces
m_RecordSet.Create();
2000-09-18 15:18:56 +00:00
OLEVariant aCmd;
aCmd.setIDispatch(m_Command);
OLEVariant aCon;
aCon.setNoArg();
2001-04-12 11:33:30 +00:00
CHECK_RETURN(m_RecordSet.put_CacheSize(m_nFetchSize))
CHECK_RETURN(m_RecordSet.put_MaxRecords(m_nMaxRows))
CHECK_RETURN(m_RecordSet.Open(aCmd,aCon,m_eCursorType,m_eLockType,adOpenUnspecified))
CHECK_RETURN(m_RecordSet.get_CacheSize(m_nFetchSize))
CHECK_RETURN(m_RecordSet.get_MaxRecords(m_nMaxRows))
CHECK_RETURN(m_RecordSet.get_CursorType(m_eCursorType))
CHECK_RETURN(m_RecordSet.get_LockType(m_eLockType))
2000-09-18 15:18:56 +00:00
2001-04-12 11:33:30 +00:00
OResultSet* pSet = new OResultSet(m_RecordSet,this);
Reference< XResultSet > xRs = pSet;
pSet->construct();
pSet->setMetaData(getMetaData());
m_xResultSet = WeakReference<XResultSet>(xRs);
2000-09-18 15:18:56 +00:00
return xRs;
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adBoolean,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adTinyInt,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adDBDate,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adDBTime,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adDBTimeStamp,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adDouble,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adSingle,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adInteger,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adBigInt,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
OLEVariant aVal;
aVal.setNull();
setParameter(parameterIndex,adEmpty,0,aVal);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setClob", *this );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setBlob", *this );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setArray", *this );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setRef", *this );
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
switch(sqlType)
{
case DataType::DECIMAL:
case DataType::NUMERIC:
setString(parameterIndex,::comphelper::getString(x));
break;
default:
::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale);
break;
}
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
setNull(parameterIndex,sqlType);
}
// -------------------------------------------------------------------------
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
if(!::dbtools::implSetObject(this,parameterIndex,x))
{
const OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
STR_UNKNOWN_PARA_TYPE,
"$position$", OUString::number(parameterIndex)
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
) );
::dbtools::throwGenericSQLException(sError,*this);
}
2000-09-18 15:18:56 +00:00
// setObject (parameterIndex, x, sqlType, 0);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adSmallInt,sizeof(x),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
{
setParameter(parameterIndex,adVarBinary,sizeof(sal_Int8)*x.getLength(),x);
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 /*parameterIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
2000-09-18 15:18:56 +00:00
{
::dbtools::throwFeatureNotImplementedException( "XParameters::setCharacterStream", *this );
2000-09-18 15:18:56 +00:00
}
2000-09-18 15:18:56 +00:00
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
{
2001-04-12 11:33:30 +00:00
if(x.is())
{
Sequence< sal_Int8 > aData;
x->readBytes(aData,length);
setBytes(parameterIndex,aData);
}
2000-09-18 15:18:56 +00:00
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
2001-05-17 06:30:42 +00:00
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2000-09-18 15:18:56 +00:00
if(m_pParameters)
{
sal_Int32 nCount = 0;
m_pParameters->get_Count(&nCount);
2001-12-11 08:10:12 +00:00
OLEVariant aVal;
aVal.setEmpty();
for(sal_Int32 i=0;i<nCount;++i)
{
ADOParameter* pParam = NULL;
m_pParameters->get_Item(OLEVariant(i),&pParam);
WpADOParameter aParam(pParam);
if(pParam)
{
OUString sParam = aParam.GetName();
2001-12-11 08:10:12 +00:00
CHECK_RETURN(aParam.PutValue(aVal));
}
}
// m_pParameters->Delete(OLEVariant(i));
2000-09-18 15:18:56 +00:00
}
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::clearBatch( ) throw(SQLException, RuntimeException)
{
// clearParameters( );
// m_aBatchList.erase();
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::addBatch( ) throw(SQLException, RuntimeException)
{
}
// -------------------------------------------------------------------------
Sequence< sal_Int32 > SAL_CALL OPreparedStatement::executeBatch( ) throw(SQLException, RuntimeException)
{
return Sequence< sal_Int32 > ();
}
2001-04-12 11:33:30 +00:00
// -----------------------------------------------------------------------------
2001-04-30 09:16:19 +00:00
// -----------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::acquire() throw()
2001-04-30 09:16:19 +00:00
{
OStatement_Base::acquire();
}
// -----------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::release() throw()
2001-04-30 09:16:19 +00:00
{
OStatement_Base::release();
}
// -----------------------------------------------------------------------------
void OPreparedStatement::replaceParameterNodeName(OSQLParseNode* _pNode,
const OUString& _sDefaultName,
sal_Int32& _rParameterCount)
{
sal_Int32 nCount = _pNode->count();
for(sal_Int32 i=0;i < nCount;++i)
{
OSQLParseNode* pChildNode = _pNode->getChild(i);
if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() == 1)
{
OSQLParseNode* pNewNode = new OSQLParseNode(OUString(":") ,SQL_NODE_PUNCTUATION,0);
delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
OUString sParameterName = _sDefaultName;
sParameterName += OUString::number(++_rParameterCount);
pChildNode->append(new OSQLParseNode( sParameterName,SQL_NODE_NAME,0));
}
else
replaceParameterNodeName(pChildNode,_sDefaultName,_rParameterCount);
}
}
// -----------------------------------------------------------------------------
2001-04-12 11:33:30 +00:00
2000-09-18 15:18:56 +00:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */