summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-07-19 12:16:01 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-07-19 15:23:21 +0200
commitc277e307692af4b1aa33d1e3d358a60f62230ff8 (patch)
tree07c70b64cd33f5e17001958de8a77dd46cb34c50 /connectivity
parent6f0a454c0405cb1593aa97a0df7971d520a61e90 (diff)
Implement String retrieval (firebird-sdbc).
Change-Id: I85ed3a0c7cd473d89a48f4b35a94f3ca5fd72a11
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/FResultSet.cxx24
-rw-r--r--connectivity/source/drivers/firebird/FResultSet.hxx9
2 files changed, 14 insertions, 19 deletions
diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx
index 60fac62e56ce..f2f0a787143d 100644
--- a/connectivity/source/drivers/firebird/FResultSet.cxx
+++ b/connectivity/source/drivers/firebird/FResultSet.cxx
@@ -431,16 +431,16 @@ T OResultSet::retrieveValue(sal_Int32 columnIndex)
return *m_pSqlda->sqlvar[columnIndex-1].sqldata;
}
-// template <>
-// OUString OResultSet::retrieveValue< OUString >(sal_Int32 columnIndex)
-// {
-// if ((m_bWasNull = isNull(columnIndex)))
-// return "";
-//
-// return OUString(m_pSqlda->pVar[columnIndex-1].sqldata,
-// m_pSqlda->pVar[columnIndex-1].sqllen,
-// RTL_TEXTENCODING_UTF8)
-// }
+template <>
+OUString OResultSet::retrieveValue<OUString>(sal_Int32 columnIndex)
+{
+ if ((m_bWasNull = isNull(columnIndex)))
+ return OUString();
+
+ return OUString(m_pSqlda->sqlvar[columnIndex-1].sqldata,
+ m_pSqlda->sqlvar[columnIndex-1].sqllen,
+ RTL_TEXTENCODING_UTF8);
+}
template <typename T>
T OResultSet::safelyRetrieveValue(sal_Int32 columnIndex)
@@ -514,9 +514,7 @@ double SAL_CALL OResultSet::getDouble(sal_Int32 columnIndex)
OUString SAL_CALL OResultSet::getString(sal_Int32 columnIndex)
throw(SQLException, RuntimeException)
{
- (void) columnIndex;
- return OUString();
-// return safelyRetrieveValue< OUString >(columnIndex);
+ return safelyRetrieveValue< OUString >(columnIndex);
}
Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/firebird/FResultSet.hxx b/connectivity/source/drivers/firebird/FResultSet.hxx
index 88e02e2d4526..d83be38eb8a1 100644
--- a/connectivity/source/drivers/firebird/FResultSet.hxx
+++ b/connectivity/source/drivers/firebird/FResultSet.hxx
@@ -98,14 +98,8 @@ namespace connectivity
const sal_Int32 m_fieldCount;
ISC_STATUS_ARRAY m_statusVector;
-// void ensureDataAvailable()
-// throw (::com::sun::star::sdbc::SQLException);
-// const ::connectivity::ORowSetValue& getSqlData(sal_Int32 aRow, sal_Int32 aColumn)
-// throw (::com::sun::star::sdbc::SQLException);
-
bool isNull(sal_Int32 columnIndex);
template <typename T> T retrieveValue(sal_Int32 columnIndex);
-// template <> ::rtl::OUString retrieveValue< ::rtl::OUString > (sal_Int32 columnIndex);
template <typename T> T safelyRetrieveValue(sal_Int32 columnIndex)
throw(::com::sun::star::sdbc::SQLException);
@@ -248,6 +242,9 @@ namespace connectivity
// XDeleteRows
virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
};
+
+ // Specialisations have to be in the namespace and can't be within the class.
+ template <> ::rtl::OUString OResultSet::retrieveValue< ::rtl::OUString >(sal_Int32 columnIndex);
}
}
#endif // CONNECTIVITY_SRESULTSET_HXX