| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.jdbc.support.DatabaseStartupValidator
public class DatabaseStartupValidator
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.
| Field Summary | |
|---|---|
| static int | DEFAULT_INTERVAL | 
| static int | DEFAULT_TIMEOUT | 
| protected  Log | logger | 
| Constructor Summary | |
|---|---|
| DatabaseStartupValidator() | |
| Method Summary | |
|---|---|
|  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. | 
|  void | setDataSource(DataSource dataSource)Set the DataSource to validate. | 
|  void | setInterval(int interval)Set the interval between validation runs (in seconds). | 
|  void | setTimeout(int timeout)Set the timeout (in seconds) after which a fatal exception will be thrown. | 
|  void | setValidationQuery(String validationQuery)Set the SQL query string to use for validation. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int DEFAULT_INTERVAL
public static final int DEFAULT_TIMEOUT
protected final Log logger
| Constructor Detail | 
|---|
public DatabaseStartupValidator()
| Method Detail | 
|---|
public void setDataSource(DataSource dataSource)
public void setValidationQuery(String validationQuery)
public void setInterval(int interval)
public void setTimeout(int timeout)
public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBean| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||