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

Implement set[Date|Time]. (firebird-sdbc)

Change-Id: Ia519b2ec9c6be94f6f21bbd2951a295da8079479
üst 93e9f05c
...@@ -390,26 +390,32 @@ void SAL_CALL OPreparedStatement::setDouble(sal_Int32 nIndex, double nValue) ...@@ -390,26 +390,32 @@ void SAL_CALL OPreparedStatement::setDouble(sal_Int32 nIndex, double nValue)
setValue< double >(nIndex, nValue, SQL_DOUBLE); // TODO: SQL_D_FLOAT? setValue< double >(nIndex, nValue, SQL_DOUBLE); // TODO: SQL_D_FLOAT?
} }
// ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setDate(sal_Int32 nIndex, const Date& rDate)
throw(SQLException, RuntimeException)
void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException)
{ {
(void) parameterIndex; struct tm aCTime;
(void) aData; aCTime.tm_mday = rDate.Day;
::osl::MutexGuard aGuard( m_pConnection->getMutex() ); aCTime.tm_mon = rDate.Month;
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); aCTime.tm_year = rDate.Year;
} ISC_DATE aISCDate;
// ------------------------------------------------------------------------- isc_encode_sql_date(&aCTime, &aISCDate);
setValue< ISC_DATE >(nIndex, aISCDate, SQL_TYPE_DATE);
}
void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& aVal ) throw(SQLException, RuntimeException) void SAL_CALL OPreparedStatement::setTime( sal_Int32 nIndex, const Time& rTime)
throw(SQLException, RuntimeException)
{ {
(void) parameterIndex; struct tm aCTime;
(void) aVal; aCTime.tm_sec = rTime.Seconds;
::osl::MutexGuard aGuard( m_pConnection->getMutex() ); aCTime.tm_min = rTime.Minutes;
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); aCTime.tm_hour = rTime.Hours;
ISC_TIME aISCTime;
isc_encode_sql_time(&aCTime, &aISCTime);
setValue< ISC_TIME >(nIndex, aISCTime, SQL_TYPE_TIME);
} }
void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 nIndex, const DateTime& rTimestamp) void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 nIndex, const DateTime& rTimestamp)
......
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