Index: include/log4cxx/db/odbcappender.h =================================================================== RCS file: /home/cvspublic/logging-log4cxx/include/log4cxx/db/odbcappender.h,v retrieving revision 1.19 diff -u -r1.19 odbcappender.h --- include/log4cxx/db/odbcappender.h 4 May 2005 16:13:40 -0000 1.19 +++ include/log4cxx/db/odbcappender.h 13 Sep 2005 15:55:02 -0000 @@ -25,7 +25,8 @@ #include #include -#ifdef LOG4CXX_HAVE_MS_ODBC +#ifdef WIN32 +#define LOG4CXX_HAVE_MS_ODBC #include #endif @@ -38,17 +39,13 @@ class LOG4CXX_EXPORT SQLException : public helpers::Exception { public: - SQLException(int code) : code(code) {} - SQLException(const SQLException& src) : Exception(src), code(src.code) { - } - const char* what() const throw() { - return "SQLException"; - } - virtual ~SQLException() throw() {} - - private: - SQLException& operator=(const SQLException&); - int code; + SQLException(const std::string& msg) : Exception(msg){} + SQLException(const SQLException& src) : Exception(src){} + SQLException& operator=(const SQLException& src) + { + Exception::operator=(src); + return *this; + } }; class ODBCAppender; @@ -168,7 +165,7 @@ /** * Adds the event to the buffer. When full the buffer is flushed. */ - void append(const spi::LoggingEventPtr& event); + virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); /** * By default getLogStatement sends the event to the required Layout object. @@ -179,7 +176,7 @@ * */ protected: - LogString getLogStatement(const spi::LoggingEventPtr& event) const; + LogString getLogStatement(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) const; /** * @@ -189,7 +186,7 @@ * end. I use a connection pool outside of ODBCAppender which is * accessed in an override of this method. * */ - void execute(const LogString& sql) /*throw(SQLException)*/; + virtual void execute(const LogString& sql) /*throw(SQLException)*/; /** * Override this to return the connection to a pool, or to clean up the @@ -208,6 +205,8 @@ */ virtual SQLHDBC getConnection() /*throw(SQLException)*/; + virtual std::string GetErrorMessage( SQLSMALLINT fHandleType, SQLHANDLE hInput, const char* szMsg ); + /** * Closes the appender, flushing the buffer first then closing the default * connection if it is open. @@ -222,7 +221,7 @@ * * If a statement fails the LoggingEvent stays in the buffer! */ - void flushBuffer(); + virtual void flushBuffer(); /** * ODBCAppender requires a layout.