removed NoDataException throw

This commit is contained in:
Aleksandar Fabijanic 2008-02-07 20:14:40 +00:00
parent e4d9b3b40f
commit f7aa11c7f5
2 changed files with 13 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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;
}