Class OptTraceViewer
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.OptTraceViewer
-
- All Implemented Interfaces:
OptionalTool
public class OptTraceViewer extends java.lang.Object implements OptionalTool
OptionalTool for viewing the output created when you xml-trace the optimizer.
-
-
Constructor Summary
Constructors Constructor Description OptTraceViewer()
0-arg constructor required by the OptionalTool contract
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
executeDDL(java.sql.Connection conn, java.lang.String text)
private java.sql.Connection
getDerbyConnection()
void
loadTool(java.lang.String... configurationParameters)
Takes the following arguments:private java.sql.PreparedStatement
prepareStatement(java.sql.Connection conn, java.lang.String text)
void
unloadTool(java.lang.String... configurationParameters)
Drop the schema objects which were created for viewing the xml file containing the optimizer trace.private java.sql.SQLException
wrap(java.lang.String errorMessage)
private java.sql.SQLException
wrap(java.lang.Throwable t)
Wrap an exception in a SQLException
-
-
-
Method Detail
-
loadTool
public void loadTool(java.lang.String... configurationParameters) throws java.sql.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 interfaceOptionalTool
- Throws:
java.sql.SQLException
-
unloadTool
public void unloadTool(java.lang.String... configurationParameters) throws java.sql.SQLException
Drop the schema objects which were created for viewing the xml file containing the optimizer trace.
- Specified by:
unloadTool
in interfaceOptionalTool
- Throws:
java.sql.SQLException
-
getDerbyConnection
private java.sql.Connection getDerbyConnection() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeDDL
private void executeDDL(java.sql.Connection conn, java.lang.String text) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
prepareStatement
private java.sql.PreparedStatement prepareStatement(java.sql.Connection conn, java.lang.String text) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
wrap
private java.sql.SQLException wrap(java.lang.Throwable t)
Wrap an exception in a SQLException
-
wrap
private java.sql.SQLException wrap(java.lang.String errorMessage)
-
-