From 95bc5ac789c2f29220f76c94fc93d6379dcd00c6 Mon Sep 17 00:00:00 2001 From: randomdan Date: Mon, 13 Sep 2010 19:57:25 +0000 Subject: Remove duplication in ODBC::Connection constructors Remove pointless specialisation on _Column for strings Set cursor type to scrollable (required to refetch a row) Resize binds if fetched data is truncated Support scrolling fetch (default is old 'next record' behaviour) --- libodbcpp/column.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libodbcpp/column.h') diff --git a/libodbcpp/column.h b/libodbcpp/column.h index 67dd0c4..c9e65ca 100644 --- a/libodbcpp/column.h +++ b/libodbcpp/column.h @@ -10,6 +10,7 @@ namespace ODBC { Column(const Glib::ustring &, unsigned int); virtual ~Column(); void bind(SQLHANDLE, SQLUINTEGER, SQLSMALLINT, void*, size_t); + virtual void resize(SQLHANDLE); operator int () const; operator unsigned int () const; operator long long () const; @@ -32,8 +33,7 @@ namespace ODBC { const Glib::ustring name; protected: mutable Glib::ustring * composeCache; - private: - SQLUINTEGER bindSize; // Allocated memory + SQLLEN bindSize; // Allocated memory friend class SelectCommand; }; template @@ -47,6 +47,12 @@ namespace ODBC { int writeToBuf(char ** buf) const; int writeToBuf(char ** buf, const char * fmt) const; }; + class StringColumn : public _Column { + public: + StringColumn(const Glib::ustring & n, unsigned int i) : + _Column(n, i) { } + void resize(SQLHANDLE); + }; } void operator << (SQL_TIMESTAMP_STRUCT & target, const struct tm &); -- cgit v1.2.3