diff options
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/calc/CResultSet.cxx | 28 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DConnection.cxx | 24 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DResultSet.cxx | 28 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FConnection.cxx | 70 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FPreparedStatement.cxx | 122 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FResultSet.cxx | 287 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 39 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcode.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/EConnection.cxx | 22 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/EResultSet.cxx | 24 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/makefile.mk | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/odbc/OResultSet.cxx | 86 |
13 files changed, 384 insertions, 379 deletions
diff --git a/connectivity/source/drivers/calc/CResultSet.cxx b/connectivity/source/drivers/calc/CResultSet.cxx index dbc7446ee6de..59df5048689e 100644 --- a/connectivity/source/drivers/calc/CResultSet.cxx +++ b/connectivity/source/drivers/calc/CResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: CResultSet.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:40:01 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -131,8 +131,8 @@ Any SAL_CALL OCalcResultSet::queryInterface( const Type & rType ) throw(RuntimeE Any SAL_CALL OCalcResultSet::getBookmark( ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return makeAny((sal_Int32)(*m_aRow)[0]); } @@ -140,8 +140,8 @@ Any SAL_CALL OCalcResultSet::getBookmark( ) throw( SQLException, RuntimeExcept sal_Bool SAL_CALL OCalcResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -151,8 +151,8 @@ sal_Bool SAL_CALL OCalcResultSet::moveToBookmark( const Any& bookmark ) throw( sal_Bool SAL_CALL OCalcResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -163,8 +163,8 @@ sal_Bool SAL_CALL OCalcResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 SAL_CALL OCalcResultSet::compareBookmarks( const Any& first, const Any& second ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return (first == second) ? 0 : 2; } @@ -177,8 +177,8 @@ sal_Bool SAL_CALL OCalcResultSet::hasOrderedBookmarks( ) throw( SQLException, sal_Int32 SAL_CALL OCalcResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return connectivity::getINT32(bookmark); } @@ -187,8 +187,8 @@ sal_Int32 SAL_CALL OCalcResultSet::hashBookmark( const Any& bookmark ) throw( S Sequence< sal_Int32 > SAL_CALL OCalcResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return Sequence< sal_Int32 >(); } diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx index 96ec97877a53..0a79324e7e0c 100644 --- a/connectivity/source/drivers/dbase/DConnection.cxx +++ b/connectivity/source/drivers/dbase/DConnection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DConnection.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-04-27 10:08:09 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -119,8 +119,8 @@ IMPLEMENT_SERVICE_INFO(ODbaseConnection, "com.sun.star.sdbc.drivers.dbase.Connec Reference< XDatabaseMetaData > SAL_CALL ODbaseConnection::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + Reference< XDatabaseMetaData > xMetaData = m_xMetaData; if(!xMetaData.is()) @@ -148,8 +148,8 @@ Reference< XDatabaseMetaData > SAL_CALL ODbaseConnection::getMetaData( ) throw( Reference< XStatement > SAL_CALL ODbaseConnection::createStatement( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + Reference< XStatement > xReturn = new ODbaseStatement(this); m_aStatements.push_back(WeakReferenceHelper(xReturn)); @@ -159,10 +159,10 @@ Reference< XStatement > SAL_CALL ODbaseConnection::createStatement( ) throw(SQL Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + - ODbasePreparedStatement* pStmt = new ODbasePreparedStatement(this,m_aTypeInfo); + ODbasePreparedStatement* pStmt = new ODbasePreparedStatement(this); Reference< XPreparedStatement > xHoldAlive = pStmt; pStmt->construct(sql); m_aStatements.push_back(WeakReferenceHelper(*pStmt)); @@ -172,9 +172,11 @@ Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( con Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return NULL; } +// ----------------------------------------------------------------------------- + diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx index 5860b9ba85bd..bee3b954b678 100644 --- a/connectivity/source/drivers/dbase/DResultSet.cxx +++ b/connectivity/source/drivers/dbase/DResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DResultSet.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:37:37 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -140,8 +140,8 @@ Any SAL_CALL ODbaseResultSet::queryInterface( const Type & rType ) throw(Runtime Any SAL_CALL ODbaseResultSet::getBookmark( ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return makeAny((sal_Int32)(*m_aRow)[0]); } @@ -149,8 +149,8 @@ Any SAL_CALL ODbaseResultSet::getBookmark( ) throw( SQLException, RuntimeExcep sal_Bool SAL_CALL ODbaseResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -160,8 +160,8 @@ sal_Bool SAL_CALL ODbaseResultSet::moveToBookmark( const Any& bookmark ) throw( sal_Bool SAL_CALL ODbaseResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -172,8 +172,8 @@ sal_Bool SAL_CALL ODbaseResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 SAL_CALL ODbaseResultSet::compareBookmarks( const Any& first, const Any& second ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + sal_Int32 nFirst,nSecond,nResult; first >>= nFirst; @@ -199,8 +199,8 @@ sal_Bool SAL_CALL ODbaseResultSet::hasOrderedBookmarks( ) throw( SQLException, sal_Int32 SAL_CALL ODbaseResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return connectivity::getINT32(bookmark); } @@ -209,8 +209,8 @@ sal_Int32 SAL_CALL ODbaseResultSet::hashBookmark( const Any& bookmark ) throw( Sequence< sal_Int32 > SAL_CALL ODbaseResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return Sequence< sal_Int32 >(); } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 33e6434869ea..1a6bc6319191 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DTable.cxx,v $ * - * $Revision: 1.44 $ + * $Revision: 1.45 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:37:37 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1911,8 +1911,8 @@ BOOL ODbaseTable::WriteBuffer() void SAL_CALL ODbaseTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); - if (OTableDescriptor_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); + Reference<XDataDescriptorFactory> xOldColumn; m_pColumns->getByName(colName) >>= xOldColumn; @@ -1923,8 +1923,8 @@ void SAL_CALL ODbaseTable::alterColumnByName( const ::rtl::OUString& colName, co void SAL_CALL ODbaseTable::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); - if (OTableDescriptor_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); + if(index < 0 || index >= m_pColumns->getCount()) throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this); @@ -2025,8 +2025,8 @@ void ODbaseTable::alterColumn(sal_Int32 index, void SAL_CALL ODbaseTable::rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); - if (OTableDescriptor_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); + FileClose(); String aName = getEntry(); diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 1369898e8adc..95c0a2393d85 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FConnection.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:51:37 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -294,8 +294,8 @@ IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.file.Connection", Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + Reference< XStatement > xReturn = new OStatement(this); m_aStatements.push_back(WeakReferenceHelper(xReturn)); @@ -305,10 +305,10 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLExcep Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + - OPreparedStatement* pStmt = new OPreparedStatement(this,m_aTypeInfo); + OPreparedStatement* pStmt = new OPreparedStatement(this); Reference< XPreparedStatement > xHoldAlive = pStmt; pStmt->construct(sql); m_aStatements.push_back(WeakReferenceHelper(*pStmt)); @@ -318,8 +318,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const :: Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return NULL; } // -------------------------------------------------------------------------------- @@ -333,8 +333,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl:: void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + m_bAutoCommit = autoCommit; } @@ -342,8 +342,8 @@ void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLExcepti sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return m_bAutoCommit; } @@ -351,8 +351,8 @@ sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeExce void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + } @@ -360,8 +360,8 @@ void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException) void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + } @@ -376,8 +376,8 @@ sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + Reference< XDatabaseMetaData > xMetaData = m_xMetaData; if(!xMetaData.is()) @@ -392,8 +392,8 @@ Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLEx void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + m_bReadOnly = readOnly; } @@ -401,8 +401,8 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return m_bReadOnly; } @@ -410,15 +410,15 @@ sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeExcepti void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + } // -------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return ::rtl::OUString(); } @@ -426,16 +426,16 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + } // -------------------------------------------------------------------------------- sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return 0; } @@ -443,8 +443,8 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + return NULL; } @@ -458,8 +458,8 @@ void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException) { { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_BASE::rBHelper.bDisposed); + } dispose(); } diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 689fac8db68b..c86db187edda 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FPreparedStatement.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,7 +106,7 @@ using namespace com::sun::star::util; IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbc.driver.file.PreparedStatement","com.sun.star.sdbc.PreparedStatement"); -OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::std::vector<OTypeInfo>& _TypeInfo) +OPreparedStatement::OPreparedStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection ) ,m_pResultSet(NULL) ,m_pTable(NULL) @@ -187,8 +187,8 @@ Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(Runt Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if(!m_xMetaData.is()) m_xMetaData = new OResultSetMetaData(m_aSQLIterator.getSelectColumns(),m_aSQLIterator.getTables().begin()->first,m_pTable); @@ -199,8 +199,8 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) thr void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + clearMyResultSet(); } @@ -209,8 +209,8 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > rs = initResultSet(); @@ -221,8 +221,8 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > rs = initResultSet(); return m_pResultSet ? m_pResultSet->getRowCountResult() : sal_Int32(0); @@ -232,8 +232,8 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -247,8 +247,8 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::r Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + return (Reference< XConnection >)m_pConnection; } @@ -257,8 +257,8 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > rs = initResultSet(); return rs; @@ -268,8 +268,8 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -282,8 +282,8 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -297,8 +297,8 @@ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -313,8 +313,8 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& aVal ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -328,8 +328,8 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& aVal ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -343,8 +343,8 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -359,8 +359,8 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -374,8 +374,8 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -389,8 +389,8 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 aVal ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -398,8 +398,8 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 a void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + // Get the buffer needed for the length if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -414,8 +414,8 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -423,8 +423,8 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -432,8 +432,8 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -441,8 +441,8 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -450,8 +450,8 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); // For each known SQL Type, call the appropriate @@ -514,8 +514,8 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); @@ -529,8 +529,8 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); // setObject (parameterIndex, x, sqlType, 0); } @@ -539,8 +539,8 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if( parameterIndex < 1) throwInvalidIndexException(*this); setInt(parameterIndex,x); @@ -550,8 +550,8 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -560,8 +560,8 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -569,8 +569,8 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -578,8 +578,8 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + m_aRow->clear(); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index beefbc2c475e..3696c92672da 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FResultSet.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:51:37 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -269,14 +269,19 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + Reference< XResultSetMetaData > xMeta = getMetaData(); sal_Int32 nLen = xMeta->getColumnCount(); sal_Int32 i = 1; for(;i<=nLen;++i) - if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))) + if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : +#if SUPD > 630 + columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))) +#else + columnName.equalsIgnoreCase(xMeta->getColumnName(i))) +#endif break; return i; } @@ -284,8 +289,8 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) t Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -296,8 +301,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinarySt Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -309,8 +314,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacte sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -323,8 +328,8 @@ sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLExcep sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -337,8 +342,8 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -359,8 +364,8 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro ::com::sun::star::util::Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -374,8 +379,8 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -388,8 +393,8 @@ double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLExceptio float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -402,8 +407,8 @@ float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -416,8 +421,8 @@ sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLExceptio sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + sal_Int32 nPos = (sal_Int32)(*m_aRow)[0]; ::std::map<sal_Int32,sal_Int32>::const_iterator aFind = m_aBookmarks.find(nPos); OSL_ENSURE(aFind != m_aBookmarks.end(),"OResultSet::getRow() invalid bookmark!"); @@ -432,8 +437,8 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException) sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -445,8 +450,8 @@ sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLExcepti Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(!m_xMetaData.is()) m_xMetaData = new OResultSetMetaData(m_xColumns,m_aSQLIterator.getTables().begin()->first,m_pTable); @@ -456,8 +461,8 @@ Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLEx Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -470,8 +475,8 @@ Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -482,8 +487,8 @@ Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(S Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -495,8 +500,8 @@ Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(S Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -508,8 +513,8 @@ Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQL Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + columnIndex = mapColumn(columnIndex); return Any(); @@ -519,8 +524,8 @@ Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::co sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -534,8 +539,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept ::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -550,8 +555,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept ::com::sun::star::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -565,8 +570,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept ::com::sun::star::util::DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -578,8 +583,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_nRowPos == sal_Int32(m_pFileSet->size()); } @@ -587,8 +592,8 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_nRowPos == 0; } @@ -596,8 +601,8 @@ sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_nRowPos == sal_Int32(m_pFileSet->size() - 1); } @@ -605,8 +610,8 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(first()) previous(); @@ -615,8 +620,8 @@ void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(last()) next(); @@ -628,8 +633,8 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException) { { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + } dispose(); } @@ -638,8 +643,8 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return SkipDeleted(OFileTable::FILE_FIRST,1,sal_True); } @@ -648,8 +653,8 @@ sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + // here I know definitely that I stand on the last record return SkipDeleted(OFileTable::FILE_LAST,1,sal_True); @@ -658,8 +663,8 @@ sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return SkipDeleted(OFileTable::FILE_ABSOLUTE,row,sal_True); } @@ -667,8 +672,8 @@ sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, Runt sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return SkipDeleted(OFileTable::FILE_RELATIVE,row,sal_True); } @@ -676,8 +681,8 @@ sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, Runt sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return SkipDeleted(OFileTable::FILE_PRIOR,0,sal_True); } @@ -685,8 +690,8 @@ sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException) Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_aStatement.get(); } @@ -695,16 +700,16 @@ Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_bRowDeleted; } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_bRowInserted; } @@ -712,8 +717,8 @@ sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeExcepti sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_bRowUpdated; } @@ -722,8 +727,8 @@ sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeExceptio sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_nRowPos == -1; } @@ -763,8 +768,8 @@ sal_Bool OResultSet::evaluate() sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(!m_pTable) return sal_False; @@ -776,8 +781,8 @@ sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return m_bWasNull; } @@ -786,8 +791,8 @@ sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::cancel( ) throw(RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException) @@ -802,11 +807,11 @@ Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(!m_bInserted) - throw SQLException(); + throwFunctionSequenceException(*this); // we know that we append new rows at the end // so we have to know where the end is @@ -824,8 +829,8 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(m_pTable->isReadOnly()) throw SQLException(::rtl::OUString::createFromAscii("Table is readonly!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); m_bRowUpdated = m_pTable->UpdateRow(m_aInsertRow.getBody(), m_aRow,Reference<XIndexAccess>(m_xColNames,UNO_QUERY)); @@ -848,8 +853,8 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(m_pTable->isReadOnly()) throw SQLException(::rtl::OUString::createFromAscii("Table is readonly!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); @@ -870,8 +875,8 @@ void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException) void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bInserted = sal_False; m_bRowUpdated = sal_False; @@ -893,8 +898,8 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeExcept void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(m_pTable->isReadOnly()) throw SQLException(::rtl::OUString::createFromAscii("Table is readonly!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); @@ -919,8 +924,8 @@ void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeExcept void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); columnIndex = mapColumn(columnIndex); @@ -934,8 +939,8 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -948,8 +953,8 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -963,8 +968,8 @@ void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw( void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -977,8 +982,8 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -999,8 +1004,8 @@ void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1014,8 +1019,8 @@ void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1028,8 +1033,8 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw( void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1042,8 +1047,8 @@ void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUSt void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1056,8 +1061,8 @@ void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sa void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1071,8 +1076,8 @@ void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::s void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1086,8 +1091,8 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::s void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1101,8 +1106,8 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::s void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(!x.is()) ::dbtools::throwFunctionSequenceException(*this); @@ -1118,8 +1123,8 @@ void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Refer void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(!x.is()) ::dbtools::throwFunctionSequenceException(*this); @@ -1135,15 +1140,15 @@ void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Re void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); @@ -1157,8 +1162,8 @@ void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) th void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->size()) throwInvalidIndexException(*this); columnIndex = mapColumn(columnIndex); @@ -2552,7 +2557,7 @@ void OResultSet::GetAssignValues() } } if(!aColumnNameList.size()) - throw SQLException(); + throwFunctionSequenceException(*this); // Werte ... OSQLParseNode * pValuesOrQuerySpec = m_pParseTree->getChild(4); @@ -2562,7 +2567,7 @@ void OResultSet::GetAssignValues() // nur "VALUES" ist erlaubt ... if (! SQL_ISTOKEN(pValuesOrQuerySpec->getChild(0),VALUES)) - throw SQLException(); + throwFunctionSequenceException(*this); OSL_ENSURE(pValuesOrQuerySpec->count() == 2,"OResultSet: pValuesOrQuerySpec->count() != 2"); @@ -2591,7 +2596,7 @@ void OResultSet::GetAssignValues() // String::CreateFromAscii("S1000"), // aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_SYNTAX_ERROR))), // 0, String() ); - throw SQLException(); + throwFunctionSequenceException(*this); } } else @@ -2607,7 +2612,7 @@ void OResultSet::GetAssignValues() // String::CreateFromAscii("S1000"), // aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_SYNTAX_ERROR))), // 0, String() ); - throw SQLException(); + throwFunctionSequenceException(*this); } } @@ -2615,7 +2620,7 @@ void OResultSet::GetAssignValues() else { // aStatus.SetStatementTooComplex(); - throw SQLException(); + throwFunctionSequenceException(*this); } } } @@ -2651,7 +2656,7 @@ void OResultSet::GetAssignValues() if (pComp->getTokenValue().toChar() != '=') { // aStatus.SetInvalidStatement(); - throw SQLException(); + throwFunctionSequenceException(*this); } OSQLParseNode * pVal = pAssignment->getChild(2); @@ -2686,7 +2691,7 @@ void OResultSet::ParseAssignValues(const ::std::vector< String>& aColumnNameList { // Parameter hinzufuegen, Typ ... entsprechend der Column, der der Wert zugewiesen wird Reference<XPropertySet> xCol; - ::cppu::extractInterface(xCol,m_xColNames->getByName(aColumnName)); + m_xColNames->getByName(aColumnName) >>= xCol; sal_Int32 nParameter = -1; if(m_xParamColumns.isValid()) { @@ -2702,7 +2707,7 @@ void OResultSet::ParseAssignValues(const ::std::vector< String>& aColumnNameList else { // aStatus.SetStatementTooComplex(); - throw SQLException(); + throwFunctionSequenceException(*this); } } //------------------------------------------------------------------ @@ -2723,7 +2728,7 @@ void OResultSet::SetAssignValue(const String& aColumnName, // String::CreateFromAscii("S0022"), // aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_COLUMN_NOT_FOUND))), // 0, String() ); - throw SQLException(); + throwFunctionSequenceException(*this); } // Value an die Row mit den zuzuweisenden Werten binden: @@ -2754,7 +2759,7 @@ void OResultSet::SetAssignValue(const String& aColumnName, else { // aStatus.Set(SQL_STAT_ERROR); // nyi: genauer! - throw SQLException(); + throwFunctionSequenceException(*this); } } break; @@ -2781,7 +2786,7 @@ void OResultSet::SetAssignValue(const String& aColumnName, // } } break; default: - throw SQLException(); + throwFunctionSequenceException(*this); } } diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index 3f4b3e4e6b5c..e9fc8e411c99 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FStatement.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -210,8 +210,7 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException) { { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); } dispose(); } @@ -220,8 +219,8 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException) void OStatement_Base::reset() throw (SQLException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + clearWarnings (); @@ -236,8 +235,8 @@ void OStatement_Base::reset() throw (SQLException) void OStatement_Base::clearMyResultSet () throw (SQLException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference<XCloseable> xCloseable; if(::comphelper::query_interface(m_xResultSet.get(),xCloseable)) @@ -252,8 +251,8 @@ void OStatement_Base::clearMyResultSet () throw (SQLException) void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + m_aLastWarning = ex; } @@ -263,8 +262,8 @@ void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException) sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > xRS = executeQuery(sql); @@ -276,8 +275,8 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > xRS = NULL; @@ -335,8 +334,8 @@ Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLEx sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + Reference< XResultSet > xRS = NULL; @@ -364,8 +363,8 @@ sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + return makeAny(m_aLastWarning); } @@ -375,8 +374,8 @@ Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeExcepti void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OStatement_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + m_aLastWarning = SQLWarning(); } diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index adbb348a4b56..c5a301b8926f 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fcode.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:51:37 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -117,7 +117,7 @@ TYPEINIT1(OOp_COMPARE, OBoolOperator); TYPEINIT1(ONumOperator, OOperator); //------------------------------------------------------------------ -#if 0 +#if SUPD < 632 sal_Int32 compareIgnoreCase(const rtl::OUString& rStr1, const rtl::OUString& rStr2, const ::rtl::OLocale& rLocale) { rtl::OUString aString1 = rStr1.toUpperCase(rLocale); @@ -377,22 +377,22 @@ sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) con case DataType::CHAR: case DataType::VARCHAR: { -#if 0 +#if SUPD < 632 static String sLanguage; static String sCountry; if (!sLanguage.Len()) ConvertLanguageToIsoNames(Application::GetAppInternational().GetLanguage(), sLanguage, sCountry); static rtl::OLocale aLocale = rtl::OLocale::registerLocale(sLanguage, sCountry); - INT32 nRes = compareIgnoreCase(aLH, aRH, aLocale); -#endif +#else INT32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength ( static_cast<rtl::OUString>(aLH).pData->buffer, static_cast<rtl::OUString>(aLH).pData->length, static_cast<rtl::OUString>(aRH).pData->buffer, static_cast<rtl::OUString>(aRH).pData->length ); +#endif switch(aPredicateType) { case SQL_PRED_EQUAL: bResult = (nRes == 0); break; diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index ab09a4fa163e..f029257492aa 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EConnection.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-27 10:08:10 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -167,8 +167,8 @@ void OFlatConnection::construct(const ::rtl::OUString& url,const Sequence< Prope Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_B::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_B::rBHelper.bDisposed); + Reference< XDatabaseMetaData > xMetaData = m_xMetaData; if(!xMetaData.is()) @@ -196,8 +196,8 @@ Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) throw(S Reference< XStatement > SAL_CALL OFlatConnection::createStatement( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_B::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_B::rBHelper.bDisposed); + OFlatStatement* pStmt = new OFlatStatement(this); Reference< XStatement > xStmt = pStmt; @@ -208,10 +208,10 @@ Reference< XStatement > SAL_CALL OFlatConnection::createStatement( ) throw(SQLE Reference< XPreparedStatement > SAL_CALL OFlatConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_B::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_B::rBHelper.bDisposed); - OFlatPreparedStatement* pStmt = new OFlatPreparedStatement(this,m_aTypeInfo); + + OFlatPreparedStatement* pStmt = new OFlatPreparedStatement(this); Reference< XPreparedStatement > xStmt = pStmt; pStmt->construct(sql); @@ -222,8 +222,8 @@ Reference< XPreparedStatement > SAL_CALL OFlatConnection::prepareStatement( cons Reference< XPreparedStatement > SAL_CALL OFlatConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OConnection_B::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OConnection_B::rBHelper.bDisposed); + return NULL; } diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx index 4cdf9e7ed8b4..14e77d710e2d 100644 --- a/connectivity/source/drivers/flat/EResultSet.cxx +++ b/connectivity/source/drivers/flat/EResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EResultSet.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -154,8 +154,8 @@ Sequence< Type > SAL_CALL OFlatResultSet::getTypes( ) throw( RuntimeException) Any SAL_CALL OFlatResultSet::getBookmark( ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return makeAny((sal_Int32)(*m_aRow)[0]); } @@ -163,8 +163,8 @@ Any SAL_CALL OFlatResultSet::getBookmark( ) throw( SQLException, RuntimeExcept sal_Bool SAL_CALL OFlatResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -174,8 +174,8 @@ sal_Bool SAL_CALL OFlatResultSet::moveToBookmark( const Any& bookmark ) throw( sal_Bool SAL_CALL OFlatResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False; @@ -186,8 +186,8 @@ sal_Bool SAL_CALL OFlatResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 SAL_CALL OFlatResultSet::compareBookmarks( const Any& first, const Any& second ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return (first == second) ? 0 : 2; } @@ -200,8 +200,8 @@ sal_Bool SAL_CALL OFlatResultSet::hasOrderedBookmarks( ) throw( SQLException, sal_Int32 SAL_CALL OFlatResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - if (OResultSet_BASE::rBHelper.bDisposed) - throw DisposedException(); + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + return connectivity::getINT32(bookmark); } diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk index 4592962419a2..7de72345e2d3 100644 --- a/connectivity/source/drivers/flat/makefile.mk +++ b/connectivity/source/drivers/flat/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.11 $ +# $Revision: 1.12 $ # -# last change: $Author: oj $ $Date: 2001-05-14 13:36:27 $ +# last change: $Author: oj $ $Date: 2001-05-17 06:46:52 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -123,7 +123,6 @@ SHL1STDLIBS+= ifile$(UPD).lib SHL1DEPN= SHL1IMPLIB= i$(TARGET) -SHL1LIBS= $(SLB)$/file.lib SHL1DEF= $(MISC)$/$(SHL1TARGET).def diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index 4d8a55fec736..186dfb0a35c0 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: OResultSet.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $ + * last change: $Author: oj $ $Date: 2001-05-17 06:46:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -232,50 +232,50 @@ void OResultSet::allocBuffer(sal_Bool _bAllocRow) { case DataType::CHAR: case DataType::VARCHAR: - m_aBindVector.push_back(new ::rtl::OString()); + m_aBindVector.push_back((sal_Int64)new ::rtl::OString()); break; case DataType::DECIMAL: case DataType::NUMERIC: case DataType::BIGINT: - m_aBindVector.push_back(new ::rtl::OString()); + m_aBindVector.push_back((sal_Int64)new ::rtl::OString()); break; case DataType::FLOAT: - m_aBindVector.push_back(new float(0.0)); + m_aBindVector.push_back((sal_Int64)new float(0.0)); break; case DataType::DOUBLE: - m_aBindVector.push_back(new double(0.0)); + m_aBindVector.push_back((sal_Int64)new double(0.0)); break; case DataType::LONGVARCHAR: - m_aBindVector.push_back(new char[2]); // dient nur zum auffinden + m_aBindVector.push_back((sal_Int64)new char[2]); // dient nur zum auffinden break; case DataType::LONGVARBINARY: - m_aBindVector.push_back(new char[2]); // dient nur zum auffinden + m_aBindVector.push_back((sal_Int64)new char[2]); // dient nur zum auffinden break; case DataType::DATE: - m_aBindVector.push_back(new DATE_STRUCT); + m_aBindVector.push_back((sal_Int64)new DATE_STRUCT); break; case DataType::TIME: - m_aBindVector.push_back(new TIME_STRUCT); + m_aBindVector.push_back((sal_Int64)new TIME_STRUCT); break; case DataType::TIMESTAMP: - m_aBindVector.push_back(new TIMESTAMP_STRUCT); + m_aBindVector.push_back((sal_Int64)new TIMESTAMP_STRUCT); break; case DataType::BIT: - m_aBindVector.push_back(new sal_Int8(0)); + m_aBindVector.push_back((sal_Int64)new sal_Int8(0)); break; case DataType::TINYINT: case DataType::SMALLINT: - m_aBindVector.push_back(new sal_Int16(0)); + m_aBindVector.push_back((sal_Int64)new sal_Int16(0)); break; case DataType::INTEGER: - m_aBindVector.push_back(new sal_Int32(0)); + m_aBindVector.push_back((sal_Int64)new sal_Int32(0)); break; case DataType::REAL: - m_aBindVector.push_back(new float(0)); + m_aBindVector.push_back((sal_Int64)new float(0)); break; case DataType::BINARY: case DataType::VARBINARY: - m_aBindVector.push_back(new sal_Int8[xMeta->getPrecision(i)]); + m_aBindVector.push_back((sal_Int64)new sal_Int8[xMeta->getPrecision(i)]); break; default: OSL_ENSURE(0,"Unknown type"); @@ -291,7 +291,7 @@ void OResultSet::releaseBuffer() { Reference< XResultSetMetaData > xMeta = getMetaData(); sal_Int32 nLen = xMeta->getColumnCount(); - void** pValue = m_aBindVector.begin() + 1; + TVoidVector::iterator pValue = m_aBindVector.begin() + 1; for(sal_Int32 i = 1; i<=nLen; ++i, ++pValue) { OSL_ENSURE(pValue != m_aBindVector.end(),"Iterator is equal end!"); @@ -299,50 +299,50 @@ void OResultSet::releaseBuffer() { case DataType::CHAR: case DataType::VARCHAR: - delete static_cast< ::rtl::OString* >(*pValue); + delete static_cast< ::rtl::OString* >((void*)*pValue); break; case DataType::DECIMAL: case DataType::NUMERIC: case DataType::BIGINT: - delete static_cast< ::rtl::OString* >(*pValue); + delete static_cast< ::rtl::OString* >((void*)*pValue); break; case DataType::FLOAT: - delete static_cast< float* >(*pValue); + delete static_cast< float* >((void*)*pValue); break; case DataType::DOUBLE: - delete static_cast< double* >(*pValue); + delete static_cast< double* >((void*)*pValue); break; case DataType::LONGVARCHAR: - delete static_cast< char* >(*pValue); + delete static_cast< char* >((void*)*pValue); break; case DataType::LONGVARBINARY: - delete static_cast< char* >(*pValue); + delete static_cast< char* >((void*)*pValue); break; case DataType::DATE: - delete static_cast< DATE_STRUCT* >(*pValue); + delete static_cast< DATE_STRUCT* >((void*)*pValue); break; case DataType::TIME: - delete static_cast< TIME_STRUCT* >(*pValue); + delete static_cast< TIME_STRUCT* >((void*)*pValue); break; case DataType::TIMESTAMP: - delete static_cast< TIMESTAMP_STRUCT* >(*pValue); + delete static_cast< TIMESTAMP_STRUCT* >((void*)*pValue); break; case DataType::BIT: - delete static_cast< sal_Int8* >(*pValue); + delete static_cast< sal_Int8* >((void*)*pValue); break; case DataType::TINYINT: case DataType::SMALLINT: - delete static_cast< sal_Int16* >(*pValue); + delete static_cast< sal_Int16* >((void*)*pValue); break; case DataType::INTEGER: - delete static_cast< sal_Int32* >(*pValue); + delete static_cast< sal_Int32* >((void*)*pValue); break; case DataType::REAL: - delete static_cast< float* >(*pValue); + delete static_cast< float* >((void*)*pValue); break; case DataType::BINARY: case DataType::VARBINARY: - delete static_cast< sal_Int8* >(*pValue); + delete static_cast< sal_Int8* >((void*)*pValue); break; } } @@ -1028,7 +1028,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) if (nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO && nRet != SQL_NEED_DATA) break; - ::std::vector<void*>::const_iterator aFound = ::std::find(m_aBindVector.begin(),m_aBindVector.end(),pData); + TVoidVector::const_iterator aFound = ::std::find(m_aBindVector.begin(),m_aBindVector.end(),(sal_Int64)pData); sal_Int32 nPos = m_aBindVector.size() - (m_aBindVector.end() - aFound); // TODO transfer long data @@ -1093,7 +1093,7 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_BIT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1105,7 +1105,7 @@ void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw( ::osl::MutexGuard aGuard( m_aMutex ); columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_CHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1117,7 +1117,7 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TINYINT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1129,7 +1129,7 @@ void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw( ::osl::MutexGuard aGuard( m_aMutex ); columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_INTEGER,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1150,7 +1150,7 @@ void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQ columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_REAL,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1162,7 +1162,7 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw( columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_DOUBLE,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1173,7 +1173,7 @@ void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUSt columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_VARCHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1184,7 +1184,7 @@ void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sa columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_BINARY,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } // ------------------------------------------------------------------------- @@ -1195,7 +1195,7 @@ void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) thr columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; DATE_STRUCT aVal = OTools::DateToOdbcDate(x); OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_DATE,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } @@ -1208,7 +1208,7 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) thr columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; TIME_STRUCT aVal = OTools::TimeToOdbcTime(x); OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TIME,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } @@ -1221,7 +1221,7 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime columnIndex = mapColumn(columnIndex); - void* pData = m_aBindVector[columnIndex]; + void* pData = (void*)m_aBindVector[columnIndex]; TIMESTAMP_STRUCT aVal = OTools::DateTimeToTimestamp(x); OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TIMESTAMP,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding); } |