Package com.logicaldoc.util.dbinit
Class DBInit
java.lang.Object
com.logicaldoc.util.dbinit.DBInit
- Direct Known Subclasses:
- PluginDbInit
Database initialisation utility
- Author:
- Michael Scholz, Marco Meschieri
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()Executes all the sql files defined in the constructorvoidexecuteSql(String sql) Execute a SQL statements in the passed stringgetDbms()booleanThis method returns the state of the connection to the database.voidvoidvoidsetPassword(String password) voidvoidsetUsername(String username) booleanThis method tests a connection to the database
- 
Constructor Details- 
DBInitA list of sql files to execute- Parameters:
- sqlList- The list of sql files
 
- 
DBInitpublic DBInit()
 
- 
- 
Method Details- 
executepublic void execute()Executes all the sql files defined in the constructor
- 
executeSqlExecute a SQL statements in the passed string- Parameters:
- sql- The SQL to execute
 
- 
isConnectedpublic boolean isConnected()This method returns the state of the connection to the database.- Returns:
- checks true if the database is up and running and well connected
 
- 
testConnectionpublic boolean testConnection()This method tests a connection to the database- Returns:
- true if the database can be connected
 
- 
setDriver
- 
setUrl
- 
setUsername
- 
setPassword
- 
getSqlList
- 
getDbms
- 
setDbms
 
-