Top Description Fields Constructors Methods
org.apache.log.output.db

public Class NormalizedJDBCTarget

extends DefaultJDBCTarget
Class Inheritance
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, .Statement, java.util.HashMap, javax.sql.DataSource, org.apache.log.LogEvent

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

Field Summary

Modifier and TypeField and Description
private HashMap<K, V>
private HashMap<K, V>

Constructor Summary

AccessConstructor and Description
public
NormalizedJDBCTarget(final DataSource dataSource, final String table, final ColumnInfo[] columns)

Method Summary

Modifier and TypeMethod and Description
protected synchronized int
getID(final String tableName, final HashMap<K, V> idMap, final String instance)

protected void
specifyColumn(final PreparedStatement
the prepard statement
statement
,
final int
the index
index
,
final LogEvent
the log event
event
)

Overrides org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

Adds a single object into statement.
Inherited from org.apache.log.output.db.DefaultJDBCTarget:
closeConnectiongetColumngetStatementSQLgetTableisStaleopenConnectionoutput

Field Detail

m_categoryIDsback to summary
private HashMap<K, V> m_categoryIDs
m_priorityIDsback to summary
private HashMap<K, V> m_priorityIDs

Constructor Detail

NormalizedJDBCTargetback to summary
public NormalizedJDBCTarget(final DataSource dataSource, final String table, final ColumnInfo[] columns)

Method Detail

getIDback to summary
protected synchronized int getID(final String tableName, final HashMap<K, V> idMap, final String instance) throws SQLException
specifyColumnback to summary
protected void specifyColumn(final PreparedStatement statement, final int index, final LogEvent event) throws SQLException

Overrides org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

Adds a single object into statement.

Parameters
statement:PreparedStatement

Doc from org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

the prepard statement

index:int

Doc from org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

the index

event:LogEvent

Doc from org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

the log event

Exceptions
SQLException:

Doc from org.apache.log.output.db.DefaultJDBCTarget.specifyColumn.

if an SQL related error occurs