Package com.logicaldoc.util.dbinit
Class DBInit
- java.lang.Object
-
- com.logicaldoc.util.dbinit.DBInit
-
- Direct Known Subclasses:
PluginDbInit
public class DBInit extends Object
Database initialisation utility- Author:
- Michael Scholz, Marco Meschieri
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Executes all the sql files defined in the constructorvoid
executeSql(String sql)
Execute a SQL statements in the passed stringString
getDbms()
List<String>
getSqlList()
boolean
isConnected()
This method returns the state of the connection to the database.void
setDbms(String dbms)
void
setDriver(String driver)
void
setPassword(String password)
void
setUrl(String url)
void
setUsername(String username)
boolean
testConnection()
This method tests a connection to the database
-
-
-
Method Detail
-
execute
public void execute()
Executes all the sql files defined in the constructor
-
executeSql
public void executeSql(String sql)
Execute a SQL statements in the passed string- Parameters:
sql
- The SQL to execute
-
isConnected
public 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
-
testConnection
public boolean testConnection()
This method tests a connection to the database- Returns:
- true if the database can be connected
-
setDriver
public void setDriver(String driver)
-
setUrl
public void setUrl(String url)
-
setUsername
public void setUsername(String username)
-
setPassword
public void setPassword(String password)
-
getDbms
public String getDbms()
-
setDbms
public void setDbms(String dbms)
-
-