[Libreoffice-commits] core.git: 10 commits - connectivity/source

Andrzej J.R. Hunt andrzej at ahunt.org
Thu Jul 25 10:44:07 PDT 2013


 connectivity/source/drivers/firebird/Blob.cxx               |   18 
 connectivity/source/drivers/firebird/FConnection.cxx        |   93 +--
 connectivity/source/drivers/firebird/FConnection.hxx        |    9 
 connectivity/source/drivers/firebird/FDatabaseMetaData.cxx  |    6 
 connectivity/source/drivers/firebird/FPreparedStatement.cxx |   89 +--
 connectivity/source/drivers/firebird/FPreparedStatement.hxx |   40 +
 connectivity/source/drivers/firebird/FResultSet.cxx         |  307 ++++--------
 connectivity/source/drivers/firebird/FResultSet.hxx         |  121 +++-
 connectivity/source/drivers/firebird/FResultSetMetaData.cxx |    5 
 connectivity/source/drivers/firebird/FStatement.cxx         |    6 
 connectivity/source/drivers/firebird/Util.cxx               |   31 +
 connectivity/source/drivers/firebird/Util.hxx               |   11 
 12 files changed, 361 insertions(+), 375 deletions(-)

New commits:
commit f40461a223c5c289aba37daf70b4613af8134409
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 19:33:27 2013 +0200

    Remove unused struct definition (firebird-sdbc).
    
    Change-Id: Idfe8a76c0c14291688f009a1d0b07cd80488f31e

diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
index 64633a2..c2a6a48 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
@@ -61,11 +61,6 @@ using namespace com::sun::star::container;
 using namespace com::sun::star::io;
 using namespace com::sun::star::util;
 
-typedef struct vary {
-    short vary_length;
-    char vary_string[1];
-} VARY;
-
 IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.firebird.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
 
 
commit 89788d34ad79bb5a1fdfcbc2638c2ba12d2e835f
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 19:20:06 2013 +0200

    Disable case insensitivity in findColumn (firebird-sdbc).
    
    In theory it is possible to have case insensitive identifiers
    in firebird however these are only used with unquoted identifiers.
    Base by default always uses quoted identifiers, there doesn't seem
    to be any way of determining whether we are dealing with a case
    insensitive identifier when retrieving it from the database either.
    
    Change-Id: I4df0ab10c5a7c15ecde099e36978ac2e6c4ad0be

diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index f72d528..1fc3daf 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -318,24 +318,25 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep
 
     return concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
 }
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQLException, RuntimeException)
+// ---- XColumnLocate ---------------------------------------------------------
+sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
+    throw(SQLException, RuntimeException)
 {
-
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-    // find the first column with the name columnName
-
     MutexGuard aGuard(m_pConnection->getMutex());
+    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
 
     uno::Reference< XResultSetMetaData > xMeta = getMetaData();
     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)))
+    sal_Int32 i;
+
+    for(i = 1; i<=nLen; ++i)
+    {
+        // We assume case sensitive, otherwise you'd have to test
+        // xMeta->isCaseSensitive and use qualsIgnoreAsciiCase as needed.
+        if (columnName == xMeta->getColumnName(i))
             break;
+    }
+
     return i;
 }
 // -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/firebird/FResultSet.hxx b/connectivity/source/drivers/firebird/FResultSet.hxx
index bae203f..e8e8a5e 100644
--- a/connectivity/source/drivers/firebird/FResultSet.hxx
+++ b/connectivity/source/drivers/firebird/FResultSet.hxx
@@ -296,7 +296,10 @@ namespace connectivity
                       ::com::sun::star::uno::RuntimeException);
 
             // XColumnLocate
