Holger's
Java API

com.antelmann.util.logging
Class SampleSQLLogFormatter

java.lang.Object
  extended by com.antelmann.util.logging.SampleSQLLogFormatter
All Implemented Interfaces:
LogEntryFormatter<Object[]>

public class SampleSQLLogFormatter
extends Object
implements LogEntryFormatter<Object[]>

NOT QUITE DONE, YET. a sample implementation that writes/reads LogEntry objects to/from a Connection object. The tableName given in the constructor is expected to have the following field names (in their respective order), where every field (except the entry_time field) is to be of a type that can handle a String:

Author:
Holger Antelmann

Constructor Summary
SampleSQLLogFormatter(Connection con, String tableName, int charLimit)
           
 
Method Summary
protected  LogEntry extractLogEntry(ResultSet rs)
           
 Object[] formatLogEntry(LogEntry entry)
           
 ArrayList<LogEntry> getLogEntries(Date from, Date until, Filter<LogEntry> filter)
          null parameter mean that no restriction applies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleSQLLogFormatter

public SampleSQLLogFormatter(Connection con,
                             String tableName,
                             int charLimit)
Method Detail

getLogEntries

public ArrayList<LogEntry> getLogEntries(Date from,
                                         Date until,
                                         Filter<LogEntry> filter)
                                  throws SQLException
null parameter mean that no restriction applies

Throws:
SQLException

extractLogEntry

protected LogEntry extractLogEntry(ResultSet rs)
                            throws SQLException
Throws:
SQLException

formatLogEntry

public Object[] formatLogEntry(LogEntry entry)
Specified by:
formatLogEntry in interface LogEntryFormatter<Object[]>


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads