com.simba.dsi.ext
Class StoredProcedure

java.lang.Object
  extended by com.simba.dsi.ext.StoredProcedure

public abstract class StoredProcedure
extends java.lang.Object

An abstract class that represents a stored procedure from the DSII.


Constructor Summary
protected StoredProcedure(java.lang.String catalogName, java.lang.String schemaName, java.lang.String procName)
          Constructor.
 
Method Summary
abstract  void execute(java.util.ArrayList<ProcedureParameterValue> parameters)
          Executes the stored procedure, using the given parameters.
 java.lang.String getCatalogName()
          Get the catalog name of the stored procedure.
abstract  java.util.ArrayList<ProcedureParameterMetadata> getParameters()
          Retrieves the parameters for the stored procedure which can provide metadata for each parameter.
 java.lang.String getProcedureName()
          Get the name of the stored procedure.
abstract  ExecutionResults getResults()
          Get the results of the stored procedure.
 java.lang.String getSchemaName()
          Get the schema name of the stored procedure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredProcedure

protected StoredProcedure(java.lang.String catalogName,
                          java.lang.String schemaName,
                          java.lang.String procName)
Constructor.

Parameters:
catalogName - The name of the catalog in which the procedure resides. Can be empty if catalogs are not supported.
schemaName - The name of the schema in which the procedure resides. Can be empty if schemas are not supported.
procName - The name of the stored procedure. Cannot be empty.
Method Detail

execute

public abstract void execute(java.util.ArrayList<ProcedureParameterValue> parameters)
                      throws com.simba.support.exceptions.ErrorException
Executes the stored procedure, using the given parameters.

The parameters used for executing the stored procedure will be provided in the form of an ETValueList containing ETParameters. The parameters will correspond to the parameter metadata provided by getParameters(), and in the case of return, output, and input/output parameters should have their output values set.

After execution, results should be accessible via getResults().

Parameters:
parameters - The parameters to use when executing the stored procedure.
Throws:
com.simba.support.exceptions.ErrorException - if there is an error during execution.

getCatalogName

public java.lang.String getCatalogName()
Get the catalog name of the stored procedure.

Returns:
The catalog name or empty if catalog is not supported.

getParameters

public abstract java.util.ArrayList<ProcedureParameterMetadata> getParameters()
                                                                       throws com.simba.support.exceptions.ErrorException
Retrieves the parameters for the stored procedure which can provide metadata for each parameter.

May return NULL if there are no parameters associated with the stored procedure.

This method may be called after query preparation and before execution.

Returns:
A vector of parameters that provides access to metadata.
Throws:
com.simba.support.exceptions.ErrorException - if there is an error getting the parameters.

getProcedureName

public java.lang.String getProcedureName()
Get the name of the stored procedure.

Returns:
The name of the stored procedure.

getResults

public abstract ExecutionResults getResults()
                                     throws com.simba.support.exceptions.ErrorException
Get the results of the stored procedure.

This function will be called to retrieve the metadata about any result sets that are returned. If no result set is returned but a row count is returned, then a result with that row count should be returned.

If no results are generated, an empty ExecutionResults should be returned.

This method will be called after query preparation and before execution to retrieve metadata about the results that will be returned for this stored procedure. If accurate metadata cannot be supplied, returning at least a single result of the correct type with no metadata will suffice as long as correct metadata is supplied after execute(). Be aware that some applications may have problems if metadata is not available at prepare time.

Returns:
The results of the stored procedure.
Throws:
com.simba.support.exceptions.ErrorException - if an error occurs while retrieving results.

getSchemaName

public java.lang.String getSchemaName()
Get the schema name of the stored procedure.

Returns:
The schema name or empty if schema is not supported.


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.