diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-27 13:33:00 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-27 20:58:31 +0100 |
commit | dadba3efcb2fb3df3b89058dfd4a98d648241ec6 (patch) | |
tree | e403b0477f293c7e77f0534759c6f0031ff7c878 /connectivity | |
parent | 73aaa4da674ac8389ee8269e4d7c827d7e642e26 (diff) |
Return change count for Statement:executeUpdate too. (firebird-sdbc)
This also simplifies Statement, although not using execute_immediate
is somewhat less efficient.
Change-Id: I4bebe13e5a63cb02e6b2659dec534f0c6feeba52
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/Statement.cxx | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/connectivity/source/drivers/firebird/Statement.cxx b/connectivity/source/drivers/firebird/Statement.cxx index 59f89de4a2df..00978b708d62 100644 --- a/connectivity/source/drivers/firebird/Statement.cxx +++ b/connectivity/source/drivers/firebird/Statement.cxx @@ -97,28 +97,8 @@ void OStatement::disposeResultSet() sal_Int32 SAL_CALL OStatement::executeUpdate(const OUString& sql) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); - checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); - - SAL_INFO("connectivity.firebird", "executeUpdate(" << sql << ")"); - - int aErr = isc_dsql_execute_immediate(m_statusVector, - &m_pConnection->getDBHandle(), - &m_pConnection->getTransaction(), - 0, - OUStringToOString(sql, RTL_TEXTENCODING_UTF8).getStr(), - FIREBIRD_SQL_DIALECT, - NULL); - - if (aErr) - SAL_WARN("connectivity.firebird", "isc_dsql_execute_immediate failed" ); - - evaluateStatusVector(m_statusVector, sql, *this); - // TODO: get number of changed rows with SELECT ROW_COUNT (use executeQuery) - // return getUpdateCount(); - // We can't use return getStatementChangeCount(); since that depends - // on having the statement handle, so maybe just use executeQuery instead? - return 0; + execute(sql); + return getStatementChangeCount(); } |