Kaydet (Commit) d5cb782f authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Implement setTimestamp. (firebird-sdbc)

Change-Id: I0c009a99061de787cd250912406a74a75fbc260a
üst e218242e
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <propertyids.hxx> #include <propertyids.hxx>
#include <time.h>
#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
...@@ -410,15 +411,22 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& ...@@ -410,15 +411,22 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time&
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
} }
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& aVal ) throw(SQLException, RuntimeException) void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 nIndex, const DateTime& rTimestamp)
throw(SQLException, RuntimeException)
{ {
(void) parameterIndex; struct tm aCTime;
(void) aVal; aCTime.tm_sec = rTimestamp.Seconds;
::osl::MutexGuard aGuard( m_pConnection->getMutex() ); aCTime.tm_min = rTimestamp.Minutes;
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); aCTime.tm_hour = rTimestamp.Hours;
aCTime.tm_mday = rTimestamp.Day;
aCTime.tm_mon = rTimestamp.Month;
aCTime.tm_year = rTimestamp.Year;
ISC_TIMESTAMP aISCTimestamp;
isc_encode_timestamp(&aCTime, &aISCTimestamp);
setValue< ISC_TIMESTAMP >(nIndex, aISCTimestamp, SQL_TIMESTAMP);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment