org.apache.log.output.db
public class DefaultJDBCTarget extends AbstractJDBCTarget
| Constructor Summary | |
|---|---|
| DefaultJDBCTarget(DataSource dataSource, String table, ColumnInfo[] columns)
Creation of a new JDBC logging target. | |
| Method Summary | |
|---|---|
| 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. |
Parameters: dataSource the JDBC datasource table the table columns a ColumnInfo array
Parameters: index the index
Returns: the column info
Returns: the statement
Returns: the table name
Returns: TRUE if the target is stale else FALSE
Parameters: event the log event.
Parameters: statement the prepard statement index the index event the log event
Throws: SQLException if an SQL related error occurs IllegalStateException if the supplied index is out of bounds