From f7aa11c7f57f403d568d6f0305bd96236510a132 Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Thu, 7 Feb 2008 20:14:40 +0000 Subject: [PATCH] removed NoDataException throw --- Data/ODBC/src/ODBCStatementImpl.cpp | 17 ++++++++--------- Data/include/Poco/Data/AbstractSessionImpl.h | 7 +++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Data/ODBC/src/ODBCStatementImpl.cpp b/Data/ODBC/src/ODBCStatementImpl.cpp index 332e89b60..47836b0ef 100644 --- a/Data/ODBC/src/ODBCStatementImpl.cpp +++ b/Data/ODBC/src/ODBCStatementImpl.cpp @@ -337,6 +337,7 @@ void ODBCStatementImpl::makeStep() { _extractors[currentDataSet()]->reset(); _nextResponse = SQLFetch(_stmt); + checkError(_nextResponse); _stepCalled = true; } @@ -408,18 +409,16 @@ std::string ODBCStatementImpl::nativeSQL() void ODBCStatementImpl::checkError(SQLRETURN rc, const std::string& msg) { + if (SQL_NO_DATA == rc) return; + if (Utility::isError(rc)) { - if (rc != SQL_NO_DATA) - { - std::ostringstream os; - os << std::endl << "Requested SQL statement: " << toString() << std::endl; - os << "Native SQL statement: " << nativeSQL() << std::endl; - std::string str(msg); str += os.str(); + std::ostringstream os; + os << std::endl << "Requested SQL statement: " << toString() << std::endl; + os << "Native SQL statement: " << nativeSQL() << std::endl; + std::string str(msg); str += os.str(); - throw StatementException(_stmt, str); - } - else throw NoDataException(); + throw StatementException(_stmt, str); } } diff --git a/Data/include/Poco/Data/AbstractSessionImpl.h b/Data/include/Poco/Data/AbstractSessionImpl.h index f55e35916..9e3b1c2d1 100644 --- a/Data/include/Poco/Data/AbstractSessionImpl.h +++ b/Data/include/Poco/Data/AbstractSessionImpl.h @@ -74,6 +74,7 @@ public: AbstractSessionImpl() /// Creates the AbstractSessionImpl. + /// /// Adds "storage" property and sets the default internal storage container /// type to std::deque. /// The storage is created by statements automatically whenever a query @@ -81,6 +82,8 @@ public: /// Storage type can be reconfigured at runtime both globally (for the /// duration of the session) and locally (for a single statement execution only). /// See StatementImpl for details on how this property is used at runtime. + /// + /// Adds bulk feature and sets it to false. /// Bulk feature determines whether the session is capable of bulk operations. /// Connectors that are capable of it must set this feature prior to attempting /// bulk operations. @@ -182,13 +185,13 @@ public: } void setBulk(const std::string& name, bool bulk) - /// Sets the storage type. + /// Sets the execution type. { _bulk = bulk; } bool getBulk(const std::string& name="") - /// Returns the storage type + /// Returns the execution type { return _bulk; }