Class JdbcDatabaseManager

    • Method Detail

      • getJDBCDatabaseManager

        @Deprecated
        public static JdbcDatabaseManager getJDBCDatabaseManager​(java.lang.String name,
                                                                 int bufferSize,
                                                                 ConnectionSource connectionSource,
                                                                 java.lang.String tableName,
                                                                 ColumnConfig[] columnConfigs)
        Creates a JDBC manager for use within the JdbcAppender, or returns a suitable one if it already exists.
        Parameters:
        name - The name of the manager, which should include connection details and hashed passwords where possible.
        bufferSize - The size of the log event buffer.
        connectionSource - The source for connections to the database.
        tableName - The name of the database table to insert log events into.
        columnConfigs - Configuration information about the log table columns.
        Returns:
        a new or existing JDBC manager as applicable.
      • getManager

        @Deprecated
        public static JdbcDatabaseManager getManager​(java.lang.String name,
                                                     int bufferSize,
                                                     Layout<? extends java.io.Serializable> layout,
                                                     ConnectionSource connectionSource,
                                                     java.lang.String tableName,
                                                     ColumnConfig[] columnConfigs,
                                                     ColumnMapping[] columnMappings)
        Deprecated.
        Creates a JDBC manager for use within the JdbcAppender, or returns a suitable one if it already exists.
        Parameters:
        name - The name of the manager, which should include connection details and hashed passwords where possible.
        bufferSize - The size of the log event buffer.
        layout - The Appender-level layout
        connectionSource - The source for connections to the database.
        tableName - The name of the database table to insert log events into.
        columnConfigs - Configuration information about the log table columns.
        columnMappings - column mapping configuration (including type conversion).
        Returns:
        a new or existing JDBC manager as applicable.
      • getManager

        @Deprecated
        public static JdbcDatabaseManager getManager​(java.lang.String name,
                                                     int bufferSize,
                                                     Layout<? extends java.io.Serializable> layout,
                                                     ConnectionSource connectionSource,
                                                     java.lang.String tableName,
                                                     ColumnConfig[] columnConfigs,
                                                     ColumnMapping[] columnMappings,
                                                     boolean immediateFail,
                                                     long reconnectIntervalMillis)
        Creates a JDBC manager for use within the JdbcAppender, or returns a suitable one if it already exists.
        Parameters:
        name - The name of the manager, which should include connection details and hashed passwords where possible.
        bufferSize - The size of the log event buffer.
        layout -
        connectionSource - The source for connections to the database.
        tableName - The name of the database table to insert log events into.
        columnConfigs - Configuration information about the log table columns.
        columnMappings - column mapping configuration (including type conversion).
        reconnectIntervalMillis -
        immediateFail -
        Returns:
        a new or existing JDBC manager as applicable.
      • getManager

        public static JdbcDatabaseManager getManager​(java.lang.String name,
                                                     int bufferSize,
                                                     Layout<? extends java.io.Serializable> layout,
                                                     ConnectionSource connectionSource,
                                                     java.lang.String tableName,
                                                     ColumnConfig[] columnConfigs,
                                                     ColumnMapping[] columnMappings,
                                                     boolean immediateFail,
                                                     long reconnectIntervalMillis,
                                                     boolean truncateStrings)
        Creates a JDBC manager for use within the JdbcAppender, or returns a suitable one if it already exists.
        Parameters:
        name - The name of the manager, which should include connection details and hashed passwords where possible.
        bufferSize - The size of the log event buffer.
        layout - The Appender-level layout
        connectionSource - The source for connections to the database.
        tableName - The name of the database table to insert log events into.
        columnConfigs - Configuration information about the log table columns.
        columnMappings - column mapping configuration (including type conversion).
        immediateFail - Whether or not to fail immediately with a AppenderLoggingException when connecting to JDBC fails.
        reconnectIntervalMillis - How often to reconnect to the database when a SQL exception is detected.
        truncateStrings - Whether or not to truncate strings to match column metadata.
        Returns:
        a new or existing JDBC manager as applicable.
      • closeResources

        protected void closeResources​(boolean logExceptions)
      • getSqlStatement

        public java.lang.String getSqlStatement()
      • getTableName

        public java.lang.String getTableName()
      • startupInternal

        protected void startupInternal()
                                throws java.lang.Exception
        Description copied from class: AbstractDatabaseManager
        Implementations should implement this method to perform any proprietary startup operations. This method will never be called twice on the same instance. It is safe to throw any exceptions from this method. This method does not necessarily connect to the database, as it is generally unreliable to connect once and use the same connection for hours.
        Specified by:
        startupInternal in class AbstractDatabaseManager
        Throws:
        java.lang.Exception