[Libreoffice-commits] core.git: 2 commits - connectivity/source dbaccess/source include/connectivity mysqlc/source

Andrzej J.R. Hunt andrzej at ahunt.org
Thu Sep 12 10:26:35 PDT 2013


 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx      |   10 +++++--
 connectivity/source/commontools/dbexception.cxx                     |    9 ++++++
 connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx      |   10 +++++--
 connectivity/source/drivers/ado/AResultSet.cxx                      |   10 +++++--
 connectivity/source/drivers/evoab2/NResultSet.cxx                   |   10 +++++--
 connectivity/source/drivers/file/FResultSet.cxx                     |   12 +++++---
 connectivity/source/drivers/firebird/ResultSet.cxx                  |   12 ++------
 connectivity/source/drivers/kab/KResultSet.cxx                      |   13 ++-------
 connectivity/source/drivers/macab/MacabResultSet.cxx                |   14 +++-------
 connectivity/source/drivers/mork/MResultSet.cxx                     |    9 ++++--
 connectivity/source/drivers/mozab/MResultSet.cxx                    |    9 ++++--
 connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx |   10 +++++--
 connectivity/source/drivers/odbcbase/OResultSet.cxx                 |   10 +++++--
 connectivity/source/drivers/postgresql/pq_resultset.cxx             |    7 +++++
 connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx     |   10 +++----
 connectivity/source/sdbcx/VCollection.cxx                           |    8 +----
 dbaccess/source/ui/browser/formadapter.cxx                          |    6 +++-
 include/connectivity/dbexception.hxx                                |   13 +++++++++
 mysqlc/source/mysqlc_resultset.cxx                                  |    8 +++++
 19 files changed, 120 insertions(+), 70 deletions(-)

New commits:
commit 3f31bdd67a82056b87b8b93e54a953983ba048bc
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Sep 12 10:37:31 2013 +0100

    Update mysqlc's ColumnLocate::findColumn to throw for invalid column.
    
    (This is to comply with the updated API specification.)
    
    Change-Id: I4542fecc78a6e64011276dafc72c31d5533af1ab
    Reviewed-on: https://gerrit.libreoffice.org/5923
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx
index b2793ad..d9160ff 100644
--- a/mysqlc/source/mysqlc_resultset.cxx
+++ b/mysqlc/source/mysqlc_resultset.cxx
@@ -179,7 +179,13 @@ sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
     } catch (const sql::SQLException &e) {
         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
     }
-    return 0;
+    throw SQLException(
+        "The column name '" + columnName + "' is not valid.",
+        *this,
+        OUString("42S22"),
+        0,
+        Any()
+    );
 }
 /* }}} */
 
commit 42165189826367937737861116e969a22e9db787
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Wed Sep 11 21:40:41 2013 +0100

    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 at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 6217626..9373481 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -37,6 +37,7 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implementationentry.hxx>
 #include "connectivity/dbexception.hxx"
+#include "resource/common_res.hrc"
 #include "TConnection.hxx"
 
 using namespace connectivity;
@@ -168,13 +169,16 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const OUString& colum
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
             columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))
             )
-            break;
-    /* FIXME: should throw in case of not found ? */
+            return i;
+    }
 
-    return i;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -----------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
index 5dcac1b..c33c1e0 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -446,6 +446,15 @@ void throwFeatureNotImplementedException( const sal_Char* _pAsciiFeatureName, co
     );
 }
 
