// OK, What's the SQL we need to execute to generate the target table?
String sql = transMeta.getSQLStatementsString();
// Execute the SQL on the target table:
Database targetDatabase =
new Database( new LoggingObject( "Custom1" ), transMeta.findDatabase( targetDatabaseName ) );
targetDatabase.connect();
targetDatabase.execStatements( sql );
}