org.apache.log.output.db
Class NormalizedJDBCTarget

java.lang.Object
  extended byorg.apache.log.output.AbstractTarget
      extended byorg.apache.log.output.db.AbstractJDBCTarget
          extended byorg.apache.log.output.db.DefaultJDBCTarget
              extended byorg.apache.log.output.db.NormalizedJDBCTarget
All Implemented Interfaces:
Closeable, 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(javax.sql.DataSource dataSource, java.lang.String table, ColumnInfo[] columns)
           
 
Method Summary
protected  int getID(java.lang.String tableName, java.util.HashMap idMap, java.lang.String instance)
           
protected  void specifyColumn(java.sql.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
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(javax.sql.DataSource dataSource,
                            java.lang.String table,
                            ColumnInfo[] columns)
Method Detail

specifyColumn

protected void specifyColumn(java.sql.PreparedStatement statement,
                             int index,
                             LogEvent event)
                      throws java.sql.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:
java.sql.SQLException - if an SQL related error occurs

getID

protected int getID(java.lang.String tableName,
                    java.util.HashMap idMap,
                    java.lang.String instance)
             throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.