+void throwInvalidColumnException( const OUString& _rColumnName, const Reference< XInterface >& _rxContext)
+    throw (SQLException)
+{
+    ::connectivity::SharedResources aResources;
+    OUString sErrorMessage( aResources.getResourceStringWithSubstitution(
+                                STR_INVALID_COLUMNNAME,
+                                "$columnname$",_rColumnName) );
+    throwSQLException( sErrorMessage, SQL_COLUMN_NOT_FOUND, _rxContext );
+}
 // -----------------------------------------------------------------------------
 void throwSQLException( const sal_Char* _pAsciiMessage, const sal_Char* _pAsciiState,
         const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode, const Any* _pNextException ) throw (SQLException)
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index 63ffb19..b1b6dfe 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -125,11 +125,15 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const OUString& colum
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
             columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME: should throw in case of not found ? */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 #define BLOCK_SIZE 256
 // -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index 46bcb22..3ae5f78 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -163,11 +163,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
             columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME: should throw in case of not found ? */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 #define BLOCK_SIZE 256
 // -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 78021bf3..414d90c7 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -1122,11 +1122,15 @@ sal_Int32 SAL_CALL OEvoabResultSet::findColumn( const OUString& columnName ) thr
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FXIME ? should trow when not found no? */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 //XColumnLocate interface ends
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 0e71e23..58aa810 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -212,13 +212,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME ? should this check for non found. iow return i instead of break, and exception
-     * if we get out of the for loop
-     */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -----------------------------------------------------------------------------
 const ORowSetValue& OResultSet::getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index cbbd4d5..99051fe 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)
diff --git a/connectivity/source/drivers/kab/KResultSet.cxx b/connectivity/source/drivers/kab/KResultSet.cxx
index 043fce1..e797274 100644
--- a/connectivity/source/drivers/kab/KResultSet.cxx
+++ b/connectivity/source/drivers/kab/KResultSet.cxx
@@ -164,16 +164,9 @@ sal_Int32 SAL_CALL KabResultSet::findColumn(const OUString& columnName) throw(SQ
             columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
                 return i;
 
-    ::connectivity::SharedResources aResources;
-    const OUString sError( aResources.getResourceStringWithSubstitution(
-            STR_INVALID_COLUMNNAME,
-            "$columnname$",columnName
-         ) );
-    ::dbtools::throwGenericSQLException(sError,NULL);
-
-    // Unreachable:
-    OSL_ASSERT(false);
-    return 0;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 OUString SAL_CALL KabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index 7a74374..c9f866e 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -185,20 +185,16 @@ sal_Int32 SAL_CALL MacabResultSet::findColumn(const OUString& columnName) throw(
     sal_Int32 nLen = xMeta->getColumnCount();
 
     for (sal_Int32 i = 1; i <= nLen; ++i)
+    {
         if (xMeta->isCaseSensitive(i) ?
             columnName == xMeta->getColumnName(i) :
             columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
                 return i;
+    }
 
-    ::connectivity::SharedResources aResources;
-    const OUString sError( aResources.getResourceStringWithSubstitution(
-            STR_NO_ELEMENT_NAME,
-            "$name$", columnName
-         ) );
-    ::dbtools::throwGenericSQLException(sError , *this);
-    // Unreachable:
-    OSL_ASSERT(false);
-    return 0;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index c439d05..7561e72 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -177,12 +177,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME should throw in case of not found ? or at least return -1 */
+            return i;
+    }
 
-    return i;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index a26891b..8c947e2 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -176,12 +176,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME should throw in case of not found ? or at least return -1 */
+            return i;
+    }
 
-    return i;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index c7d0ddc..fec93c5 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -157,11 +157,15 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const OUString& colum
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME should throw in case of not found ? or at least return -1 */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 
 template < typename T, SQLSMALLINT sqlTypeId > T ODatabaseMetaDataResultSet::getInteger ( sal_Int32 columnIndex )
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 31fbbb0..2b58a03 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -392,11 +392,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
     sal_Int32 nLen = xMeta->getColumnCount();
     sal_Int32 i = 1;
     for(;i<=nLen;++i)
+    {
         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
-            break;
-    /* FIXME should throw in case of not found ? or at least return -1 */
-    return i;
+            return i;
+    }
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 // -------------------------------------------------------------------------
 void OResultSet::ensureCacheForColumn(sal_Int32 columnIndex)
diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx
index b8e5d39..f27f704 100644
--- a/connectivity/source/drivers/postgresql/pq_resultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx
@@ -37,6 +37,8 @@
 #include "pq_resultset.hxx"
 #include "pq_resultsetmetadata.hxx"
 
+#include <connectivity/dbexception.hxx>
+
 #include <com/sun/star/sdbc/FetchDirection.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
@@ -166,6 +168,11 @@ sal_Int32 ResultSet::findColumn( const OUString& columnName )
     {
         res += 1;
     }
+    else
+    {
+        ::dbtools::throwInvalidColumnException( columnName, *this );
+        assert(false);
+    }
     return res;
 }
 
diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
index 8fc73c46..76baaf0 100644
--- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
@@ -38,7 +38,7 @@
 #include "pq_sequenceresultset.hxx"
 #include "pq_sequenceresultsetmetadata.hxx"
 
-
+#include <connectivity/dbexception.hxx>
 
 using com::sun::star::sdbc::XResultSetMetaData;
 
@@ -113,15 +113,15 @@ sal_Int32 SAL_CALL SequenceResultSet::findColumn(
     throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
 {
     // no need to guard, as all members are readonly !
-    sal_Int32 ret = -1;
     for( int i = 0 ;i < m_fieldCount ; i ++ )
     {
         if( columnName == m_columnNames[i] )
         {
-            ret = i+1;
-            break;
+            return i+1;
         }
     }
-    return ret;
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 }
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index bbed171..ebcc953 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -444,12 +444,8 @@ sal_Int32 SAL_CALL OCollection::findColumn( const OUString& columnName ) throw(S
 {
     if ( !m_pElements->exists(columnName) )
     {
-        ::connectivity::SharedResources aResources;
-        const OUString sError( aResources.getResourceStringWithSubstitution(
-                            STR_UNKNOWN_COLUMN_NAME,
-                            "$columnname$", columnName
-                         ) );
-        ::dbtools::throwGenericSQLException(sError,static_cast< XIndexAccess*>(this));
+        ::dbtools::throwInvalidColumnException( columnName, static_cast< XIndexAccess*>(this) );
+        assert(false);
     }
 
     return m_pElements->findColumn(columnName) + 1; // because columns start at one
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index cb8a74a..befc96c 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include "dbu_brw.hrc"
 #include "dbustrings.hrc"
+#include <connectivity/dbexception.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/sequence.hxx>
 
@@ -231,7 +232,10 @@ sal_Int32 SAL_CALL SbaXFormAdapter::findColumn(const OUString& columnName) throw
     Reference< ::com::sun::star::sdbc::XColumnLocate >  xIface(m_xMainForm, UNO_QUERY);
     if (xIface.is())
         return xIface->findColumn(columnName);
-    return 0;
+
+    ::dbtools::throwInvalidColumnException( columnName, *this );
+    assert(false);
+    return 0; // Never reached
 }
 
 // ::com::sun::star::sdbcx::XColumnsSupplier
diff --git a/include/connectivity/dbexception.hxx b/include/connectivity/dbexception.hxx
index a84450b..c94e12a 100644
--- a/include/connectivity/dbexception.hxx
+++ b/include/connectivity/dbexception.hxx
@@ -308,6 +308,19 @@ OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedException(
     throw (::com::sun::star::sdbc::SQLException);
 
 //----------------------------------------------------------------------------------
+/** throw a SQLException with SQLState 42S22 (Column Not Found)
+    @param _rColumnNameName
+        The column that couldn't be found.
+    @param _rxContext
+        the context of the exception
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwInvalidColumnException(
+        const OUString& _rColumnName,
+        const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+    )
+    throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
 /** throws an SQLException
 */
 OOO_DLLPUBLIC_DBTOOLS void throwSQLException(


More information about the Libreoffice-commits mailing list