Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gql++/exception.h

Go to the documentation of this file.
00001 /* This is for emacs: -*-Mode: C++;-*- */
00002 #if !defined(__INC_EXCEPTION_H)
00003 #define __INC_EXCEPTION_H
00004 
00005 #include <stdexcept>
00006 
00007 #include "gql++config.h"
00008 
00009 namespace GQL
00010 {
00011 
00012 using namespace std;
00013 
00014 class SQLException : public runtime_error
00015 {
00016   public:
00017     SQLException(const string& str = string(),
00018                  const string& state = string(),
00019                  int err = 0)
00020         : runtime_error(str), state_(state), vendor_code_(err) { }
00021     virtual ~SQLException() throw() { }
00022 
00023     const char *get_message() const { return(what()); }
00024     int get_error_code() const { return(vendor_code_); }
00025     const string& get_sql_state() const { return(state_); }
00026   private:
00027     string state_;
00028     int vendor_code_;
00029 };
00030 
00031 }
00032 
00033 #endif

Generated on Fri Apr 19 13:00:13 2002 for gql by doxygen1.2.15