com.simba.dsi.dataengine.utilities
Class ParameterMetadata

java.lang.Object
  extended by com.simba.dsi.dataengine.utilities.ParameterMetadata
Direct Known Subclasses:
ProcedureParameterMetadata

public class ParameterMetadata
extends java.lang.Object

A ParameterMetadata describes a single parameter from a SQL statement.


Field Summary
protected  long m_columnLength
          Indicates the length or maximum length of a parameter.
protected  boolean m_isCaseSensitive
          Indicates whether the parameter is case sensitive or not.
protected  java.lang.String m_name
          Holds the name of the parameter, or null if it is unnamed.
protected  Nullable m_nullable
          The parameter's nullability indicator.
protected  int m_parameterNumber
          Parameter index, starting from 1.
protected  ParameterType m_parameterType
          Indicates whether the parameter is used for input, output, or both.
protected  TypeMetadata m_typeMetadata
          Provides information about the type of data in the parameter.
 
Constructor Summary
ParameterMetadata(int parameterNumber, ParameterType parameterType, int sqlType)
          Constructor that sets defaults for the associated metadata.
ParameterMetadata(int parameterNumber, ParameterType parameterType, int sqlType, boolean isSigned)
          Constructor that sets defaults for the associated metadata.
ParameterMetadata(int parameterNumber, ParameterType parameterType, TypeMetadata typeMetadata, long columnLength, java.lang.String name, boolean caseSensitive, Nullable nullable)
          Constructor.
 
Method Summary
 long getColumnLength()
          Returns the length or maximum length of values held by the parameter.
 ColumnMetadata getEquivalentColumnMeta()
          Method to return an equivalent ColumnMetadata for the parameter metadata.
 java.lang.String getName()
          Returns the parameter's name, or null if it is unnamed.
 Nullable getNullable()
          Returns information about the nullability of the parameter.
 int getParameterNumber()
          Gets the parameter's index within the query, starting with 1.
 ParameterType getParameterType()
          Indicates whether the parameter is used for input data, output data, or both.
 TypeMetadata getTypeMetadata()
          Returns information about the type of data held in the parameter.
 boolean isCaseSensitive()
          Indicates whether the parameter is case sensitive.
 boolean isUnnamed()
          Indicates whether the parameter is considered "unnamed".
 void setCaseSensitive(boolean isCaseSensitive)
          Sets whether the parameter is case sensitive.
 void setColumnLength(long length)
          SEts the length or maximum length of values held by the parameter.
 void setConvertInputToString(boolean inputToString)
          Sets whether or not parameter data that is passed as input will be converted to String, rather than being passed as the reported parameter type.
 void setName(java.lang.String name)
          Sets the parameter's name
 void setNullable(Nullable nullable)
          Sets information about the nullability of the parameter.
 boolean shouldConvertInputToString()
          Determine if the input data should be converted to String instead of the reported type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_parameterNumber

protected int m_parameterNumber
Parameter index, starting from 1.


m_parameterType

protected ParameterType m_parameterType
Indicates whether the parameter is used for input, output, or both.


m_typeMetadata

protected TypeMetadata m_typeMetadata
Provides information about the type of data in the parameter.


m_columnLength

protected long m_columnLength
Indicates the length or maximum length of a parameter. Only used for parameters of character or binary data type.


m_name

protected java.lang.String m_name
Holds the name of the parameter, or null if it is unnamed.


m_isCaseSensitive

protected boolean m_isCaseSensitive
Indicates whether the parameter is case sensitive or not.


m_nullable

protected Nullable m_nullable
The parameter's nullability indicator.

Constructor Detail

ParameterMetadata

public ParameterMetadata(int parameterNumber,
                         ParameterType parameterType,
                         int sqlType)
                  throws com.simba.support.exceptions.ErrorException
Constructor that sets defaults for the associated metadata.

Parameters:
parameterNumber - Parameter index, starting with 1.
parameterType - Indicates if the parameter is for input, output, or both.
sqlType - The parameter's data type.
Throws:
com.simba.support.exceptions.ErrorException - If SQL Type is unrecognised and the associated TypeMetadata cannot be created.

