コード例 #1
0
  private void logSourceEvent(CommandLogMessage msg, Connection connection, String eventType)
      throws SQLException {
    PreparedStatement stmt = connection.prepareStatement(SOURCE_OTHER);

    stmt.setTimestamp(1, new java.sql.Timestamp(msg.getTimestamp()));
    stmt.setString(2, msg.getVdbName());
    stmt.setObject(3, msg.getVdbVersion());
    stmt.setString(4, eventType);
    stmt.setString(5, msg.getSessionID());
    stmt.setString(6, msg.getRequestID());
    stmt.setObject(7, msg.getSourceCommandID().longValue());
    stmt.setString(8, msg.getTransactionID());
    stmt.setString(9, msg.getPrincipal());
    stmt.setString(10, msg.getModelName());
    stmt.setString(11, msg.getTranslatorName());
    stmt.setObject(12, msg.getRowCount());
    stmt.setString(13, (msg.getPlan() != null ? msg.getPlan().toString() : "noplan"));

    stmt.execute();

    if (!connection.getAutoCommit()) {
      connection.commit();
    }

    stmt.close();
  }
コード例 #2
0
  private void logNoSource(CommandLogMessage msg, Connection connection, String eventType)
      throws SQLException {
    PreparedStatement stmt = connection.prepareStatement(NOSOURCE_OTHER);

    stmt.setTimestamp(1, new java.sql.Timestamp(msg.getTimestamp()));
    stmt.setString(2, msg.getVdbName());
    stmt.setObject(3, msg.getVdbVersion());
    stmt.setString(4, eventType);
    stmt.setString(5, msg.getApplicationName());
    stmt.setString(6, msg.getSessionID());
    stmt.setString(7, msg.getRequestID());
    stmt.setString(8, msg.getPrincipal());
    stmt.setObject(9, msg.getRowCount());

    stmt.execute();

    if (!connection.getAutoCommit()) {
      connection.commit();
    }

    stmt.close();
  }