nanodbc
A small C++ wrapper for the native C ODBC API
Loading...
Searching...
No Matches
nanodbc::database_error Class Reference

General database error. More...

#include <nanodbc.h>

Inheritance diagram for nanodbc::database_error:
Collaboration diagram for nanodbc::database_error:

Public Member Functions

 database_error (void *handle, short handle_type, std::string const &info="")
 Creates runtime_error with message about last ODBC error.
 
char const * what () const noexcept override
 Returns the full message, including the driver's own text.
 
long native () const noexcept
 Returns the native error code reported by the driver.
 
std::string const & state () const noexcept
 Returns the five character SQLSTATE reported by the driver.
 

Detailed Description

General database error.

See also
Exception types

Constructor & Destructor Documentation

◆ database_error()

nanodbc::database_error::database_error ( void *  handle,
short  handle_type,
std::string const &  info = "" 
)

Creates runtime_error with message about last ODBC error.

Parameters
handleThe native ODBC statement or connection handle.
handle_typeThe native ODBC handle type code for the given handle.
infoAdditional info that will be appended to the beginning of the error message.

The documentation for this class was generated from the following file: