org.apache.log.output.db
Class DefaultJDBCTarget
- ErrorAware, LogTarget
public class DefaultJDBCTarget
The basic DB target for configurable output formats.
protected void | closeConnection() - Close connection to underlying database.
|
protected ColumnInfo | getColumn(int index) - Return the column info for an supplied index.
|
protected String | getStatementSQL() - Return the SQL insert statement.
|
protected String | getTable() - Return the underlying table
|
protected boolean | isStale() - Test if the target is stale.
|
protected void | openConnection() - Open connection to underlying database.
|
protected void | output(LogEvent event) - Output a log event to DB.
|
protected void | specifyColumn(PreparedStatement statement, int index, LogEvent event) - Adds a single object into statement.
|
DefaultJDBCTarget
public DefaultJDBCTarget(DataSource dataSource,
String table,
ColumnInfo[] columns)
Creation of a new JDBC logging target.
dataSource
- the JDBC datasourcetable
- the tablecolumns
- a ColumnInfo array
getColumn
protected final ColumnInfo getColumn(int index)
Return the column info for an supplied index.
getStatementSQL
protected String getStatementSQL()
Return the SQL insert statement.
getTable
protected final String getTable()
Return the underlying table
isStale
protected boolean isStale()
Test if the target is stale.
- isStale in interface AbstractJDBCTarget
- TRUE if the target is stale else FALSE
specifyColumn
protected void specifyColumn(PreparedStatement statement,
int index,
LogEvent event)
throws SQLException,
IllegalStateException
Adds a single object into statement.
statement
- the prepard statementindex
- the indexevent
- the log event