diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-07-30 07:53:02 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-07-30 07:53:02 +0000 |
commit | 503986990c7410000c336f934c911bdc4924d6fb (patch) | |
tree | 417ad1133fe68d9d5002b9686240fcc0eaa9f0ce /connectivity/source/drivers/file/FPreparedStatement.cxx | |
parent | c7f6878d5904ea16554b58b87b4636a9d4484577 (diff) |
#90015# use ORowSetValue as const ref
Diffstat (limited to 'connectivity/source/drivers/file/FPreparedStatement.cxx')
-rw-r--r-- | connectivity/source/drivers/file/FPreparedStatement.cxx | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 6b6a26086ec0..a6f9fb329f65 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.21 $ + * $Revision: 1.22 $ * - * last change: $Author: oj $ $Date: 2001-07-25 13:05:23 $ + * last change: $Author: oj $ $Date: 2001-07-30 08:52:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -211,8 +211,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - Reference< XResultSet > rs = initResultSet(); + initResultSet(); return m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT || m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT_COUNT; } @@ -223,8 +222,8 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); + initResultSet(); - Reference< XResultSet > rs = initResultSet(); return m_pResultSet ? m_pResultSet->getRowCountResult() : sal_Int32(0); } // ------------------------------------------------------------------------- @@ -240,7 +239,6 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQ ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - return (Reference< XConnection >)m_pConnection; } // ------------------------------------------------------------------------- @@ -250,9 +248,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - Reference< XResultSet > rs = initResultSet(); - return rs; + return initResultSet(); } // ------------------------------------------------------------------------- @@ -305,9 +301,6 @@ 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -323,45 +316,30 @@ 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - ::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale); } // ------------------------------------------------------------------------- @@ -390,29 +368,25 @@ 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - throwInvalidIndexException(*this); + setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - throwInvalidIndexException(*this); + setBinaryStream(parameterIndex,x,length ); } // ------------------------------------------------------------------------- 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 ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); + if(!x.is()) + ::dbtools::throwFunctionSequenceException(*this); - throwInvalidIndexException(*this); + Sequence<sal_Int8> aSeq; + x->readSomeBytes(aSeq,length); + setParameter(parameterIndex,aSeq); } // ------------------------------------------------------------------------- |