-            virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+            virtual sal_Int32 SAL_CALL findColumn(const ::rtl::OUString& columnName)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+
             // XRowLocate
             virtual ::com::sun::star::uno::Any SAL_CALL getBookmark(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
diff --git a/connectivity/source/drivers/firebird/FResultSetMetaData.cxx b/connectivity/source/drivers/firebird/FResultSetMetaData.cxx
index 578a081..e4dfcce 100644
--- a/connectivity/source/drivers/firebird/FResultSetMetaData.cxx
+++ b/connectivity/source/drivers/firebird/FResultSetMetaData.cxx
@@ -81,6 +81,11 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnType(sal_Int32 column)
 sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive(sal_Int32 column)
     throw(SQLException, RuntimeException)
 {
+    // Firebird is generally case sensitive when using quoted identifiers.
+    // IF THIS CHANGES make ResultSet::findColumn to be case-insenstive as needed.
+    // Generally names that are entirely UPPERCASE are case insensitive, however
+    // there remains some ambiguity if there is another mixed-case-named column
+    // of the same name. For safety always assume case insensitive.
     (void) column;
     return sal_False;
 }
commit de0384045c20453a5468715cc364c31f14b2ae3e
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 18:38:43 2013 +0200

    Cleanup XResultSetUpdate in ResultSet / throw exceptions (firebird-sdbc).
    
    Change-Id: Ifc5437f10421ba00c16caa860f9737444a81d891

diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index 82619aa..f72d528 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -688,171 +688,154 @@ void SAL_CALL OResultSet::moveToCurrentRow() throw(SQLException, RuntimeExceptio
 {
     throwFunctionNotSupportedException("XResultSetUpdate::moveToCurrentRow", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
+// ---- XRowUpdate - UNSUPPORTED ---------------------------------------------
+void SAL_CALL OResultSet::updateNull(sal_Int32 columnIndex)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+    throwFunctionNotSupportedException("XRowUpdate::updateNull", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateBoolean(sal_Int32 columnIndex, sal_Bool x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateBoolean", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateByte(sal_Int32 columnIndex, sal_Int8 x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-    MutexGuard aGuard(m_pConnection->getMutex());
-
+    throwFunctionNotSupportedException("XRowUpdate::updateByte", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateShort(sal_Int32 columnIndex, sal_Int16 x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateShort", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateInt(sal_Int32 columnIndex, sal_Int32 x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-    MutexGuard aGuard(m_pConnection->getMutex());
-
+    throwFunctionNotSupportedException("XRowUpdate::updateInt", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateLong(sal_Int32 columnIndex, sal_Int64 x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateLong", *this);
 }
-// -----------------------------------------------------------------------
-void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateFloat(sal_Int32 columnIndex, float x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateFloat", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateDouble(sal_Int32 columnIndex, double x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateDouble", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const OUString& x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateString(sal_Int32 columnIndex, const OUString& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateString", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateBytes(sal_Int32 columnIndex, const Sequence< sal_Int8 >& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateBytes", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateDate(sal_Int32 columnIndex, const Date& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateDate", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateTime(sal_Int32 columnIndex, const Time& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateTime", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateTimestamp(sal_Int32 columnIndex, const DateTime& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateTimeStamp", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const uno::Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 columnIndex,
+                                             const uno::Reference< XInputStream >& x,
+                                             sal_Int32 length)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
     (void) length;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateBinaryStream", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const uno::Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
+
+void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 columnIndex,
+                                                const uno::Reference< XInputStream >& x,
+                                                sal_Int32 length)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
     (void) length;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateCharacterStream", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow(  ) throw(SQLException, RuntimeException)
-{
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
 
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateObject(sal_Int32 columnIndex, const Any& x)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XRowUpdate::updateObject", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateNumericObject(sal_Int32 columnIndex,
+                                              const Any& x,
+                                              sal_Int32 scale)
+    throw(SQLException, RuntimeException)
 {
     (void) columnIndex;
     (void) x;
     (void) scale;
+    throwFunctionNotSupportedException("XRowUpdate::updateNumericObject", *this);
+}
+// -------------------------------------------------------------------------
+void SAL_CALL OResultSet::refreshRow(  ) throw(SQLException, RuntimeException)
+{
     MutexGuard aGuard(m_pConnection->getMutex());
     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
 
diff --git a/connectivity/source/drivers/firebird/FResultSet.hxx b/connectivity/source/drivers/firebird/FResultSet.hxx
index bbbd9be..bae203f 100644
--- a/connectivity/source/drivers/firebird/FResultSet.hxx
+++ b/connectivity/source/drivers/firebird/FResultSet.hxx
@@ -225,24 +225,76 @@ namespace connectivity
                 throw(::com::sun::star::sdbc::SQLException,
                       ::com::sun::star::uno::RuntimeException);
 
-            // XRowUpdate
-            virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+            // XRowUpdate - UNSUPPORTED
+            virtual void SAL_CALL updateNull(sal_Int32 columnIndex)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex,
+                                                sal_Bool x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateByte(sal_Int32 columnIndex,
+                                             sal_Int8 x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateShort(sal_Int32 columnIndex,
+                                              sal_Int16 x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateInt(sal_Int32 columnIndex,
+                                            sal_Int32 x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateLong(sal_Int32 columnIndex,
+                                             sal_Int64 x )
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateFloat(sal_Int32 columnIndex,
+                                              float x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateDouble(sal_Int32 columnIndex,
+                                               double x )
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateString(sal_Int32 columnIndex,
+                                               const ::rtl::OUString& x )
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateBytes(sal_Int32 columnIndex,
+                                              const ::com::sun::star::uno::Sequence< sal_Int8 >& x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateDate(sal_Int32 columnIndex,
+                                             const ::com::sun::star::util::Date& x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateTime(sal_Int32 columnIndex,
+                                             const ::com::sun::star::util::Time& x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex,
+                                                  const ::com::sun::star::util::DateTime& x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex,
+                                                     const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,
+                                                     sal_Int32 length)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex,
+                                                        const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,
+                                                        sal_Int32 length)
+                throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x)
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex,
+                                                      const ::com::sun::star::uno::Any& x,
+                                                      sal_Int32 scale )
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+
             // XColumnLocate
             virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             // XRowLocate
commit d011153df470bc7bec621fc8de3ef98ad5cd41f6
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 18:22:55 2013 +0200

    FunctionNotSupported exceptions for XResultSetUpdate. (firebird-sdbc)
    
    Change-Id: Ie24ba7eeb8d638433fe6b27d74d70121472347c5

diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index 4e0fb53..82619aa 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -40,6 +40,7 @@
 #include <propertyids.hxx>
 #include <TConnection.hxx>
 
+#include <connectivity/dbexception.hxx>
 #include <comphelper/sequence.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <rtl/string.hxx>
@@ -54,6 +55,7 @@ using namespace ::comphelper;
 using namespace ::connectivity;
 using namespace ::connectivity::firebird;
 using namespace ::cppu;
+using namespace ::dbtools;
 using namespace ::osl;
 using namespace ::rtl;
 
@@ -656,52 +658,35 @@ Any SAL_CALL OResultSet::getWarnings(  ) throw(SQLException, RuntimeException)
 {
     return Any();
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::insertRow(  ) throw(SQLException, RuntimeException)
+// ---- XResultSetUpdate - UNSUPPORTED ---------------------------------------
+void SAL_CALL OResultSet::insertRow() throw(SQLException, RuntimeException)
 {
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-    // you only have to implement this if you want to insert new rows
+    throwFunctionNotSupportedException("XResultSetUpdate::insertRow", *this);
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateRow(  ) throw(SQLException, RuntimeException)
-{
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
 
-    // only when you allow updates
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::deleteRow(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::updateRow() throw(SQLException, RuntimeException)
 {
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+    throwFunctionNotSupportedException("XResultSetUpdate::updateRow", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::cancelRowUpdates(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException)
 {
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+    throwFunctionNotSupportedException("XResultSetUpdate::deleteRow", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::moveToInsertRow(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
 {
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+    throwFunctionNotSupportedException("XResultSetUpdate::cancelRowUpdates", *this);
+}
 
-    // only when you allow insert's
+void SAL_CALL OResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
+{
+    throwFunctionNotSupportedException("XResultSetUpdate::moveToInsertRow", *this);
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OResultSet::moveToCurrentRow(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
 {
-    MutexGuard aGuard(m_pConnection->getMutex());
-    checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+    throwFunctionNotSupportedException("XResultSetUpdate::moveToCurrentRow", *this);
 }
 // -------------------------------------------------------------------------
 
diff --git a/connectivity/source/drivers/firebird/FResultSet.hxx b/connectivity/source/drivers/firebird/FResultSet.hxx
index 894eaff..bbbd9be 100644
--- a/connectivity/source/drivers/firebird/FResultSet.hxx
+++ b/connectivity/source/drivers/firebird/FResultSet.hxx
@@ -204,13 +204,27 @@ namespace connectivity
             // XWarningsSupplier
             virtual ::com::sun::star::uno::Any SAL_CALL getWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL clearWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            // XResultSetUpdate
-            virtual void SAL_CALL insertRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL updateRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL deleteRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL cancelRowUpdates(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL moveToInsertRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL moveToCurrentRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+            // XResultSetUpdate - UNSUPPORTED
+            virtual void SAL_CALL insertRow()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL updateRow()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL deleteRow()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL cancelRowUpdates()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL moveToInsertRow()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL moveToCurrentRow()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+
             // XRowUpdate
             virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
commit 5d1245b89c18691eb80b3037cc816a422bb39316
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 17:55:04 2013 +0200

    Implement the remaining execute* in PreparedStatement (firebird-sdbc)
    
    Change-Id: I7df7e926c352f5d0ddf7acb4df9b4060a634140d

diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
index ea23116..64633a2 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
@@ -211,26 +211,6 @@ void SAL_CALL OPreparedStatement::close() throw(SQLException, RuntimeException)
     OStatementCommonBase::close();
 }
 
-sal_Bool SAL_CALL OPreparedStatement::execute()
-    throw(SQLException, RuntimeException)
-{
-    MutexGuard aGuard( m_pConnection->getMutex() );
-    checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
-    // TODO: implement
-    return sal_False;
-}
-
-sal_Int32 SAL_CALL OPreparedStatement::executeUpdate()
-    throw(SQLException, RuntimeException)
-{
-    MutexGuard aGuard( m_pConnection->getMutex() );
-    checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
-    // TODO: implement
-    return 0;
-}
-
 void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
                                             const OUString& x)
     throw(SQLException, RuntimeException)
@@ -281,11 +261,11 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection()
     return Reference< XConnection >(m_pConnection);
 }
 
-Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery()
+sal_Bool SAL_CALL OPreparedStatement::execute()
     throw(SQLException, RuntimeException)
 {
     SAL_INFO("connectivity.firebird", "executeQuery(). "
-             "Got called with sql: " <<  m_sSqlStatement);
+        "Got called with sql: " <<  m_sSqlStatement);
 
     MutexGuard aGuard( m_pConnection->getMutex() );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
@@ -304,6 +284,29 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery()
         evaluateStatusVector(m_statusVector, "isc_dsql_execute", *this);
     }
 
+    // TODO: check we actually got results -- ?
+
+    return sal_True;
+    // TODO: implement handling of multiple ResultSets.
+}
+
+sal_Int32 SAL_CALL OPreparedStatement::executeUpdate()
+    throw(SQLException, RuntimeException)
+{
+    execute();
+    // TODO: get the number of rows changed -- look in Statement::executeUpdate for details
+    return 0;
+}
+
+Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery()
+    throw(SQLException, RuntimeException)
+{
+    if (!execute())
+    {
+        // execute succeeded but no results
+        throw SQLException(); // TODO: add message to exception
+    }
+
     uno::Reference< OResultSet > pResult(new OResultSet(m_pConnection,
                                                         uno::Reference< XInterface >(*this),
                                                         m_statementHandle,
diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.hxx b/connectivity/source/drivers/firebird/FPreparedStatement.hxx
index af7b0db..ab0d165 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.hxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.hxx
@@ -114,10 +114,23 @@ namespace connectivity
             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
 
             // XPreparedStatement
-            virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual sal_Int32 SAL_CALL executeUpdate(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual sal_Bool SAL_CALL execute(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+            virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL
+                executeQuery()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual sal_Int32 SAL_CALL
+                executeUpdate()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual sal_Bool SAL_CALL
+                execute()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL
+                getConnection()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+
             // XParameters
             virtual void SAL_CALL setNull( sal_Int32 nParameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
commit 79002d6f35da061d4ba8aed2f7fd57efe6aa1aa1
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 17:21:43 2013 +0200

    Comment and cleanup unsupported batch methods (firebird-sdbc)
    
    Change-Id: I553265a0f492e8c5c258cf94aead2019ff1f9350

diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
index 5857fc4..ebaa31e 100644
--- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
@@ -794,13 +794,15 @@ sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 setType ) thr
     return sal_False;
 }
 
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates() throw(SQLException, RuntimeException)
+sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates()
+    throw(SQLException, RuntimeException)
 {
     // No batch support in firebird
     return sal_False;
 }
 
-uno::Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection() throw(SQLException, RuntimeException)
+uno::Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection()
+    throw(SQLException, RuntimeException)
 {
     return (uno::Reference< XConnection >) m_pConnection;
 }
diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
index 72dd116..ea23116 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
@@ -535,20 +535,25 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con
 void SAL_CALL OPreparedStatement::clearParameters(  ) throw(SQLException, RuntimeException)
 {
 }
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::clearBatch(  ) throw(SQLException, RuntimeException)
+
+// ---- Batch methods -- unsupported -----------------------------------------
+void SAL_CALL OPreparedStatement::clearBatch()
+    throw(SQLException, RuntimeException)
 {
+    // Unsupported
 }
-// -------------------------------------------------------------------------
 
-void SAL_CALL OPreparedStatement::addBatch( ) throw(SQLException, RuntimeException)
+void SAL_CALL OPreparedStatement::addBatch()
+    throw(SQLException, RuntimeException)
 {
+    // Unsupported by firebird
 }
-// -------------------------------------------------------------------------
 
-Sequence< sal_Int32 > SAL_CALL OPreparedStatement::executeBatch(  ) throw(SQLException, RuntimeException)
+Sequence< sal_Int32 > SAL_CALL OPreparedStatement::executeBatch()
+    throw(SQLException, RuntimeException)
 {
-    return Sequence< sal_Int32 > ();
+    // Unsupported by firebird
+    return Sequence< sal_Int32 >();
 }
 // -------------------------------------------------------------------------
 void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.hxx b/connectivity/source/drivers/firebird/FPreparedStatement.hxx
index d43fbe3..af7b0db 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.hxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.hxx
@@ -142,10 +142,21 @@ namespace connectivity
             virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL clearParameters(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            // XPreparedBatchExecution
-            virtual void SAL_CALL addBatch(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual void SAL_CALL clearBatch(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+            // XPreparedBatchExecution -- UNSUPPORTED by firebird
+            virtual void SAL_CALL
+                addBatch()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual void SAL_CALL
+                clearBatch()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+            virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
+                executeBatch()
+                throw(::com::sun::star::sdbc::SQLException,
+                      ::com::sun::star::uno::RuntimeException);
+
             // XCloseable
             virtual void SAL_CALL close(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             // XResultSetMetaDataSupplier
commit 63985cd35e8d58f578517fec932666accfe7224f
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 17:12:05 2013 +0200

    Implement getMetaData in PreparedStatement (firebird-sdbc).
    
    Change-Id: I61450c2617f53ad9de13f667fa01d7a7dde31f85

diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
index 89c5ef4..72dd116 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
@@ -188,11 +188,11 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData()
 {
     ::osl::MutexGuard aGuard( m_pConnection->getMutex() );
     checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+    ensurePrepared();
+
+    if(!m_xMetaData.is())
+        m_xMetaData = new OResultSetMetaData(m_pConnection, m_pOutSqlda);
 
-    // TODO: implement
-//     if(!m_xMetaData.is())
-//         m_xMetaData = new OResultSetMetaData(m_pConnection, m_pSqlda);
-    // TODO: uncomment once PreparedStatement reimplemented with SQLDA
     return m_xMetaData;
 }
 
@@ -247,7 +247,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
 
     OString str = OUStringToOString(x , RTL_TEXTENCODING_UTF8 );
 
-    XSQLVAR* pVar = m_pOutSqlda->sqlvar + (nParameterIndex - 1);
+    XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
 
     int dtype = (pVar->sqltype & ~1); // drop flag bit for now
     switch (dtype) {
commit 61d4e320301f658eabc918c8b7b731e1890f4531
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 16:30:32 2013 +0200

    Make evaluateStatusVector a namespace function. (firebird-sdbc)
    
    We're not in java after all...
    
    Change-Id: I145fbd7adad5e03a7c9e7bcf28cb2f80ce40ba9e

diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index 12b2622..8423b28 100644
--- a/connectivity/source/drivers/firebird/Blob.cxx
+++ b/connectivity/source/drivers/firebird/Blob.cxx
@@ -9,6 +9,7 @@
 
 #include "Blob.hxx"
 #include "FConnection.hxx"
+#include "Util.hxx"
 
 #include "connectivity/dbexception.hxx"
 
@@ -52,9 +53,7 @@ void Blob::ensureBlobIsOpened()
                           0,
                           NULL);
     if (aErr)
-        OConnection::evaluateStatusVector(m_statusVector,
-                                          "isc_open_blob2",
-                                          *this);
+        evaluateStatusVector(m_statusVector, "isc_open_blob2", *this);
 
 }
 
@@ -71,9 +70,7 @@ void SAL_CALL Blob::disposing(void)
         {
             try
             {
-                OConnection::evaluateStatusVector(m_statusVector,
-                                                  "isc_close_blob",
-                                                  *this);
+                evaluateStatusVector(m_statusVector, "isc_close_blob", *this);
             }
             catch (SQLException e)
             {
@@ -105,9 +102,8 @@ sal_Int64 SAL_CALL Blob::length()
                   aBlobItems,
                   sizeof(aResultBuffer),
                   aResultBuffer);
-    OConnection::evaluateStatusVector(m_statusVector,
-                                      "isc_blob_info",
-                                      *this);
+
+    evaluateStatusVector(m_statusVector, "isc_blob_info", *this);
     if (*aResultBuffer == isc_info_blob_total_length)
     {
         short aResultLength = (short) isc_vax_integer(aResultBuffer, 2);
@@ -152,9 +148,7 @@ uno::Sequence< sal_Int8 > SAL_CALL  Blob::getBytes(sal_Int64 aPosition, sal_Int3
         if (aErr)
         {
             m_blobData = uno::Sequence< sal_Int8 >(0);
-            OConnection::evaluateStatusVector(m_statusVector,
-                                              "isc_get_segment",
-                                              *this);
+            evaluateStatusVector(m_statusVector, "isc_get_segment", *this);
         }
     }
 
diff --git a/connectivity/source/drivers/firebird/FConnection.cxx b/connectivity/source/drivers/firebird/FConnection.cxx
index d33f9fa..12003b2 100644
--- a/connectivity/source/drivers/firebird/FConnection.cxx
+++ b/connectivity/source/drivers/firebird/FConnection.cxx
@@ -34,11 +34,12 @@
  *************************************************************************/
 
 #include "FConnection.hxx"
-
 #include "FDatabaseMetaData.hxx"
 #include "FDriver.hxx"
-#include "FStatement.hxx"
 #include "FPreparedStatement.hxx"
+#include "FStatement.hxx"
+#include "Util.hxx"
+
 
 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
@@ -261,9 +262,7 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property
                                    0);
         if (aErr)
         {
-            evaluateStatusVector(status,
-                                 "isc_create_database",
-                                 *this);
+            evaluateStatusVector(status, "isc_create_database", *this);
         }
     }
     else
@@ -276,9 +275,7 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property
                                    dpbBuffer);
         if (aErr)
         {
-            evaluateStatusVector(status,
-                                 "isc_attach_database",
-                                 *this);
+            evaluateStatusVector(status, "isc_attach_database", *this);
         }
     }
 
@@ -731,9 +728,7 @@ void OConnection::disposing()
 
     if (isc_detach_database(status, &m_DBHandler))
     {
-        evaluateStatusVector(status,
-                             "isc_detach_database",
-                             *this);
+        evaluateStatusVector(status, "isc_detach_database", *this);
     }
     // TODO: write to storage again?
     if (m_bIsEmbedded)
@@ -749,31 +744,4 @@ void OConnection::disposing()
     cppu::WeakComponentImplHelperBase::disposing();
 }
 
-void SAL_CALL OConnection::evaluateStatusVector( ISC_STATUS_ARRAY& aStatusVector,
-                                                 const OUString& aCause,
-                                                 const uno::Reference< XInterface >& _rxContext)
-    throw(SQLException)
-{
-    if (aStatusVector[0]==1 && aStatusVector[1]) // indicates error
-    {
-        OUStringBuffer buf;
-        char msg[512]; // Size is based on suggestion in docs.
-        const ISC_STATUS* pStatus = (const ISC_STATUS*) &aStatusVector;
-
-        buf.appendAscii("firebird_sdbc error:");
-        while(fb_interpret(msg, sizeof(msg), &pStatus))
-        {
-            // TODO: verify encoding
-            buf.appendAscii("\n*");
-            buf.append(OUString(msg, strlen(msg), RTL_TEXTENCODING_UTF8));
-        }
-        buf.appendAscii("\ncaused by\n'").append(aCause).appendAscii("'\n");
-
-        OUString error = buf.makeStringAndClear();
-        SAL_WARN( "connectivity.firebird", error );
-
-        throw SQLException( error, _rxContext, OUString(), 1, Any() );
-    }
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/FConnection.hxx b/connectivity/source/drivers/firebird/FConnection.hxx
index ff8ee91f..8e15923 100644
--- a/connectivity/source/drivers/firebird/FConnection.hxx
+++ b/connectivity/source/drivers/firebird/FConnection.hxx
@@ -191,15 +191,6 @@ namespace connectivity
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>
                 createBlob(ISC_QUAD* pBlobID)
                 throw(::com::sun::star::sdbc::SQLException);
-
-            /**
-             * Evaluate a firebird status vector and throw exceptions as necessary.
-             * The content of the status vector is included in the thrown exception.
-             */
-            static void evaluateStatusVector( ISC_STATUS_ARRAY& aStatusVector,
-                                       const ::rtl::OUString& aCause,
-                                       const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext)
-                throw (::com::sun::star::sdbc::SQLException);
         };
     }
 }
diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
index acda520..89c5ef4 100644
--- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx
@@ -150,9 +150,7 @@ void OPreparedStatement::ensurePrepared()
 //         }
 //     }
     mallocSQLVAR(m_pInSqlda);
-    OConnection::evaluateStatusVector(m_statusVector,
-                                      m_sSqlStatement,
-                                      *this);
+    evaluateStatusVector(m_statusVector, m_sSqlStatement, *this);
 }
 
 OPreparedStatement::~OPreparedStatement()
@@ -303,9 +301,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery()
     if (aErr)
     {
         SAL_WARN("connectivity.firebird", "isc_dsql_execute failed" );
-        OConnection::evaluateStatusVector(m_statusVector,
-                                          "isc_dsql_execute",
-                                          *this);
+        evaluateStatusVector(m_statusVector, "isc_dsql_execute", *this);
     }
 
     uno::Reference< OResultSet > pResult(new OResultSet(m_pConnection,
diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index 082feae..4e0fb53 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -35,6 +35,8 @@
 
 #include "FResultSet.hxx"
 #include "FResultSetMetaData.hxx"
+#include "Util.hxx"
+
 #include <propertyids.hxx>
 #include <TConnection.hxx>
 
@@ -125,9 +127,7 @@ sal_Bool SAL_CALL OResultSet::next() throw(SQLException, RuntimeException)
     {
         SAL_WARN("connectivity.firebird", "Error when populating data");
         // Throws sql exception as appropriate
-        OConnection::evaluateStatusVector(m_statusVector,
-                                          "isc_dsql_fetch",
-                                          *this);
+        evaluateStatusVector(m_statusVector, "isc_dsql_fetch", *this);
         return sal_False;
     }
 }
@@ -286,9 +286,7 @@ void OResultSet::disposing(void)
                                 &m_statementHandle,
                                 DSQL_drop);
         try {
-            OConnection::evaluateStatusVector(m_statusVector,
-                                              "isc_dsql_free_statement",
-                                              *this);
+            evaluateStatusVector(m_statusVector, "isc_dsql_free_statement", *this);
         }
         catch (SQLException e)
         {
diff --git a/connectivity/source/drivers/firebird/FStatement.cxx b/connectivity/source/drivers/firebird/FStatement.cxx
index 907e57c..29dea7a 100644
--- a/connectivity/source/drivers/firebird/FStatement.cxx
+++ b/connectivity/source/drivers/firebird/FStatement.cxx
@@ -113,7 +113,7 @@ sal_Int32 SAL_CALL OStatement::executeUpdate(const OUString& sql)
     if (aErr)
         SAL_WARN("connectivity.firebird", "isc_dsql_execute_immediate failed" );
 
-    m_pConnection->evaluateStatusVector(m_statusVector, sql, *this);
+    evaluateStatusVector(m_statusVector, sql, *this);
     // TODO: get number of changed rows with SELECT ROW_COUNT (use executeQuery)
     //     return getUpdateCount();
     return 0;
@@ -158,7 +158,7 @@ uno::Reference< XResultSet > SAL_CALL OStatement::executeQuery(const OUString& s
 
     // TODO: deal with cleanup
 //    close();
-    m_pConnection->evaluateStatusVector(m_statusVector, sql, *this);
+    evaluateStatusVector(m_statusVector, sql, *this);
     return m_xResultSet;
 }
 
@@ -194,7 +194,7 @@ sal_Bool SAL_CALL OStatement::execute(const OUString& sql)
             SAL_WARN("connectivity.firebird", "isc_dsql_execute failed" );
     }
 
-    m_pConnection->evaluateStatusVector(m_statusVector, sql, *this);
+    evaluateStatusVector(m_statusVector, sql, *this);
 
     // returns true when a resultset is available
     return sal_False;
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index bc77775..f8259de 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -9,11 +9,42 @@
 
 #include "Util.hxx"
 
+#include <rtl/ustrbuf.hxx>
+
 using namespace ::connectivity;
 
 using namespace ::rtl;
 
+using namespace ::com::sun::star;
 using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::uno;
+
+void firebird::evaluateStatusVector(ISC_STATUS_ARRAY& aStatusVector,
+                                    const OUString& aCause,
+                                    const uno::Reference< XInterface >& _rxContext)
+    throw(SQLException)
+{
+    if (aStatusVector[0]==1 && aStatusVector[1]) // indicates error
+    {
+        OUStringBuffer buf;
+        char msg[512]; // Size is based on suggestion in docs.
+        const ISC_STATUS* pStatus = (const ISC_STATUS*) &aStatusVector;
+
+        buf.appendAscii("firebird_sdbc error:");
+        while(fb_interpret(msg, sizeof(msg), &pStatus))
+        {
+            // TODO: verify encoding
+            buf.appendAscii("\n*");
+            buf.append(OUString(msg, strlen(msg), RTL_TEXTENCODING_UTF8));
+        }
+        buf.appendAscii("\ncaused by\n'").append(aCause).appendAscii("'\n");
+
+        OUString error = buf.makeStringAndClear();
+        SAL_WARN("connectivity.firebird", error);
+
+        throw SQLException( error, _rxContext, OUString(), 1, Any() );
+    }
+}
 
 sal_Int32 firebird::getColumnTypeFromFBType(short aType)
 {
diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx
index f3039db..664a17d 100644
--- a/connectivity/source/drivers/firebird/Util.hxx
+++ b/connectivity/source/drivers/firebird/Util.hxx
@@ -15,11 +15,22 @@
 #include <rtl/ustring.hxx>
 
 #include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/sdbc/SQLException.hpp>
 
 namespace connectivity
 {
     namespace firebird
     {
+
+        /**
+         * Evaluate a firebird status vector and throw exceptions as necessary.
+         * The content of the status vector is included in the thrown exception.
+         */
+        void evaluateStatusVector(ISC_STATUS_ARRAY& aStatusVector,
+                                  const ::rtl::OUString& aCause,
+                                  const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext)
+                throw (::com::sun::star::sdbc::SQLException);
+
         sal_Int32 getColumnTypeFromFBType(short aType);
         ::rtl::OUString getColumnTypeNameFromFBType(short aType);
 
commit 5249927d9e5f08fb6ac2f99710f4d99bbc366dd1
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 16:18:50 2013 +0200

    Remove old unneeded commented code. (firebird-sdbc)
    
    Change-Id: I82013ac933b3a30093593e32fd202de351a96599

diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index 2b05342..082feae 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -92,34 +92,6 @@ OResultSet::~OResultSet()
 {
 }
 
-// void OResultSet::ensureDataAvailable() throw (SQLException)
-// {
-//     MutexGuard aGuard(m_pConnection->getMutex());
-//     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-//
-//     if (!m_bIsPopulated)
-//     {
-//
-//         ISC_STATUS aErr = isc_dsql_free_statement(m_statusVector,
-//                                                   &m_statementHandle,
-//                                                   DSQL_drop);
-//         // TODO: cleanup the XSQLDA, probably in the destructor?
-//
-//         // fetchstat == 100L if fetching of data completed successfully.
-//         if ((fetchStat != 100L) || aErr)
-//         {
-//             SAL_WARN("connectivity.firebird", "Error when populating data");
-//             OConnection::evaluateStatusVector(m_statusVector,
-//                                               "isc_dsql_free_statement",
-//                                               *this);
-//         }
-//
-//         SAL_INFO("connectivity.firebird", "Populated dataset with " << m_rowCount << " rows.");
-//         m_bIsPopulated = true;
-//     }
-// }
-
-
 // ---- XResultSet -- Row retrieval methods ------------------------------------
 sal_Int32 SAL_CALL OResultSet::getRow() throw(SQLException, RuntimeException)
 {
@@ -158,44 +130,6 @@ sal_Bool SAL_CALL OResultSet::next() throw(SQLException, RuntimeException)
                                           *this);
         return sal_False;
     }
-
-            //         {
-//             m_rowCount++;
-//
-//             TRow aRow(m_fieldCount);
-//             m_sqlData.push_back(aRow);
-//             TRow& rRow = m_sqlData.back();
-//
-//             XSQLVAR* pVar = m_pSqlda->sqlvar;
-//             for (int i = 0; i < m_fieldCount; pVar++, i++)
-//             {
-//                 if ((pVar->sqltype & 1) == 0) // Means: Cannot contain NULL
-//                 {
-//                     // TODO: test for null here and set as appropriate
-//                 }
-//                 else // Means: Can contain NULL
-//                 {
-//                     // otherwise we need to test for SQL_TYPE and SQL_TYPE+1 below
-//                     pVar->sqltype--;
-//                 }
-//                 switch (pVar->sqltype)
-//                 {
-//                     case SQL_SHORT:
-//                         rRow[i] = (sal_Int16) *pVar->sqldata;
-//                         break;
-//                     case SQL_LONG:
-//                         rRow[i] = (sal_Int32) *pVar->sqldata;
-//                         break;
-//                     case SQL_INT64:
-//                         rRow[i] = (sal_Int64) *pVar->sqldata;
-//                         break;
-//                     // TODO: remember sqlscale for decimal types
-//                     default:
-//                         rRow[i] = OUString(pVar->sqldata, pVar->sqllen, RTL_TEXTENCODING_UTF8);
-//                         break;
-//                 }
-//             }
-//         }
 }
 
 sal_Bool SAL_CALL OResultSet::previous() throw(SQLException, RuntimeException)
commit b17392f85d143c44d109702ebfd8802533b4e682
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Jul 25 16:18:18 2013 +0200

    Upgrade the last bit of pr_error to use exceptions. (firebird-sdbc)
    
    Change-Id: I066cd519158c6d28ed410e4f62d9418dcf95a6c3

diff --git a/connectivity/source/drivers/firebird/FConnection.cxx b/connectivity/source/drivers/firebird/FConnection.cxx
index 6407dad..d33f9fa 100644
--- a/connectivity/source/drivers/firebird/FConnection.cxx
+++ b/connectivity/source/drivers/firebird/FConnection.cxx
@@ -122,24 +122,6 @@ void SAL_CALL OConnection::release() throw()
 {
     relase_ChildImpl();
 }
-// -----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-/*    Print the status, the SQLCODE, and exit.
- *    Also, indicate which operation the error occured on.
- */
-static int pr_error(const ISC_STATUS* status, const char* operation)
-{
-    SAL_WARN("connectivity.firebird", "=> OConnection static pr_error().");
-
-    isc_print_status(status);
-
-    SAL_WARN("connectivity.firebird", "=> OConnection static pr_error(). "
-             "PROBLEM ON " << operation << ". "
-             "SQLCODE: " << isc_sqlcode(status) << ".");
-
-    return 1;
-}
 
 void OConnection::construct(const ::rtl::OUString& url, const Sequence< PropertyValue >& info)
     throw(SQLException)
@@ -267,31 +249,37 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property
     }
 
     ISC_STATUS_ARRAY status;            /* status vector */
-
+    ISC_STATUS aErr;
     if (bIsNewDatabase)
     {
-        if (isc_create_database(status,
-                                m_sURL.getLength(),
-                                OUStringToOString(m_sURL,RTL_TEXTENCODING_UTF8).getStr(),
-                                &m_DBHandler,
-                                dpbLength,
-                                dpbBuffer,
-                                0))
+        aErr = isc_create_database(status,
+                                   m_sURL.getLength(),
+                                   OUStringToOString(m_sURL,RTL_TEXTENCODING_UTF8).getStr(),
+                                   &m_DBHandler,
+                                   dpbLength,
+                                   dpbBuffer,
+                                   0);
+        if (aErr)
         {
-            if(pr_error(status, "create new database"))
-                return;
+            evaluateStatusVector(status,
+                                 "isc_create_database",
+                                 *this);
         }
     }
     else
     {
-        if (isc_attach_database(status,
-                                m_sURL.getLength(),
-                                OUStringToOString(m_sURL, RTL_TEXTENCODING_UTF8).getStr(),
-                                &m_DBHandler,
-                                dpbLength,
-                                dpbBuffer))
-            if (pr_error(status, "attach database"))
-                return;
+        aErr = isc_attach_database(status,
+                                   m_sURL.getLength(),
+                                   OUStringToOString(m_sURL, RTL_TEXTENCODING_UTF8).getStr(),
+                                   &m_DBHandler,
+                                   dpbLength,
+                                   dpbBuffer);
+        if (aErr)
+        {
+            evaluateStatusVector(status,
+                                 "isc_attach_database",
+                                 *this);
+        }
     }
 
     if (m_bIsEmbedded) // Add DocumentEventListener to save the .fdb as needed
@@ -742,8 +730,11 @@ void OConnection::disposing()
     }
 
     if (isc_detach_database(status, &m_DBHandler))
-        if (pr_error(status, "dattach database"))
-            return;
+    {
+        evaluateStatusVector(status,
+                             "isc_detach_database",
+                             *this);
+    }
     // TODO: write to storage again?
     if (m_bIsEmbedded)
     {


More information about the Libreoffice-commits mailing list