org.apache.log.output.db
Class DefaultJDBCTarget
java.lang.Object
|
+--org.apache.log.output.AbstractTarget
|
+--org.apache.log.output.db.AbstractJDBCTarget
|
+--org.apache.log.output.db.DefaultJDBCTarget
- All Implemented Interfaces:
- ErrorAware, LogTarget
- Direct Known Subclasses:
- NormalizedJDBCTarget
- public class DefaultJDBCTarget
- extends AbstractJDBCTarget
The basic DB target for configurable output formats.
- Author:
- Peter Donald
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultJDBCTarget
public DefaultJDBCTarget(javax.sql.DataSource dataSource,
java.lang.String table,
ColumnInfo[] columns)
output
protected void output(LogEvent event)
- Output a log event to DB.
This must be implemented by subclasses.
- Overrides:
output
in class AbstractJDBCTarget
- Parameters:
event
- the log event.
openConnection
protected void openConnection()
- Open connection to underlying database.
- Overrides:
openConnection
in class AbstractJDBCTarget
getStatementSQL
protected java.lang.String getStatementSQL()
isStale
protected boolean isStale()
- Description copied from class:
AbstractJDBCTarget
- Detect if connection is stale and should be reopened.
- Overrides:
isStale
in class AbstractJDBCTarget
- Following copied from class:
org.apache.log.output.db.AbstractJDBCTarget
- Returns:
- true if connection is stale, false otherwise
closeConnection
protected void closeConnection()
- Close connection to underlying database.
- Overrides:
closeConnection
in class AbstractJDBCTarget
specifyColumn
protected void specifyColumn(java.sql.PreparedStatement statement,
int index,
LogEvent event)
throws java.sql.SQLException
- Adds a single object into statement.
getTable
protected final java.lang.String getTable()
getColumn
protected final ColumnInfo getColumn(int index)
"Copyright © 2001 Apache Jakarta Project. All Rights Reserved."