Package repast.simphony.data.logging

Examples of repast.simphony.data.logging.LogMessage


     * @see org.apache.log4j.jdbc.JDBCAppender#getLogStatement(org.apache.log4j.spi.LoggingEvent)
     */
    @Override
    public String getLogStatement(LoggingEvent event) {

      LogMessage message = (LogMessage) event.getMessage();

      if (!wroteRunInformation) {
        writeRunInformation(getRunID(descriptor, getConnection()), getConnection());
      }

      PreparedStatement prepStat = getPreparedStatement();
      int index = 0;

      try {
        if (descriptor.isAddRunID()) {
          prepStat.setInt(++index, getRunID(descriptor, getConnection()));
        }

        Iterator<String> columns = descriptor.getColumns().iterator();
        while (columns.hasNext()) {
          String column = columns.next();
          addToPrepStatet(prepStat, ++index, message.get(column));
        }
        prepStat.addBatch();

        if (descriptor.getWriteCacheInterval() == cached) {
          // the number of records to cache is reached -> execute statement
View Full Code Here

TOP

Related Classes of repast.simphony.data.logging.LogMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.