*/
public void unloadTool( final String... configurationParameters )
throws SQLException
{
try {
final OptTrace tracer = OptimizerTrace.getOptimizerTracer();
boolean needsClosing = false;
PrintWriter pw;
if (
(configurationParameters != null) &&
(configurationParameters.length > 0)
)
{
pw = AccessController.doPrivileged
(
new PrivilegedAction<PrintWriter>()
{
public PrintWriter run()
{
try {
return new PrintWriter( configurationParameters[ 0 ] );
} catch (IOException ioe) { throw new IllegalArgumentException( ioe.getMessage(), ioe ); }
}
}
);
needsClosing = true;
}
else { pw = new PrintWriter( System.out ); }
if ( tracer != null )
{
tracer.printToWriter( pw );
pw.flush();
}
if ( needsClosing ) { pw.close(); }