17 #ifndef _LOG4CXX_DB_MYSQL_APPENDER_H
18 #define _LOG4CXX_DB_MYSQL_APPENDER_H
24 #include <log4cxx/helpers/exception.h>
25 #include <log4cxx/appenderskeleton.h>
26 #include <log4cxx/spi/loggingevent.h>
38 class LOG4CXX_EXPORT SQLException :
public helpers::Exception
41 SQLException(
int code) : code(code) {}
42 virtual String getMessage() {
return String(); }
48 typedef helpers::ObjectPtrT<MySQLAppender> MySQLAppenderPtr;
96 #define SQLHDBC MYSQL*
146 unsigned long fLastId;
147 bool fIsConnectionOpen;
151 BEGIN_LOG4CXX_CAST_MAP()
153 LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton)
154 END_LOG4CXX_CAST_MAP()
157 virtual ~MySQLAppender();
162 virtual
void setOption(const String& option, const String& value);
167 void append(const spi::LoggingEventPtr& event);
178 String getLogStatement(const spi::LoggingEventPtr& event);
180 #if (STAR_LOG4CXX_VERSION == 10)
182 virtual void append(
const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p);
193 unsigned int execute(
const String& sql) ;
202 virtual void closeConnection();
210 virtual MYSQL *getConnection() ;
217 virtual void close();
238 void setSql(
const String& s);
244 {
return sqlStatement; }
247 inline void setUser(
const String& user)
248 { databaseUser = user; }
251 inline void setURL(
const String& url)
252 { databaseURL = url; }
255 inline void setPassword(
const String& password)
256 { databasePassword = password; }
259 inline void setBufferSize(
size_t newBufferSize)
260 { bufferSize = newBufferSize; }
262 inline const String& getUser()
const
263 {
return databaseUser; }
266 inline const String& getURL()
const
267 {
return databaseURL; }
270 inline const String& getPassword()
const
271 {
return databasePassword; }
273 inline size_t getBufferSize()
const
274 {
return bufferSize; }
280 #endif // _LOG4CXX_DB_MYSQL_APPENDER_H
std::list< spi::LoggingEventPtr > buffer
virtual bool requiresLayout() const
const String & getSql() const