com.jfw.update
Class DBUpdate
java.lang.Object
com.jfw.update.JFWUpdate
com.jfw.update.DBUpdate
public class DBUpdate
- extends JFWUpdate
Extract files from the sql file. A valid name for the sql file
is one who start with sql, example sql-dateandtime.zip.
Field Summary |
static java.lang.String |
SQL_FILE
The name of the database update file. |
Method Summary |
protected void |
executeSql(java.lang.String sqlList)
Execute the sql commands found in the sql file. |
protected java.lang.String |
getSqlFromFile(java.lang.String path,
java.lang.String fileName)
Get content of the sql file. |
boolean |
start()
Elaborate the web files. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQL_FILE
public static final java.lang.String SQL_FILE
- The name of the database update file. Only files start with this name will
be elaborated by this class.
- See Also:
- Constant Field Values
DBUpdate
public DBUpdate()
start
public boolean start()
throws JFWUpdateException
- Elaborate the web files. The zip file will be extract in same
directory of the sql file.
- Specified by:
start
in class JFWUpdate
- Returns:
- true if has been found an update file, false in other
case.
- Throws:
JFWUpdateException
getSqlFromFile
protected java.lang.String getSqlFromFile(java.lang.String path,
java.lang.String fileName)
throws java.lang.Exception
- Get content of the sql file.
- Parameters:
path
- the path of the sql file.fileName
- the name of the sql file.
- Returns:
- the content of the sql file.
- Throws:
java.lang.Exception
executeSql
protected void executeSql(java.lang.String sqlList)
throws java.lang.Exception
- Execute the sql commands found in the sql file.
- Parameters:
sqlList
- the sql commands. The sql commands are separated by ;.
- Throws:
java.lang.Exception