ParameterMetadata

public ParameterMetadata(int parameterNumber,
                         ParameterType parameterType,
                         int sqlType,
                         boolean isSigned)
                  throws com.simba.support.exceptions.ErrorException
Constructor that sets defaults for the associated metadata.

Parameters:
parameterNumber - Parameter index, starting with 1.
parameterType - Indicates if the parameter is for input, output, or both.
sqlType - The parameter's data type.
isSigned - Indicates if the parameter is signed.
Throws:
com.simba.support.exceptions.ErrorException - If SQL Type is unrecognised and the associated TypeMetadata cannot be created.

ParameterMetadata

public ParameterMetadata(int parameterNumber,
                         ParameterType parameterType,
                         TypeMetadata typeMetadata,
                         long columnLength,
                         java.lang.String name,
                         boolean caseSensitive,
                         Nullable nullable)
Constructor.

Parameters:
parameterNumber - Parameter index, starting with 1.
parameterType - Indicates if the parameter is for input, output, or both.
typeMetadata - Information about the parameter's data type.
columnLength - Length or maximum length for character or binary type. Value is ignored for other types.
name - Parameter name. Use null if the parameter is unnamed.
caseSensitive - Indicates if the parameter is case sensitive or not.
nullable - Indicates if the parameter can hold NULL values.
Method Detail

getEquivalentColumnMeta

public ColumnMetadata getEquivalentColumnMeta()
Method to return an equivalent ColumnMetadata for the parameter metadata.

Returns:
Equivalent Column metadata.

getColumnLength

public long getColumnLength()
Returns the length or maximum length of values held by the parameter. Only applies to parameter with character or binary data types.

Returns:
Column length for character or binary data type

getName

public java.lang.String getName()
Returns the parameter's name, or null if it is unnamed.

Returns:
Parameter name or null.

getNullable

public Nullable getNullable()
Returns information about the nullability of the parameter.

The nullability is NULLABLE_UNKNOWN by default.

Returns:
Nullable enum giving the parameter's nullability.

getParameterNumber

public int getParameterNumber()
Gets the parameter's index within the query, starting with 1.

Returns:
Parameter index.

getParameterType

public ParameterType getParameterType()
Indicates whether the parameter is used for input data, output data, or both.

Returns:
Parameter type.

getTypeMetadata

public TypeMetadata getTypeMetadata()
Returns information about the type of data held in the parameter.

Returns:
Parameter type metadata.

isCaseSensitive

public boolean isCaseSensitive()
Indicates whether the parameter is case sensitive.

Returns:
true if case sensitive; false otherwise.

isUnnamed

public boolean isUnnamed()
Indicates whether the parameter is considered "unnamed".

Returns:
Unnamed indicator.

setCaseSensitive

public void setCaseSensitive(boolean isCaseSensitive)
Sets whether the parameter is case sensitive.

Parameters:
isCaseSensitive - Case sensitivity indicator.

setColumnLength

public void setColumnLength(long length)
SEts the length or maximum length of values held by the parameter. Only applies to parameter with character or binary data types.

Parameters:
length - Column length for character or binary data type.

setConvertInputToString

public void setConvertInputToString(boolean inputToString)
Sets whether or not parameter data that is passed as input will be converted to String, rather than being passed as the reported parameter type. Note that this only affects input parameters, and is only available where the conversion is supported. This will also not affect data that is pushed in chunks. The data will be made available via DataWrapper.getVarChar().

Parameters:
inputToString - true to convert to String when passed as input; false otherwise.

setName

public void setName(java.lang.String name)
Sets the parameter's name

Parameters:
name - Parameter name, or null if unnamed.

setNullable

public void setNullable(Nullable nullable)
Sets information about the nullability of the parameter.

The nullability is NULLABLE_UNKNOWN by default.

Parameters:
nullable - Nullable enum giving the parameter's nullability.

shouldConvertInputToString

public boolean shouldConvertInputToString()
Determine if the input data should be converted to String instead of the reported type.

Returns:
true to convert to String when passed as input; false otherwise.


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