Package org.apache.derby.iapi.sql.compile

Examples of org.apache.derby.iapi.sql.compile.OptTrace


     * </ul>
     */
    public  void    loadTool( String... configurationParameters )
        throws SQLException
    {
        OptTrace    tracer;

        if ( (configurationParameters == null) || (configurationParameters.length == 0) )
        {
            tracer = new DefaultOptTrace();
        }
View Full Code Here


     */
    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(); }
           
View Full Code Here

   *
   * @param onOrOff    Whether to turn optimizer tracing on (true) or off (false).
   */
  public static void setOptimizerTrace( boolean onOrOff )
  {
        OptTrace    optimizerTracer = onOrOff ? new DefaultOptTrace() : null;

        setOptimizerTracer( optimizerTracer );
  }
View Full Code Here

    try
    {
      // Get the current language connection context.  This is associated
      // with the current database.
      LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
            OptTrace    tracer = lcc.getOptimizerTracer();

            if ( tracer != null )
            {
                StringWriter    sw = new StringWriter();
                PrintWriter     pw = new PrintWriter( sw );

                tracer.printToWriter( pw );
                pw.flush();
                sw.flush();

                retCode = sw.toString();
            }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.compile.OptTrace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.