com.iplanet.jato.model.sql
Class StoredProcSchema

java.lang.Object
  |
  +--com.iplanet.jato.model.sql.StoredProcSchema
All Implemented Interfaces:
java.io.Serializable

public class StoredProcSchema
extends java.lang.Object
implements java.io.Serializable

The schema containing the stored procedure metadata. The metadata provides the minimum required details such as the procedure name and descriptions of any input, output and result parameters. The StoredProcModelBase implementation uses this metadata to prepare the CallableStatement.

Version:
JATO/1.2.2 $Id: StoredProcSchema.java,v 1.9 2002/03/16 03:26:34 todd Exp $
See Also:
StoredProcModel, StoredProcModelBase, StoredProcParameterDescriptor, Serialized Form

Constructor Summary
StoredProcSchema()
          Default constructor
 
Method Summary
 void addParameterDescriptor(StoredProcParameterDescriptor descriptor)
          Adds an input or output parameter descriptor to the schema.
 int getNumParameters()
          Returns the total number of input and output parameters for the procedure.
 StoredProcParameterDescriptor getParameterDescriptor(int index)
          Returns the parameter descriptor at the supplied index from the internal parameter descriptor array.
 StoredProcParameterDescriptor getParameterDescriptor(java.lang.String name)
          Returns the parameter descriptor for a specific parameter.
 StoredProcParameterDescriptor[] getParameterDescriptors()
          Returns the array of StoredProcParameterDescriptor which contains all the StoredProcParameterDescriptors for the input and output parameters.
 java.lang.String getProcedureName()
          Returns the name of the stored procedure.
 StoredProcParameterDescriptor getResultParameterDescriptor()
          Returns the StoredProcParameterDescriptor which describes the result paramter.
 boolean hasResultParameter()
          Returns true if the procedure has a result parameter, false otherwise.
 void setProcedureName(java.lang.String value)
          Sets the name of the stored procedure.
 void setResultParameterDescriptor(StoredProcParameterDescriptor value)
          Sets the result parameter descriptor in the schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredProcSchema

public StoredProcSchema()
Default constructor
Method Detail

getProcedureName

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

setProcedureName

public void setProcedureName(java.lang.String value)
Sets the name of the stored procedure.
Parameters:
value - The stored procedure name.

getNumParameters

public int getNumParameters()
Returns the total number of input and output parameters for the procedure. This count does not take into account the result parameter, if any.

hasResultParameter

public boolean hasResultParameter()
Returns true if the procedure has a result parameter, false otherwise.

getResultParameterDescriptor

public StoredProcParameterDescriptor getResultParameterDescriptor()
Returns the StoredProcParameterDescriptor which describes the result paramter. This method will return null for procdures which do not have result parameters.

setResultParameterDescriptor

public void setResultParameterDescriptor(StoredProcParameterDescriptor value)
Sets the result parameter descriptor in the schema. There may be one and only one result parameter descriptor.
Parameters:
value - The StoredProcParameterDescriptor which describes the result parameter.

getParameterDescriptors

public StoredProcParameterDescriptor[] getParameterDescriptors()
Returns the array of StoredProcParameterDescriptor which contains all the StoredProcParameterDescriptors for the input and output parameters. The array does not contain the StoredProcParameterDescriptor for the result parameter, if any.

addParameterDescriptor

public void addParameterDescriptor(StoredProcParameterDescriptor descriptor)
Adds an input or output parameter descriptor to the schema.
Parameters:
descriptor - A StoredProcParameterDescriptor which describes a particular input or output parameter.
Throws:
java.lang.IllegalArgumentException - Thrown if the supplied descriptor parameter describes the result parameter.
See Also:
setResultParameterDescriptor(StoredProcParameterDescriptor)

getParameterDescriptor

public StoredProcParameterDescriptor getParameterDescriptor(int index)
Returns the parameter descriptor at the supplied index from the internal parameter descriptor array.

getParameterDescriptor

public StoredProcParameterDescriptor getParameterDescriptor(java.lang.String name)
Returns the parameter descriptor for a specific parameter. The name value should correspond to that returned by StoredProcParameterDescriptor.getName().