类 DatabaseStartupValidator

  • 所有已实现的接口:
    InitializingBean

    public class DatabaseStartupValidator
    extends Object
    implements InitializingBean
    Bean that checks if a database has already started up. To be referenced via "depends-on" from beans that depend on database startup, like a Hibernate SessionFactory or custom data access objects that access a DataSource directly.

    Useful to defer application initialization until a database has started up. Particularly appropriate for waiting on a slowly starting Oracle database.

    从以下版本开始:
    18.12.2003
    作者:
    Juergen Hoeller
    • 方法详细资料

      • setValidationQuery

        public void setValidationQuery​(String validationQuery)
        Set the SQL query string to use for validation.
      • setInterval

        public void setInterval​(int interval)
        Set the interval between validation runs (in seconds). Default is 1.
      • setTimeout

        public void setTimeout​(int timeout)
        Set the timeout (in seconds) after which a fatal exception will be thrown. Default is 60.
      • afterPropertiesSet

        public void afterPropertiesSet()
        Check whether the validation query can be executed on a Connection from the specified DataSource, with the specified interval between checks, until the specified timeout.
        指定者:
        afterPropertiesSet 在接口中 InitializingBean