| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0_31) --> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <TITLE> |
| JDBCAppender (Apache Log4j 1.2.17 API) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2012-06-09"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="JDBCAppender (Apache Log4j 1.2.17 API)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JDBCAppender.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/apache/log4j/jdbc/JDBCAppender.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="JDBCAppender.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.apache.log4j.jdbc</FONT> |
| <BR> |
| Class JDBCAppender</H2> |
| <PRE> |
| <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
| <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">org.apache.log4j.AppenderSkeleton</A> |
| <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.log4j.jdbc.JDBCAppender</B> |
| </PRE> |
| <DL> |
| <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A>, <A HREF="../../../../org/apache/log4j/spi/OptionHandler.html" title="interface in org.apache.log4j.spi">OptionHandler</A></DD> |
| </DL> |
| <HR> |
| <DL> |
| <DT><PRE>public class <B>JDBCAppender</B><DT>extends <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">AppenderSkeleton</A><DT>implements <A HREF="../../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A></DL> |
| </PRE> |
| |
| <P> |
| The JDBCAppender provides for sending log events to a database. |
| |
| <p><b><font color="#FF2222">WARNING: This version of JDBCAppender |
| is very likely to be completely replaced in the future. Moreoever, |
| it does not log exceptions</font></b>. |
| |
| <p>Each append call adds to an <code>ArrayList</code> buffer. When |
| the buffer is filled each log event is placed in a sql statement |
| (configurable) and executed. |
| |
| <b>BufferSize</b>, <b>db URL</b>, <b>User</b>, & <b>Password</b> are |
| configurable options in the standard log4j ways. |
| |
| <p>The <code>setSql(String sql)</code> sets the SQL statement to be |
| used for logging -- this statement is sent to a |
| <code>PatternLayout</code> (either created automaticly by the |
| appender or added by the user). Therefore by default all the |
| conversion patterns in <code>PatternLayout</code> can be used |
| inside of the statement. (see the test cases for examples) |
| |
| <p>Overriding the <A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getLogStatement(org.apache.log4j.spi.LoggingEvent)"><CODE>getLogStatement(org.apache.log4j.spi.LoggingEvent)</CODE></A> method allows more |
| explicit control of the statement used for logging. |
| |
| <p>For use as a base class: |
| |
| <ul> |
| |
| <li>Override <code>getConnection()</code> to pass any connection |
| you want. Typically this is used to enable application wide |
| connection pooling. |
| |
| <li>Override <code>closeConnection(Connection con)</code> -- if |
| you override getConnection make sure to implement |
| <code>closeConnection</code> to handle the connection you |
| generated. Typically this would return the connection to the |
| pool it came from. |
| |
| <li>Override <code>getLogStatement(LoggingEvent event)</code> to |
| produce specialized or dynamic statements. The default uses the |
| sql option value. |
| |
| </ul> |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Author:</B></DT> |
| <DD>Kevin Steppe (<A HREF="mailto:ksteppe@pacbell.net">ksteppe@pacbell.net</A>)</DD> |
| </DL> |
| <HR> |
| |
| <P> |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Field Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#buffer">buffer</A></B></CODE> |
| |
| <BR> |
| ArrayList holding the buffer of Logging Events.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#bufferSize">bufferSize</A></B></CODE> |
| |
| <BR> |
| size of LoggingEvent buffer before writting to the database.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#connection">connection</A></B></CODE> |
| |
| <BR> |
| Connection used by default.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#databasePassword">databasePassword</A></B></CODE> |
| |
| <BR> |
| User to use for default connection handling</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#databaseURL">databaseURL</A></B></CODE> |
| |
| <BR> |
| URL of the DB for default connection handling</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#databaseUser">databaseUser</A></B></CODE> |
| |
| <BR> |
| User to connect as for default connection handling</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#removes">removes</A></B></CODE> |
| |
| <BR> |
| Helper object for clearing out the buffer</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#sqlStatement">sqlStatement</A></B></CODE> |
| |
| <BR> |
| Stores the string given to the pattern layout for conversion into a SQL |
| statement, eg: insert into LogTable (Thread, Class, Message) values |
| ("%t", "%c", "%m").</TD> |
| </TR> |
| </TABLE> |
| <A NAME="fields_inherited_from_class_org.apache.log4j.AppenderSkeleton"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Fields inherited from class org.apache.log4j.<A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">AppenderSkeleton</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#closed">closed</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#errorHandler">errorHandler</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#headFilter">headFilter</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#layout">layout</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#name">name</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#tailFilter">tailFilter</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#threshold">threshold</A></CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Constructor Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#JDBCAppender()">JDBCAppender</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#append(org.apache.log4j.spi.LoggingEvent)">append</A></B>(<A HREF="../../../../org/apache/log4j/spi/LoggingEvent.html" title="class in org.apache.log4j.spi">LoggingEvent</A> event)</CODE> |
| |
| <BR> |
| Adds the event to the buffer.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#close()">close</A></B>()</CODE> |
| |
| <BR> |
| Closes the appender, flushing the buffer first then closing the default |
| connection if it is open.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#closeConnection(java.sql.Connection)">closeConnection</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A> con)</CODE> |
| |
| <BR> |
| Override this to return the connection to a pool, or to clean up the |
| resource.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#execute(java.lang.String)">execute</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> sql)</CODE> |
| |
| <BR> |
| Override this to provide an alertnate method of getting |
| connections (such as caching).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#finalize()">finalize</A></B>()</CODE> |
| |
| <BR> |
| closes the appender before disposal</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#flushBuffer()">flushBuffer</A></B>()</CODE> |
| |
| <BR> |
| loops through the buffer of LoggingEvents, gets a |
| sql string from getLogStatement() and sends it to execute().</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getBufferSize()">getBufferSize</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getConnection()">getConnection</A></B>()</CODE> |
| |
| <BR> |
| Override this to link with your connection pooling system.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getLocationInfo()">getLocationInfo</A></B>()</CODE> |
| |
| <BR> |
| Gets whether the location of the logging request call |
| should be captured.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getLogStatement(org.apache.log4j.spi.LoggingEvent)">getLogStatement</A></B>(<A HREF="../../../../org/apache/log4j/spi/LoggingEvent.html" title="class in org.apache.log4j.spi">LoggingEvent</A> event)</CODE> |
| |
| <BR> |
| By default getLogStatement sends the event to the required Layout object.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getPassword()">getPassword</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getSql()">getSql</A></B>()</CODE> |
| |
| <BR> |
| Returns pre-formated statement eg: insert into LogTable (msg) values ("%m")</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getURL()">getURL</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#getUser()">getUser</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#requiresLayout()">requiresLayout</A></B>()</CODE> |
| |
| <BR> |
| JDBCAppender requires a layout.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setBufferSize(int)">setBufferSize</A></B>(int newBufferSize)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setDriver(java.lang.String)">setDriver</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> driverClass)</CODE> |
| |
| <BR> |
| Ensures that the given driver class has been loaded for sql connection |
| creation.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setLocationInfo(boolean)">setLocationInfo</A></B>(boolean flag)</CODE> |
| |
| <BR> |
| The <b>LocationInfo</b> option takes a boolean value.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setPassword(java.lang.String)">setPassword</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> password)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setSql(java.lang.String)">setSql</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setURL(java.lang.String)">setURL</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> url)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/log4j/jdbc/JDBCAppender.html#setUser(java.lang.String)">setUser</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> user)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_org.apache.log4j.AppenderSkeleton"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class org.apache.log4j.<A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">AppenderSkeleton</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#activateOptions()">activateOptions</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#addFilter(org.apache.log4j.spi.Filter)">addFilter</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#clearFilters()">clearFilters</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#doAppend(org.apache.log4j.spi.LoggingEvent)">doAppend</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getErrorHandler()">getErrorHandler</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getFilter()">getFilter</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getFirstFilter()">getFirstFilter</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getLayout()">getLayout</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getName()">getName</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#getThreshold()">getThreshold</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#isAsSevereAsThreshold(org.apache.log4j.Priority)">isAsSevereAsThreshold</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#setErrorHandler(org.apache.log4j.spi.ErrorHandler)">setErrorHandler</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#setLayout(org.apache.log4j.Layout)">setLayout</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#setName(java.lang.String)">setName</A>, <A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#setThreshold(org.apache.log4j.Priority)">setThreshold</A></CODE></TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_org.apache.log4j.Appender"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from interface org.apache.log4j.<A HREF="../../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="../../../../org/apache/log4j/Appender.html#addFilter(org.apache.log4j.spi.Filter)">addFilter</A>, <A HREF="../../../../org/apache/log4j/Appender.html#clearFilters()">clearFilters</A>, <A HREF="../../../../org/apache/log4j/Appender.html#doAppend(org.apache.log4j.spi.LoggingEvent)">doAppend</A>, <A HREF="../../../../org/apache/log4j/Appender.html#getErrorHandler()">getErrorHandler</A>, <A HREF="../../../../org/apache/log4j/Appender.html#getFilter()">getFilter</A>, <A HREF="../../../../org/apache/log4j/Appender.html#getLayout()">getLayout</A>, <A HREF="../../../../org/apache/log4j/Appender.html#getName()">getName</A>, <A HREF="../../../../org/apache/log4j/Appender.html#setErrorHandler(org.apache.log4j.spi.ErrorHandler)">setErrorHandler</A>, <A HREF="../../../../org/apache/log4j/Appender.html#setLayout(org.apache.log4j.Layout)">setLayout</A>, <A HREF="../../../../org/apache/log4j/Appender.html#setName(java.lang.String)">setName</A></CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ FIELD DETAIL =========== --> |
| |
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Field Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="databaseURL"><!-- --></A><H3> |
| databaseURL</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>databaseURL</B></PRE> |
| <DL> |
| <DD>URL of the DB for default connection handling |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="databaseUser"><!-- --></A><H3> |
| databaseUser</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>databaseUser</B></PRE> |
| <DL> |
| <DD>User to connect as for default connection handling |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="databasePassword"><!-- --></A><H3> |
| databasePassword</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>databasePassword</B></PRE> |
| <DL> |
| <DD>User to use for default connection handling |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="connection"><!-- --></A><H3> |
| connection</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A> <B>connection</B></PRE> |
| <DL> |
| <DD>Connection used by default. The connection is opened the first time it |
| is needed and then held open until the appender is closed (usually at |
| garbage collection). This behavior is best modified by creating a |
| sub-class and overriding the <code>getConnection</code> and |
| <code>closeConnection</code> methods. |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="sqlStatement"><!-- --></A><H3> |
| sqlStatement</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>sqlStatement</B></PRE> |
| <DL> |
| <DD>Stores the string given to the pattern layout for conversion into a SQL |
| statement, eg: insert into LogTable (Thread, Class, Message) values |
| ("%t", "%c", "%m"). |
| |
| Be careful of quotes in your messages! |
| |
| Also see PatternLayout. |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="bufferSize"><!-- --></A><H3> |
| bufferSize</H3> |
| <PRE> |
| protected int <B>bufferSize</B></PRE> |
| <DL> |
| <DD>size of LoggingEvent buffer before writting to the database. |
| Default is 1. |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="buffer"><!-- --></A><H3> |
| buffer</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>buffer</B></PRE> |
| <DL> |
| <DD>ArrayList holding the buffer of Logging Events. |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| <HR> |
| |
| <A NAME="removes"><!-- --></A><H3> |
| removes</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>removes</B></PRE> |
| <DL> |
| <DD>Helper object for clearing out the buffer |
| <P> |
| <DL> |
| </DL> |
| </DL> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Constructor Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="JDBCAppender()"><!-- --></A><H3> |
| JDBCAppender</H3> |
| <PRE> |
| public <B>JDBCAppender</B>()</PRE> |
| <DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="getLocationInfo()"><!-- --></A><H3> |
| getLocationInfo</H3> |
| <PRE> |
| public boolean <B>getLocationInfo</B>()</PRE> |
| <DL> |
| <DD>Gets whether the location of the logging request call |
| should be captured. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>the current value of the <b>LocationInfo</b> option.<DT><B>Since:</B></DT> |
| <DD>1.2.16</DD> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setLocationInfo(boolean)"><!-- --></A><H3> |
| setLocationInfo</H3> |
| <PRE> |
| public void <B>setLocationInfo</B>(boolean flag)</PRE> |
| <DL> |
| <DD>The <b>LocationInfo</b> option takes a boolean value. By default, it is |
| set to false which means there will be no effort to extract the location |
| information related to the event. As a result, the event that will be |
| ultimately logged will likely to contain the wrong location information |
| (if present in the log format). |
| <p/> |
| <p/> |
| Location information extraction is comparatively very slow and should be |
| avoided unless performance is not a concern. |
| </p> |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>flag</CODE> - true if location information should be extracted.<DT><B>Since:</B></DT> |
| <DD>1.2.16</DD> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="append(org.apache.log4j.spi.LoggingEvent)"><!-- --></A><H3> |
| append</H3> |
| <PRE> |
| public void <B>append</B>(<A HREF="../../../../org/apache/log4j/spi/LoggingEvent.html" title="class in org.apache.log4j.spi">LoggingEvent</A> event)</PRE> |
| <DL> |
| <DD>Adds the event to the buffer. When full the buffer is flushed. |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#append(org.apache.log4j.spi.LoggingEvent)">append</A></CODE> in class <CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">AppenderSkeleton</A></CODE></DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getLogStatement(org.apache.log4j.spi.LoggingEvent)"><!-- --></A><H3> |
| getLogStatement</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getLogStatement</B>(<A HREF="../../../../org/apache/log4j/spi/LoggingEvent.html" title="class in org.apache.log4j.spi">LoggingEvent</A> event)</PRE> |
| <DL> |
| <DD>By default getLogStatement sends the event to the required Layout object. |
| The layout will format the given pattern into a workable SQL string. |
| |
| Overriding this provides direct access to the LoggingEvent |
| when constructing the logging statement. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="execute(java.lang.String)"><!-- --></A><H3> |
| execute</H3> |
| <PRE> |
| protected void <B>execute</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> sql) |
| throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE> |
| <DL> |
| <DD>Override this to provide an alertnate method of getting |
| connections (such as caching). One method to fix this is to open |
| connections at the start of flushBuffer() and close them at the |
| end. I use a connection pool outside of JDBCAppender which is |
| accessed in an override of this method. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="closeConnection(java.sql.Connection)"><!-- --></A><H3> |
| closeConnection</H3> |
| <PRE> |
| protected void <B>closeConnection</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A> con)</PRE> |
| <DL> |
| <DD>Override this to return the connection to a pool, or to clean up the |
| resource. |
| |
| The default behavior holds a single connection open until the appender |
| is closed (typically when garbage collected). |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getConnection()"><!-- --></A><H3> |
| getConnection</H3> |
| <PRE> |
| protected <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A> <B>getConnection</B>() |
| throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE> |
| <DL> |
| <DD>Override this to link with your connection pooling system. |
| |
| By default this creates a single connection which is held open |
| until the object is garbage collected. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="close()"><!-- --></A><H3> |
| close</H3> |
| <PRE> |
| public void <B>close</B>()</PRE> |
| <DL> |
| <DD>Closes the appender, flushing the buffer first then closing the default |
| connection if it is open. |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/log4j/Appender.html#close()">close</A></CODE> in interface <CODE><A HREF="../../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A></CODE></DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="flushBuffer()"><!-- --></A><H3> |
| flushBuffer</H3> |
| <PRE> |
| public void <B>flushBuffer</B>()</PRE> |
| <DL> |
| <DD>loops through the buffer of LoggingEvents, gets a |
| sql string from getLogStatement() and sends it to execute(). |
| Errors are sent to the errorHandler. |
| |
| If a statement fails the LoggingEvent stays in the buffer! |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="finalize()"><!-- --></A><H3> |
| finalize</H3> |
| <PRE> |
| public void <B>finalize</B>()</PRE> |
| <DL> |
| <DD>closes the appender before disposal |
| <P> |
| <DD><DL> |
| <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html#finalize()">finalize</A></CODE> in class <CODE><A HREF="../../../../org/apache/log4j/AppenderSkeleton.html" title="class in org.apache.log4j">AppenderSkeleton</A></CODE></DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="requiresLayout()"><!-- --></A><H3> |
| requiresLayout</H3> |
| <PRE> |
| public boolean <B>requiresLayout</B>()</PRE> |
| <DL> |
| <DD>JDBCAppender requires a layout. |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/log4j/Appender.html#requiresLayout()">requiresLayout</A></CODE> in interface <CODE><A HREF="../../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A></CODE></DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setSql(java.lang.String)"><!-- --></A><H3> |
| setSql</H3> |
| <PRE> |
| public void <B>setSql</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getSql()"><!-- --></A><H3> |
| getSql</H3> |
| <PRE> |
| public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getSql</B>()</PRE> |
| <DL> |
| <DD>Returns pre-formated statement eg: insert into LogTable (msg) values ("%m") |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setUser(java.lang.String)"><!-- --></A><H3> |
| setUser</H3> |
| <PRE> |
| public void <B>setUser</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> user)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setURL(java.lang.String)"><!-- --></A><H3> |
| setURL</H3> |
| <PRE> |
| public void <B>setURL</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> url)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setPassword(java.lang.String)"><!-- --></A><H3> |
| setPassword</H3> |
| <PRE> |
| public void <B>setPassword</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> password)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setBufferSize(int)"><!-- --></A><H3> |
| setBufferSize</H3> |
| <PRE> |
| public void <B>setBufferSize</B>(int newBufferSize)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getUser()"><!-- --></A><H3> |
| getUser</H3> |
| <PRE> |
| public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getUser</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getURL()"><!-- --></A><H3> |
| getURL</H3> |
| <PRE> |
| public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getURL</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getPassword()"><!-- --></A><H3> |
| getPassword</H3> |
| <PRE> |
| public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getPassword</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getBufferSize()"><!-- --></A><H3> |
| getBufferSize</H3> |
| <PRE> |
| public int <B>getBufferSize</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setDriver(java.lang.String)"><!-- --></A><H3> |
| setDriver</H3> |
| <PRE> |
| public void <B>setDriver</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> driverClass)</PRE> |
| <DL> |
| <DD>Ensures that the given driver class has been loaded for sql connection |
| creation. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JDBCAppender.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/apache/log4j/jdbc/JDBCAppender.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="JDBCAppender.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| Copyright © 1999-2012 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. |
| </BODY> |
| </HTML> |