Interface CommandPreProcessor


public interface CommandPreProcessor
Interface for command pre-processors

Pre-processors provide an extension point within Jena JDBC which allows for arbitrary manipulation of the incoming command text and the parsed SPARQL queries and updates to be carried out. The intention of this is to provide a mechanism by which users can modify the behavior of the module to deal with any peculiarities in behavior that particular JDBC based tools may exhibit when attempting to use them with Jena JDBC drivers.

  • Method Details

    • initialize

      void initialize(Properties props) throws SQLException
      Initializes the pre-processor

      Called when the pre-processor is first created, properties object provides access to all connection configuration parameters except password

      Parameters:
      props - Connection properties
      Throws:
      SQLException - Thrown if there is a problem initializing the pre-processor
    • preProcessCommandText

      String preProcessCommandText(String text) throws SQLException
      Pre-process incoming command text

      This is invoked before Jena JDBC has attempted to determine whether the text is a query/update. This allows an application to do textual clean up/alteration of the incoming command if it so desires.

      Parameters:
      text - Command Text
      Returns:
      Command Text which may have been altered
      Throws:
      SQLException - Thrown if pre-processing encounters an issue
    • preProcessQuery

      Query preProcessQuery(Query q) throws SQLException
      Pre-process a query

      This is invoked during query execution prior to Jena JDBC making any of its own manipulations on the query e.g. using Statement.setMaxRows(int) to add a LIMIT clause.

      Parameters:
      q - Query
      Returns:
      Query which may have been altered
      Throws:
      SQLException - Thrown if pre-processing encounters an issue
    • preProcessUpdate

      UpdateRequest preProcessUpdate(UpdateRequest u) throws SQLException
      Pre-process an update

      This is invoked during update execution prior to Jena JDBC making any of its own manipulations on the update.

      Parameters:
      u - Update
      Returns:
      Update which may have been altered
      Throws:
      SQLException - Thrown if pre-processing encounters an issue