org.apache.log.output.db
Class DefaultJDBCTarget
- ErrorAware, LogTarget
public class DefaultJDBCTarget
The basic DB target for configurable output formats.
- Avalon Development Team
- Peter Donald
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
closeConnection
protected void closeConnection()
Close connection to underlying database.
- closeConnection in interface AbstractJDBCTarget
getColumn
protected final ColumnInfo getColumn(int index)
Return the column info for an supplied index.
index
- the index
- the column info
getStatementSQL
protected String getStatementSQL()
Return the SQL insert statement.
- the statement
getTable
protected final String getTable()
Return the underlying table
- the table name
isStale
protected boolean isStale()
Test if the target is stale.
- isStale in interface AbstractJDBCTarget
- TRUE if the target is stale else FALSE
openConnection
protected void openConnection()
Open connection to underlying database.
- openConnection in interface AbstractJDBCTarget
output
protected void output(LogEvent event)
Output a log event to DB.
This must be implemented by subclasses.
- output in interface AbstractJDBCTarget
event
- the log event.
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
"Copyright B) 2001 Apache Jakarta Project. All Rights Reserved."