Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql
Class GenericParameter  view GenericParameter download GenericParameter.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.GenericParameter

final class GenericParameter
extends java.lang.Object

A parameter. Originally lifted from ParameterValueSet.


Field Summary
private static int DECIMAL_PARAMETER_DEFAULT_PRECISION
           
private static int DECIMAL_PARAMETER_DEFAULT_SCALE
           
(package private)  java.lang.String declaredClassName
          Compile time Java class name.
private  boolean isReturnOutputParameter
           
(package private)  boolean isSet
           
(package private)  int jdbcTypeId
          Compile time JDBC type identifier.
(package private)  short parameterMode
          Mode of the parameter, from ParameterMetaData
private  GenericParameterValueSet pvs
           
(package private)  int registerOutPrecision
          When a decimal output parameter is registered we give it a precision
(package private)  int registerOutScale
          Scale that has been registered.
(package private)  int registerOutType
          Type that has been registered.
private  org.apache.derby.iapi.types.DataValueDescriptor value
          Our value
 
Constructor Summary
(package private) GenericParameter(GenericParameterValueSet pvs, boolean isReturnOutputParameter)
          Constructor for a Parameter
 
Method Summary
(package private)  void clear()
          Clear the parameter, unless it is a return output parameter
 GenericParameter getClone(GenericParameterValueSet pvs)
          Clone myself.
(package private)  java.lang.String getJDBCParameterNumberStr()
          get string for param number
(package private)  int getPrecision()
           
(package private)  int getScale()
          Return the scale of the parameter.
(package private)  org.apache.derby.iapi.types.DataValueDescriptor getValue()
          Get the parameter value.
(package private)  void setOutParameter(int sqlType, int scale)
          Mark the parameter as an output parameter.
(package private)  void setStorableDataValue(org.apache.derby.iapi.types.DataValueDescriptor value, int jdbcTypeId, java.lang.String className)
          Set the DataValueDescriptor for this parameter.
(package private)  void stuffObject(java.lang.Object newValue)
          do a setValue on the particular field.
private  org.apache.derby.iapi.error.StandardException throwInvalidOutParamMap(int sqlType)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
(package private)  void validate()
          Validate the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DECIMAL_PARAMETER_DEFAULT_PRECISION

private static int DECIMAL_PARAMETER_DEFAULT_PRECISION

DECIMAL_PARAMETER_DEFAULT_SCALE

private static int DECIMAL_PARAMETER_DEFAULT_SCALE

pvs

private final GenericParameterValueSet pvs

value

private org.apache.derby.iapi.types.DataValueDescriptor value
Our value


jdbcTypeId

int jdbcTypeId
Compile time JDBC type identifier.


declaredClassName

java.lang.String declaredClassName
Compile time Java class name.


parameterMode

short parameterMode
Mode of the parameter, from ParameterMetaData


isSet

boolean isSet

isReturnOutputParameter

private final boolean isReturnOutputParameter

registerOutType

int registerOutType
Type that has been registered.


registerOutScale

int registerOutScale
Scale that has been registered.


registerOutPrecision

int registerOutPrecision
When a decimal output parameter is registered we give it a precision

Constructor Detail

GenericParameter

GenericParameter(GenericParameterValueSet pvs,
                 boolean isReturnOutputParameter)
Constructor for a Parameter

Method Detail

getClone

public GenericParameter getClone(GenericParameterValueSet pvs)
Clone myself. It is a shallow copy for everything but the underlying data wrapper and its value -- e.g. for everything but the underlying SQLInt and its int.


setStorableDataValue

void setStorableDataValue(org.apache.derby.iapi.types.DataValueDescriptor value,
                          int jdbcTypeId,
                          java.lang.String className)
Set the DataValueDescriptor for this parameter. If makrAsSet is set, then we consider this parameter both initialized and set. Otherwise, it is just initialized but not yet set.


clear

void clear()
Clear the parameter, unless it is a return output parameter


getValue

org.apache.derby.iapi.types.DataValueDescriptor getValue()
Get the parameter value. Doesn't check to see if it has been initialized or not.


setOutParameter

void setOutParameter(int sqlType,
                     int scale)
               throws org.apache.derby.iapi.error.StandardException
Mark the parameter as an output parameter.


throwInvalidOutParamMap

private org.apache.derby.iapi.error.StandardException throwInvalidOutParamMap(int sqlType)

validate

void validate()
        throws org.apache.derby.iapi.error.StandardException
Validate the parameters. This is done for situations where we cannot validate everything in the setXXX() calls. In particular, before we do an execute() on a CallableStatement, we need to go through the parameters and make sure that all parameters are set up properly. The motivator for this is that setXXX() can be called either before or after registerOutputParamter(), we cannot be sure we have the types correct until we get to execute().


getScale

int getScale()
Return the scale of the parameter.


getPrecision

int getPrecision()

stuffObject

void stuffObject(java.lang.Object newValue)
           throws org.apache.derby.iapi.error.StandardException
do a setValue on the particular field. Doesn't do checks on what it is being set to or on whether it is a return parameter or what. This is only called internally; it is not expected to be called directly as a result of some jdbc call (e.g. setObject()).


getJDBCParameterNumberStr

java.lang.String getJDBCParameterNumberStr()
get string for param number


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).