Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.upgrade.tasks
Class AbstractDatabaseUpgradeTask

java.lang.Object
  extended by com.jivesoftware.forum.upgrade.tasks.AbstractDatabaseUpgradeTask
All Implemented Interfaces:
UpgradeTask
Direct Known Subclasses:
AddIndexesTask, AddTagIndexes, CreateAutoSave, CreateCommunityEverywhere, CreatePostReplyViaEmail, CreateTags, CreateVersionTable, ModifyAttachmentContentTypeSize, ModifyUserProfileSize, ModifyUserProfileSize2, ResetHTMLFilterValuesUpgradeTask, UpdateDigestEmailTemplate, Version410

public abstract class AbstractDatabaseUpgradeTask
extends java.lang.Object
implements UpgradeTask

An upgrade task that can be used to execute a sql script.


Constructor Summary
AbstractDatabaseUpgradeTask()
           
 
Method Summary
protected  boolean doesTableExist(java.lang.String tableName)
          Return true if the specified table exists, false otherwise.
protected  void executeSQLScript(java.lang.String script)
          Executes a SQL script.
protected static int executeStatement(java.lang.String sql)
          Executes a sql statement.
protected  boolean isSQLCommandPart(java.lang.String line)
          Returns true if a line from a SQL schema is a valid command part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jivesoftware.forum.upgrade.UpgradeTask
doTask, getDescription, getEstimatedRunTime, getInstructionsFile, getName
 

Constructor Detail

AbstractDatabaseUpgradeTask

public AbstractDatabaseUpgradeTask()
Method Detail

executeSQLScript

protected void executeSQLScript(java.lang.String script)
                         throws java.io.IOException,
                                java.sql.SQLException
Executes a SQL script.

Parameters:
script - the script to execute.
Throws:
java.io.IOException - if an IOException occurs.
java.sql.SQLException - if an SQLException occurs.

isSQLCommandPart

protected boolean isSQLCommandPart(java.lang.String line)
Returns true if a line from a SQL schema is a valid command part.

Parameters:
line - the line of the schema.
Returns:
true if a valid command part.

executeStatement

protected static int executeStatement(java.lang.String sql)
                               throws java.sql.SQLException
Executes a sql statement.

Parameters:
sql - the sql statement to execute
Returns:
either (1) the row count for INSERT, UPDATE, or DELETE statements or (2) 0 for SQL statements that return nothing
Throws:
java.sql.SQLException - if the statement could not be executed.

doesTableExist

protected boolean doesTableExist(java.lang.String tableName)
Return true if the specified table exists, false otherwise.

Parameters:
tableName - the name of the table
Returns:
true if the table exists, false otherwise.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.