public class DBUpgrader
extends org.apache.tools.ant.Task
| Constructor and Description |
|---|
DBUpgrader() |
DBUpgrader(Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
SchemaSpec |
createSchemaSpec()
Creates a new schema spec object.
|
void |
execute() |
Connection |
getConnection()
Gets a connection to the database as configured by this task's attributes.
|
DatabaseType |
getDatabaseType()
Returns the type of database that is being upgraded.
|
Collection<TypeMap> |
getTypeMaps()
Returns the collection of database type mappings.
|
void |
setConnection(Connection connection)
This can be used to programatically override the JDBC connection to be used
by this task.
|
void |
setJdbcPassword(String jdbcPassword)
The database user's credentials used to log into the database.
|
void |
setJdbcUrl(String jdbcUrl)
The URL to the database that is to be upgraded.
|
void |
setJdbcUser(String jdbcUser)
Log into the database as this user.
|
void |
setKeyColumn(String k)
This is the name of the column in the
table that identifies the row that has the schema
version in it. |
void |
setKeyMatch(String m)
This is the value of the
key column that identifies the row whose
value column is the schema version. |
void |
setTable(String t)
The table name that contains the row where the schema version can be found.
|
void |
setTargetSchemaVersion(String v)
This is the schema version that the schema should be upgraded to.
|
void |
setTypeMap(File f)
A file that contains database type mappings.
|
void |
setValueColumn(String v)
The column in the
table whose value is the schema version. |
protected boolean |
shouldExecSpecVersion(SchemaVersion version)
Returns
true if the given version's schema spec should be executed. |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic DBUpgrader()
public DBUpgrader(Connection connection)
public void setJdbcUrl(String jdbcUrl)
jdbcUrl - public void setJdbcUser(String jdbcUser)
jdbcUser - public void setJdbcPassword(String jdbcPassword)
jdbcPassword - public void setValueColumn(String v)
table whose value is the schema version. The value in this column
tells you what version the schema is currently at.v - value column namepublic void setTable(String t)
value column whose value is the schema version and it must have a
key column whose value matches setKeyMatch(String) (which simply
identifies the row that contains the schema version value).t - table namepublic void setKeyColumn(String k)
table that identifies the row that has the schema
version in it. Finding the row where this key column's value is setKeyMatch(String) will get you the row
whose value in the value column is the schema version.k - key column namepublic void setKeyMatch(String m)
key column that identifies the row whose
value column is the schema version.m - key value identifying the row that has the schema versionpublic void setTypeMap(File f)
f - mapping filepublic void setTargetSchemaVersion(String v)
v - schema versionpublic SchemaSpec createSchemaSpec()
public Collection<TypeMap> getTypeMaps()
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionTask.execute()protected boolean shouldExecSpecVersion(SchemaVersion version)
true if the given version's schema spec should be executed.version - true if this version is on the upgrade pathpublic Connection getConnection() throws SQLException
SQLExceptionpublic void setConnection(Connection connection)
connection - public DatabaseType getDatabaseType()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.