summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/firebird
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-11 21:40:41 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-09-12 17:26:12 +0000
commit42165189826367937737861116e969a22e9db787 (patch)
tree69d8ec60869aee5981ecc4e5edbc1e3a89a625d7 /connectivity/source/drivers/firebird
parenta042cdd7eff15ed5f6cbd613588b3fca9509a85e (diff)
Update implementations of ColumnLocate::findColumn to throw on invalid column.
Change-Id: I7a9354ecd35a70a005c6c50e38d27de9b33332bd Reviewed-on: https://gerrit.libreoffice.org/5922 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'connectivity/source/drivers/firebird')
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index cbbd4d58dac9..99051fe423c6 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -331,15 +331,9 @@ sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& rColumnName)
return i;
}
- // The API documentation (XRowLocate) doesn't specify what should happen
- // if the column name isn't found. The JDBC api specifies that an SQLException
- // should be thrown. Most drivers return either -1 (some don't check for this
- // case and just return nLen), however the JDBC specification seems more
- // correct (in the case of the JDBC/HSQLDB drivers the SQLException is
- // just propagated from the JDBC call, hence should be expected by any
- // SDBC user too).
- ::dbtools::throwSQLException("Invalid column name", SQL_COLUMN_NOT_FOUND, *this);
- return -1; // Never reached
+ ::dbtools::throwInvalidColumnException(rColumnName, *this);
+ assert(false);
+ return 0; // Never reached
}
// -------------------------------------------------------------------------
uno::Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)