Class OptTraceViewer

java.lang.Object
org.apache.derby.impl.sql.compile.OptTraceViewer
All Implemented Interfaces:
OptionalTool

public class OptTraceViewer extends Object implements OptionalTool

OptionalTool for viewing the output created when you xml-trace the optimizer.

  • Constructor Details

    • OptTraceViewer

      public OptTraceViewer()
      0-arg constructor required by the OptionalTool contract
  • Method Details

    • loadTool

      public void loadTool(String... configurationParameters) throws SQLException

      Takes the following arguments:

      • fileURL - The url of the file holding the xml trace. E.g.: "file:///Users/me/mainline/z.txt"

      ...and creates the following schema objects for viewing the xml trace of the optimizer:

      • ArrayList - A user-defined type wrapping java.util.ArrayList.
      • asList - A factory function for creating ArrayLists.
      • planCost - An XmlVTI for viewing xml traces.
      • planCost - A view which passes the file name to the XmlVTI.
      Specified by:
      loadTool in interface OptionalTool
      Throws:
      SQLException
    • unloadTool

      public void unloadTool(String... configurationParameters) throws SQLException

      Drop the schema objects which were created for viewing the xml file containing the optimizer trace.

      Specified by:
      unloadTool in interface OptionalTool
      Throws:
      SQLException
    • getDerbyConnection

      private Connection getDerbyConnection() throws SQLException
      /////////////////////////////////////////////////////////////////////
      Throws:
      SQLException
    • executeDDL

      private void executeDDL(Connection conn, String text) throws SQLException
      Throws:
      SQLException
    • prepareStatement

      private PreparedStatement prepareStatement(Connection conn, String text) throws SQLException
      Throws:
      SQLException
    • wrap

      private SQLException wrap(Throwable t)
      Wrap an exception in a SQLException
    • wrap

      private SQLException wrap(String errorMessage)