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

Cleanup exceptions in PreparedStatement.

Change-Id: Ice11ec8131a00335db48a05661bbe0285bb53fea
üst 101040a1
...@@ -316,16 +316,11 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, sal_Int32 /*nSqlType ...@@ -316,16 +316,11 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, sal_Int32 /*nSqlType
setParameterNull(nIndex, true); setParameterNull(nIndex, true);
} }
void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool x) void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 /*nIndex*/, sal_Bool /*bValue*/)
throw(SQLException, RuntimeException) throw(SQLException, RuntimeException)
{ {
(void) nIndex; // FIREBIRD3: will need to be implemented.
(void) x; ::dbtools::throwFunctionNotSupportedException("XParameters::setBoolean", *this);
MutexGuard aGuard(m_aMutex);
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
// TODO: decide how to deal with bools. Probably just as a byte, although
// it might be best to just determine the db type and set as appropriate?
} }
template <typename T> template <typename T>
...@@ -355,9 +350,7 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) ...@@ -355,9 +350,7 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType)
void SAL_CALL OPreparedStatement::setByte(sal_Int32 /*nIndex*/, sal_Int8 /*nValue*/) void SAL_CALL OPreparedStatement::setByte(sal_Int32 /*nIndex*/, sal_Int8 /*nValue*/)
throw(SQLException, RuntimeException) throw(SQLException, RuntimeException)
{ {
::dbtools::throwFunctionNotSupportedException("setByte not supported in firebird", ::dbtools::throwFunctionNotSupportedException("XParameters::setByte", *this);
*this,
Any());
} }
void SAL_CALL OPreparedStatement::setShort(sal_Int32 nIndex, sal_Int16 nValue) void SAL_CALL OPreparedStatement::setShort(sal_Int32 nIndex, sal_Int16 nValue)
...@@ -588,8 +581,12 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 nParameterIndex) ...@@ -588,8 +581,12 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 nParameterIndex)
{ {
ensurePrepared(); ensurePrepared();
if ((nParameterIndex == 0) || (nParameterIndex > m_pInSqlda->sqld)) if ((nParameterIndex == 0) || (nParameterIndex > m_pInSqlda->sqld))
throw SQLException(); {
// TODO: sane error message here. ::dbtools::throwSQLException(
"No column " + OUString::number(nParameterIndex),
::dbtools::SQL_COLUMN_NOT_FOUND,
*this);
}
} }
void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex, void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex,
......
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