org.apache.log.output.db
Class NormalizedJDBCTarget

java.lang.Object
  |
  +--org.apache.log.output.AbstractTarget
        |
        +--org.apache.log.output.db.AbstractJDBCTarget
              |
              +--org.apache.log.output.db.DefaultJDBCTarget
                    |
                    +--org.apache.log.output.db.NormalizedJDBCTarget
All Implemented Interfaces:
ErrorAware, LogTarget

public class NormalizedJDBCTarget
extends DefaultJDBCTarget

JDBC target that writes to normalized tables. This reduces overhead and cost of querying/storing logs.

Parts based on JDBC logger from prottomatter by Nate Sammons

Author:
Peter Donald

Constructor Summary
NormalizedJDBCTarget(DataSource dataSource, String table, ColumnInfo[] columns)
           
 
Method Summary
protected  int getID(String tableName, HashMap idMap, String instance)
           
protected  void specifyColumn(PreparedStatement statement, int index, LogEvent event)
          Adds a single object into statement.
 
Methods inherited from class org.apache.log.output.db.DefaultJDBCTarget
closeConnection, getColumn, getStatementSQL, getTable, isStale, openConnection, output
 
Methods inherited from class org.apache.log.output.db.AbstractJDBCTarget
checkConnection, close, doProcessEvent, getConnection, open
 
Methods inherited from class org.apache.log.output.AbstractTarget
error, getErrorHandler, isOpen, processEvent, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalizedJDBCTarget

public NormalizedJDBCTarget(DataSource dataSource,
                            String table,
                            ColumnInfo[] columns)
Method Detail

specifyColumn

protected void specifyColumn(PreparedStatement statement,
                             int index,
                             LogEvent event)
                      throws SQLException
Adds a single object into statement.

Overrides:
specifyColumn in class DefaultJDBCTarget
Parameters:
statement - the prepard statement
index - the index
event - the log event
Throws:
SQLException - if an SQL related error occurs

getID

protected int getID(String tableName,
                    HashMap idMap,
                    String instance)
             throws SQLException
SQLException


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.