|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.directives.ForEachClassNameDbColumn
Given a database connection, find all columns containing java classnames and allow an extending class to specify a SQL update statement to be executed on the column.
The columns are determined by looking through the JDBC data for
columns whose names contain the string 'CLASSNAME'. Also, additional
columns which don't follow this naming convention but which are known
to contain java class names are included.
Set the property com.ptc.windchill.upgrade.directives.ForEachClassNameDbColumn.verbose=true
to see the executed SQL on System.err.
Field Summary | |
private static String[][] |
exceptionTableColumns__
|
private Statement |
jdbcStatement
|
private static boolean |
VERBOSE
|
Constructor Summary | |
ForEachClassNameDbColumn()
|
Method Summary | |
private void |
assertValidSql(String sql)
Check that the sql is not null. |
void |
processAllColumns(Connection db_connection)
Traverses all relevant columns calling produceSqlForTableColumn for each one, and executes the sql that that method prepares. |
private void |
processTableColumn(String table_name,
String column_name)
For the specified table and column ask the subclass-defined method produceSqlForTableColumn to prepare a sql statement, check that it is valid and then execute it. |
protected abstract String |
produceSqlForTableColumn(String table_name,
String column_name)
Called for each relevant column. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final boolean VERBOSE
private static final String[][] exceptionTableColumns__
private Statement jdbcStatement
Constructor Detail |
public ForEachClassNameDbColumn()
Method Detail |
public void processAllColumns(Connection db_connection) throws SQLException
produceSqlForTableColumn
for each one, and executes the sql that that method prepares.
SQLException
- if any SQL error occursproduceSqlForTableColumn(java.lang.String, java.lang.String)
private void processTableColumn(String table_name, String column_name) throws SQLException
produceSqlForTableColumn
to prepare a sql statement, check that it is valid and then execute it.
SQLException
- if any SQL error occurs while executing the SQL generated by the subclassprivate void assertValidSql(String sql)
protected abstract String produceSqlForTableColumn(String table_name, String column_name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |