Tag: cws_src680_kabparam User: ebischoff Date: 2006/06/29 01:15:27 Modified: dba/connectivity/source/drivers/kab/KCatalog.cxx dba/connectivity/source/drivers/kab/KCatalog.hxx dba/connectivity/source/drivers/kab/KColumns.cxx dba/connectivity/source/drivers/kab/KColumns.hxx dba/connectivity/source/drivers/kab/KConnection.cxx dba/connectivity/source/drivers/kab/KConnection.hxx dba/connectivity/source/drivers/kab/KDEInit.cxx dba/connectivity/source/drivers/kab/KDEInit.h dba/connectivity/source/drivers/kab/KDatabaseMetaData.cxx dba/connectivity/source/drivers/kab/KDatabaseMetaData.hxx dba/connectivity/source/drivers/kab/KDriver.cxx dba/connectivity/source/drivers/kab/KDriver.hxx dba/connectivity/source/drivers/kab/KPreparedStatement.cxx dba/connectivity/source/drivers/kab/KPreparedStatement.hxx dba/connectivity/source/drivers/kab/KResultSet.cxx dba/connectivity/source/drivers/kab/KResultSet.hxx dba/connectivity/source/drivers/kab/KResultSetMetaData.cxx dba/connectivity/source/drivers/kab/KResultSetMetaData.hxx dba/connectivity/source/drivers/kab/KServices.cxx dba/connectivity/source/drivers/kab/KStatement.cxx dba/connectivity/source/drivers/kab/KStatement.hxx dba/connectivity/source/drivers/kab/KTable.cxx dba/connectivity/source/drivers/kab/KTable.hxx dba/connectivity/source/drivers/kab/KTables.cxx dba/connectivity/source/drivers/kab/KTables.hxx dba/connectivity/source/drivers/kab/kcondition.cxx dba/connectivity/source/drivers/kab/kcondition.hxx dba/connectivity/source/drivers/kab/kfields.cxx dba/connectivity/source/drivers/kab/kfields.hxx dba/connectivity/source/drivers/kab/korder.cxx dba/connectivity/source/drivers/kab/korder.hxx dba/connectivity/source/drivers/kab/makefile.mk
Log: #i66691# Support for parametrized queries in KDE address book connector File Changes: Directory: /dba/connectivity/source/drivers/kab/ ================================================ File [changed]: KCatalog.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KCatalog.cxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KCatalog.cxx 19 Dec 2005 16:47:54 -0000 1.2 +++ KCatalog.cxx 29 Jun 2006 08:15:20 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KCatalog.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:47:54 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KCatalog.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KCatalog.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KCatalog.hxx 19 Dec 2005 16:48:03 -0000 1.2 +++ KCatalog.hxx 29 Jun 2006 08:15:20 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KCatalog.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:48:03 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KColumns.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KColumns.cxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KColumns.cxx 19 Dec 2005 16:48:15 -0000 1.2 +++ KColumns.cxx 29 Jun 2006 08:15:21 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KColumns.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:48:15 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KColumns.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KColumns.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KColumns.hxx 19 Dec 2005 16:48:25 -0000 1.2 +++ KColumns.hxx 29 Jun 2006 08:15:21 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KColumns.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:48:25 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KConnection.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KConnection.cxx?r1=1.4&r2=1.4.8.1 Delta lines: +6 -5 ------------------- --- KConnection.cxx 20 Jun 2006 01:38:11 -0000 1.4 +++ KConnection.cxx 29 Jun 2006 08:15:21 -0000 1.4.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KConnection.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:38:11 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -57,7 +57,8 @@ #include <com/sun/star/sdbc/TransactionIsolation.hpp> #endif -#include "kabc_stdaddressbook.hxx" +#define KDE_HEADERS_WANT_KABC_STDADDRESSBOOK +#include "kde_headers.hxx" using namespace connectivity::kab; using namespace com::sun::star::uno; @@ -184,7 +185,7 @@ { ::osl::MutexGuard aGuard( m_aMutex ); - // just simple -> we are close when we are disposed taht means someone called dispose(); (XComponent) + // just simple -> we are closed when we are disposed, that means someone called dispose(); (XComponent) return KabConnection_BASE::rBHelper.bDisposed; } // -------------------------------------------------------------------------------- File [changed]: KConnection.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KConnection.hxx?r1=1.3&r2=1.3.86.1 Delta lines: +2 -2 ------------------- --- KConnection.hxx 19 Jan 2006 15:30:40 -0000 1.3 +++ KConnection.hxx 29 Jun 2006 08:15:21 -0000 1.3.86.1 @@ -4,9 +4,9 @@ * * $RCSfile: KConnection.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.86.1 $ * - * last change: $Author: obo $ $Date: 2006/01/19 15:30:40 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KDEInit.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDEInit.cxx?r1=1.2&r2=1.2.86.1 Delta lines: +9 -9 ------------------- --- KDEInit.cxx 20 Jan 2006 08:37:32 -0000 1.2 +++ KDEInit.cxx 29 Jun 2006 08:15:21 -0000 1.2.86.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDEInit.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.86.1 $ * - * last change: $Author: obo $ $Date: 2006/01/20 08:37:32 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -44,11 +44,12 @@ #include <osl/process.h> #endif -#include <kapplication.h> -#include <kcmdlineargs.h> -#include <kglobal.h> -#include <klocale.h> -#include <kdeversion.h> +#define KDE_HEADERS_WANT_KAPPLICATION +#define KDE_HEADERS_WANT_KCMDLINEARGS +#define KDE_HEADERS_WANT_KGLOBAL +#define KDE_HEADERS_WANT_KLOCALE +#define KDE_HEADERS_WANT_KDEVERSION +#include "kde_headers.hxx" namespace connectivity { @@ -83,9 +84,8 @@ { OSL_ENSURE(s_pKApplication == NULL, "KDEInit::Init: inconsistency in the application pointers!"); - // version 0.1 char *kabargs[1] = {"libkab1"}; - KCmdLineArgs::init(1, kabargs, "KAddressBook", *kabargs, "Address Book driver", "0.1"); + KCmdLineArgs::init(1, kabargs, "KAddressBook", *kabargs, "Address Book driver", KAB_DRIVER_VERSION); s_pKApplication = new KApplication(false, false); } File [changed]: KDEInit.h Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDEInit.h?r1=1.2&r2=1.2.86.1 Delta lines: +7 -2 ------------------- --- KDEInit.h 20 Jan 2006 08:37:46 -0000 1.2 +++ KDEInit.h 29 Jun 2006 08:15:21 -0000 1.2.86.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDEInit.h,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.86.1 $ * - * last change: $Author: obo $ $Date: 2006/01/20 08:37:46 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,6 +35,11 @@ #ifndef CONNECTIVITY_KAB_KDEINIT_H #define CONNECTIVITY_KAB_KDEINIT_H + +// the address book driver's version +#define KAB_DRIVER_VERSION "0.2" +#define KAB_DRIVER_VERSION_MAJOR 0 +#define KAB_DRIVER_VERSION_MINOR 2 // the minimum KDE version which is required at runtime #define MIN_KDE_VERSION_MAJOR 3 File [changed]: KDatabaseMetaData.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDatabaseMetaData.cxx?r1=1.4&r2=1.4.8.1 Delta lines: +9 -7 ------------------- --- KDatabaseMetaData.cxx 20 Jun 2006 01:38:27 -0000 1.4 +++ KDatabaseMetaData.cxx 29 Jun 2006 08:15:21 -0000 1.4.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDatabaseMetaData.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:38:27 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -38,6 +38,9 @@ #ifndef _CONNECTIVITY_KAB_FIELDS_HXX_ #include "kfields.hxx" #endif +#ifndef CONNECTIVITY_KAB_KDEINIT_H +#include "KDEInit.h" +#endif #include <klocale.h> #ifndef _CONNECTIVITY_FDATABASEMETADATARESULTSET_HXX_ @@ -603,8 +606,7 @@ // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL KabDatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException) { - // version 0.1 - ::rtl::OUString aValue = ::rtl::OUString::createFromAscii("0.1"); + ::rtl::OUString aValue = ::rtl::OUString::createFromAscii(KAB_DRIVER_VERSION); return aValue; } // ------------------------------------------------------------------------- @@ -634,7 +636,7 @@ // ------------------------------------------------------------------------- sal_Int32 SAL_CALL KabDatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException) { - return 1; + return KAB_DRIVER_VERSION_MAJOR; } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL KabDatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException) @@ -644,7 +646,7 @@ // ------------------------------------------------------------------------- sal_Int32 SAL_CALL KabDatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException) { - return 0; + return KAB_DRIVER_VERSION_MINOR; } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL KabDatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException) File [changed]: KDatabaseMetaData.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDatabaseMetaData.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KDatabaseMetaData.hxx 19 Dec 2005 16:49:35 -0000 1.2 +++ KDatabaseMetaData.hxx 29 Jun 2006 08:15:21 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDatabaseMetaData.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:49:35 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KDriver.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDriver.cxx?r1=1.6&r2=1.6.8.1 Delta lines: +5 -7 ------------------- --- KDriver.cxx 20 Jun 2006 01:38:42 -0000 1.6 +++ KDriver.cxx 29 Jun 2006 08:15:22 -0000 1.6.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDriver.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.6.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:38:42 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -443,14 +443,12 @@ // -------------------------------------------------------------------------------- sal_Int32 SAL_CALL KabDriver::getMajorVersion( ) throw(RuntimeException) { - // version 0.1 - return 0; + return KAB_DRIVER_VERSION_MAJOR; } // -------------------------------------------------------------------------------- sal_Int32 SAL_CALL KabDriver::getMinorVersion( ) throw(RuntimeException) { - // version 0.1 - return 1; + return KAB_DRIVER_VERSION_MINOR; } // -------------------------------------------------------------------------------- void SAL_CALL KabDriver::queryTermination( const EventObject& ) throw (TerminationVetoException, RuntimeException) File [changed]: KDriver.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KDriver.hxx?r1=1.3&r2=1.3.86.1 Delta lines: +2 -2 ------------------- --- KDriver.hxx 19 Jan 2006 15:31:11 -0000 1.3 +++ KDriver.hxx 29 Jun 2006 08:15:22 -0000 1.3.86.1 @@ -4,9 +4,9 @@ * * $RCSfile: KDriver.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.86.1 $ * - * last change: $Author: obo $ $Date: 2006/01/19 15:31:11 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KPreparedStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KPreparedStatement.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +55 -11 --------------------- --- KPreparedStatement.cxx 20 Jun 2006 01:38:53 -0000 1.3 +++ KPreparedStatement.cxx 29 Jun 2006 08:15:22 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KPreparedStatement.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:38:53 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -50,10 +50,19 @@ IMPLEMENT_SERVICE_INFO(KabPreparedStatement, "com.sun.star.sdbc.drivers.KabPreparedStatement", "com.sun.star.sdbc.PreparedStatement"); // ------------------------------------------------------------------------- -void KabPreparedStatement::checkParameterIndex(sal_Int32) +void KabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(SQLException) { - // no parameters allowed in this implementation - throw SQLException(); + if ( !m_aParameterRow.isValid() ) + m_aParameterRow = new OValueVector(); + + if (nParams < 1) + ::dbtools::throwSQLException( + "SQL statement parameters are numbered starting at 1.", + ::dbtools::SQL_INVALID_DESCRIPTOR_INDEX, + *(KabPreparedStatement *) this); + + if (nParams >= (sal_Int32) (*m_aParameterRow).size()) + (*m_aParameterRow).resize(nParams); } // ------------------------------------------------------------------------- void KabPreparedStatement::setKabFields() const throw(SQLException) @@ -70,12 +79,32 @@ m_xMetaData->setKabFields(xColumns); } // ------------------------------------------------------------------------- +void KabPreparedStatement::resetParameters() const throw(SQLException) +{ + m_nParameterIndex = 0; +} +// ------------------------------------------------------------------------- +void KabPreparedStatement::getNextParameter(::rtl::OUString &rParameter) const throw(SQLException) +{ + if (m_nParameterIndex >= (sal_Int32) (*m_aParameterRow).size()) + ::dbtools::throwSQLException( + "More parameters in SQL statement than set.", + ::dbtools::SQL_INVALID_DESCRIPTOR_INDEX, + *(KabPreparedStatement *) this); + + rParameter = (*m_aParameterRow)[m_nParameterIndex]; + + m_nParameterIndex++; +} +// ------------------------------------------------------------------------- KabPreparedStatement::KabPreparedStatement( KabConnection* _pConnection, const ::rtl::OUString& sql) : KabPreparedStatement_BASE(_pConnection), m_sSqlStatement(sql), - m_bPrepared(sal_False) + m_bPrepared(sal_False), + m_nParameterIndex(0), + m_aParameterRow() { } // ------------------------------------------------------------------------- @@ -83,6 +112,17 @@ { } // ------------------------------------------------------------------------- +void KabPreparedStatement::disposing() +{ + KabPreparedStatement_BASE::disposing(); + + if (m_aParameterRow.isValid()) + { + m_aParameterRow->clear(); + m_aParameterRow = NULL; + } +} +// ------------------------------------------------------------------------- Reference< XResultSetMetaData > SAL_CALL KabPreparedStatement::getMetaData() throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -152,12 +192,14 @@ return rs; } // ------------------------------------------------------------------------- -void SAL_CALL KabPreparedStatement::setNull(sal_Int32, sal_Int32) throw(SQLException, RuntimeException) +void SAL_CALL KabPreparedStatement::setNull(sal_Int32 parameterIndex, sal_Int32) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed); -::dbtools::throwFunctionNotSupportedException(::rtl::OUString::createFromAscii("Not Implemented"), NULL); + checkAndResizeParameters(parameterIndex); + + (*m_aParameterRow)[parameterIndex - 1].setNull(); } // ------------------------------------------------------------------------- void SAL_CALL KabPreparedStatement::setObjectNull(sal_Int32, sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException) @@ -224,12 +266,14 @@ ::dbtools::throwFunctionNotSupportedException(::rtl::OUString::createFromAscii("Not Implemented"), NULL); } // ------------------------------------------------------------------------- -void SAL_CALL KabPreparedStatement::setString(sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException) +void SAL_CALL KabPreparedStatement::setString(sal_Int32 parameterIndex, const ::rtl::OUString &x) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed); -::dbtools::throwFunctionNotSupportedException(::rtl::OUString::createFromAscii("Not Implemented"), NULL); + checkAndResizeParameters(parameterIndex); + + (*m_aParameterRow)[parameterIndex - 1] = x; } // ------------------------------------------------------------------------- void SAL_CALL KabPreparedStatement::setBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException) File [changed]: KPreparedStatement.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KPreparedStatement.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +14 -17 --------------------- --- KPreparedStatement.hxx 19 Dec 2005 16:50:16 -0000 1.2 +++ KPreparedStatement.hxx 29 Jun 2006 08:15:22 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KPreparedStatement.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:50:16 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,11 +39,13 @@ #ifndef _CONNECTIVITY_KAB_STATEMENT_HXX_ #include "KStatement.hxx" #endif - #ifndef _CONNECTIVITY_KAB_RESULTSETMETADATA_HXX_ #include "KResultSetMetaData.hxx" #endif +#ifndef _CONNECTIVITY_FILE_VALUE_HXX_ +#include <connectivity/FValue.hxx> +#endif #ifndef _COM_SUN_STAR_SDBC_XPARAMETERS_HPP_ #include <com/sun/star/sdbc/XParameters.hpp> #endif @@ -69,36 +71,31 @@ class KabPreparedStatement : public KabPreparedStatement_BASE { protected: - struct Parameter - { - ::com::sun::star::uno::Any aValue; - sal_Int32 nDataType; - - Parameter(const ::com::sun::star::uno::Any& rValue, - sal_Int32 rDataType) - : aValue(rValue), nDataType(rDataType) - { } - }; - -// ::std::vector< Parameter> m_aParameters; -// Not used so far ::rtl::OUString m_sSqlStatement; ::rtl::Reference< KabResultSetMetaData > m_xMetaData; sal_Bool m_bPrepared; + mutable sal_Int32 m_nParameterIndex; + OValueRow m_aParameterRow; - void checkParameterIndex(sal_Int32 _parameterIndex); + void checkAndResizeParameters(sal_Int32 nParams) throw(::com::sun::star::sdbc::SQLException); void setKabFields() const throw(::com::sun::star::sdbc::SQLException); protected: virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + + virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException); + virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException); virtual ~KabPreparedStatement(); public: DECLARE_SERVICE_INFO(); KabPreparedStatement(KabConnection* _pConnection, const ::rtl::OUString& sql); + + // OComponentHelper + virtual void SAL_CALL disposing(); // XPreparedStatement virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); File [changed]: KResultSet.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KResultSet.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +7 -4 ------------------- --- KResultSet.cxx 20 Jun 2006 01:39:09 -0000 1.3 +++ KResultSet.cxx 29 Jun 2006 08:15:22 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KResultSet.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:39:09 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -49,7 +49,10 @@ #ifndef _CONNECTIVITY_KAB_FIELDS_HXX_ #include "kfields.hxx" #endif -#include "kabc_addressbook.hxx" + +#define KDE_HEADERS_WANT_KABC_ADDRESSBOOK +#include "kde_headers.hxx" + #include <qdatetime.h> #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ File [changed]: KResultSet.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KResultSet.hxx?r1=1.3&r2=1.3.8.1 Delta lines: +6 -4 ------------------- --- KResultSet.hxx 20 Jun 2006 01:39:24 -0000 1.3 +++ KResultSet.hxx 29 Jun 2006 08:15:22 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KResultSet.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:39:24 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,7 +42,9 @@ #ifndef _CONNECTIVITY_KAB_RESULTSETMETADATA_HXX_ #include "KResultSetMetaData.hxx" #endif -#include <kabc/addressee.h> + +#define KDE_HEADERS_WANT_KABC_ADDRESSEE +#include "kde_headers.hxx" #ifndef _COM_SUN_STAR_SDBC_XROW_HPP_ #include <com/sun/star/sdbc/XRow.hpp> File [changed]: KResultSetMetaData.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KResultSetMetaData.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +3 -3 ------------------- --- KResultSetMetaData.cxx 20 Jun 2006 01:39:36 -0000 1.3 +++ KResultSetMetaData.cxx 29 Jun 2006 08:15:22 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KResultSetMetaData.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:39:36 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KResultSetMetaData.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KResultSetMetaData.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KResultSetMetaData.hxx 19 Dec 2005 16:51:00 -0000 1.2 +++ KResultSetMetaData.hxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KResultSetMetaData.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:51:00 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KServices.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KServices.cxx?r1=1.4&r2=1.4.8.1 Delta lines: +3 -3 ------------------- --- KServices.cxx 20 Jun 2006 01:39:51 -0000 1.4 +++ KServices.cxx 29 Jun 2006 08:15:23 -0000 1.4.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: KServices.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:39:51 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KStatement.cxx?r1=1.3&r2=1.3.6.1 Delta lines: +46 -18 --------------------- --- KStatement.cxx 20 Jun 2006 01:40:03 -0000 1.3 +++ KStatement.cxx 29 Jun 2006 08:15:23 -0000 1.3.6.1 @@ -4,9 +4,9 @@ * * $RCSfile: KStatement.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.6.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:40:03 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -94,6 +94,25 @@ { } // ----------------------------------------------------------------------------- +void KabCommonStatement::disposing() +{ + KabCommonStatement_BASE::disposing(); +} +// ----------------------------------------------------------------------------- +void KabCommonStatement::resetParameters() const throw(::com::sun::star::sdbc::SQLException) +{ + ::dbtools::throwGenericSQLException( + ::rtl::OUString::createFromAscii("Parameters can appear only in prepared statements."), + NULL); +} +// ----------------------------------------------------------------------------- +void KabCommonStatement::getNextParameter(::rtl::OUString &) const throw(::com::sun::star::sdbc::SQLException) +{ + ::dbtools::throwGenericSQLException( + ::rtl::OUString::createFromAscii("Parameters can appear only in prepared statements."), + NULL); +} +// ----------------------------------------------------------------------------- KabCondition *KabCommonStatement::analyseWhereClause(const OSQLParseNode *pParseNode) const throw(SQLException) { if (pParseNode->count() == 3) @@ -126,14 +145,21 @@ break; } } - else if (SQL_ISRULE(pLeft, column_ref) && pRight->isToken()) + else if (SQL_ISRULE(pLeft, column_ref)) { ::rtl::OUString sColumnName, - sTableRange, - sMatchString; + sTableRange; m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange); + + if (pRight->isToken() || SQL_ISRULE(pRight, parameter)) + { + ::rtl::OUString sMatchString; + + if (pRight->isToken()) // WHERE Name = 'Doe' sMatchString = pRight->getTokenValue(); + else if (SQL_ISRULE(pRight, parameter)) // WHERE Name = ? + getNextParameter(sMatchString); switch (pMiddle->getNodeType()) { @@ -150,6 +176,7 @@ } } } + } else if (SQL_ISRULE(pParseNode, search_condition)) { if (SQL_ISTOKEN(pMiddle, OR)) @@ -314,6 +341,7 @@ { if (SQL_ISRULE(pParseNode, where_clause)) { + resetParameters(); pParseNode = pParseNode->getChild(1); pCondition = analyseWhereClause(pParseNode); if (pCondition->isAlwaysTrue()) File [changed]: KStatement.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KStatement.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +6 -3 ------------------- --- KStatement.hxx 19 Dec 2005 16:51:31 -0000 1.2 +++ KStatement.hxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KStatement.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:51:31 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -117,6 +117,9 @@ virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + + virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException); + virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException); virtual ~KabCommonStatement(); public: @@ -126,7 +129,7 @@ using KabCommonStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >; // OComponentHelper - virtual void SAL_CALL disposing(void){KabCommonStatement_BASE::disposing();} + virtual void SAL_CALL disposing(); // XInterface virtual void SAL_CALL release() throw(); File [changed]: KTable.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KTable.cxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KTable.cxx 19 Dec 2005 16:51:42 -0000 1.2 +++ KTable.cxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KTable.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:51:42 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KTable.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KTable.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KTable.hxx 19 Dec 2005 16:51:52 -0000 1.2 +++ KTable.hxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KTable.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:51:52 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KTables.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KTables.cxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KTables.cxx 19 Dec 2005 16:52:04 -0000 1.2 +++ KTables.cxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KTables.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:52:04 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: KTables.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KTables.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +3 -3 ------------------- --- KTables.hxx 19 Dec 2005 16:52:13 -0000 1.2 +++ KTables.hxx 29 Jun 2006 08:15:23 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: KTables.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:52:13 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: kcondition.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/kcondition.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +3 -3 ------------------- --- kcondition.cxx 20 Jun 2006 01:41:01 -0000 1.3 +++ kcondition.cxx 29 Jun 2006 08:15:24 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: kcondition.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:41:01 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: kcondition.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/kcondition.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +6 -4 ------------------- --- kcondition.hxx 19 Dec 2005 16:53:11 -0000 1.2 +++ kcondition.hxx 29 Jun 2006 08:15:24 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: kcondition.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:53:11 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,7 +39,9 @@ #ifndef _COMPHELPER_TYPES_H_ #include <comphelper/types.hxx> #endif -#include <kabc/addressee.h> + +#define KDE_HEADERS_WANT_KABC_ADDRESSEE +#include "kde_headers.hxx" #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> File [changed]: kfields.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/kfields.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +3 -3 ------------------- --- kfields.cxx 20 Jun 2006 01:41:14 -0000 1.3 +++ kfields.cxx 29 Jun 2006 08:15:24 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: kfields.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:41:14 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: kfields.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/kfields.hxx?r1=1.2&r2=1.2.102.1 Delta lines: +5 -4 ------------------- --- kfields.hxx 19 Dec 2005 16:53:33 -0000 1.2 +++ kfields.hxx 29 Jun 2006 08:15:24 -0000 1.2.102.1 @@ -4,9 +4,9 @@ * * $RCSfile: kfields.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.102.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 16:53:33 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,7 +36,8 @@ #ifndef _CONNECTIVITY_KAB_FIELDS_HXX_ #define _CONNECTIVITY_KAB_FIELDS_HXX_ -#include <kabc/field.h> +#define KDE_HEADERS_WANT_KABC_FIELD +#include "kde_headers.hxx" #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> File [changed]: korder.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/korder.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +3 -3 ------------------- --- korder.cxx 20 Jun 2006 01:41:25 -0000 1.3 +++ korder.cxx 29 Jun 2006 08:15:24 -0000 1.3.8.1 @@ -4,9 +4,9 @@ * * $RCSfile: korder.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.8.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 01:41:25 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. File [changed]: korder.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/korder.hxx?r1=1.3&r2=1.3.74.1 Delta lines: +5 -3 ------------------- --- korder.hxx 3 Feb 2006 17:33:43 -0000 1.3 +++ korder.hxx 29 Jun 2006 08:15:24 -0000 1.3.74.1 @@ -4,9 +4,9 @@ * * $RCSfile: korder.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.74.1 $ * - * last change: $Author: kz $ $Date: 2006/02/03 17:33:43 $ + * last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,8 +40,10 @@ #include "rtl/ustring.hxx" #endif +#define KDE_HEADERS_WANT_KABC_ADDRESSEE +#include "kde_headers.hxx" + #include <vector> -#include <kabc/addressee.h> namespace connectivity { File [changed]: makefile.mk Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/makefile.mk?r1=1.5&r2=1.5.74.1 Delta lines: +2 -2 ------------------- --- makefile.mk 3 Feb 2006 17:33:57 -0000 1.5 +++ makefile.mk 29 Jun 2006 08:15:24 -0000 1.5.74.1 @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.5.74.1 $ # -# last change: $Author: kz $ $Date: 2006/02/03 17:33:57 $ +# last change: $Author: ebischoff $ $Date: 2006/06/29 08:15:24 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
