Where Am I? Class Hierarchy All Classes All Fields and Methods

Class com.ibm.db.StatementMetaData

java.lang.Object
   |
   +----com.ibm.db.StatementMetaData

public class StatementMetaData
implements Serializable
extends Object

StatementMetaData represents a SQL statement and associated metadata about the SQL statement, including the actual text of the SQL statement, descriptions of any result columns and any parameters, and a list of the tables referenced in the SQL statement.

For both result columns and parameters, the descriptions include the name and number of the column or parameter, its SQL data type in the database, and the java class your program will use to handle the value. When you add a column or parameter description, you can either explicitly name the java class you want to use, or you can specify an SQL data type that you want the column or parameter treated as. The method will then describe the column or parameter as using the default java class for that SQL data type.

The default mapping of SQL data types to java classes is:
Default Mapping
SQLType Java Class
CHAR java.lang.String
VARCHAR java.lang.String
LONGVARCHAR java.lang.String
TINYINT java.lang.Integer
SMALLINT java.lang.Short
BIGINT java.lang.Long
INTEGER java.lang.Integer
BIT java.lang.Boolean
DECIMAL java.math.BigDecimal
NUMERIC java.math.BigDecimal
REAL java.lang.Float
FLOAT java.lang.Double
DOUBLE java.lang.Double
BINARY byte[]
VARBINARY byte[]
LONGVARBINARY byte[]
DATE java.sql.Date
TIME java.sql.Time
TIMESTAMP java.sql.Timestamp

StatementMetaData objects can be chained. This allows you to specify multiple StatementMetaData objects for a CallableStatement. For a CallableStatement, the first StatementMetaData object describes the CALL statement that executes the stored procedure, including any parameters used for input and/or output. Any StatementMetaData objects chained behind the first one describe result sets that the stored procedure returns.

See Also:
Statement

Field Index

PARM_MODE_INOUT
PARM_MODE_INPUT
PARM_MODE_OUTPUT

Constructor Index

StatementMetaData()
Constructs a new StatementMetaData.

Method Index

addColumn(String, Class, int)
Defines a new column with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value.
addColumn(String, int, int)
Defines a new column with the given name.
addParameter(String, Class, int)
Defines a new parameter with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value.
addParameter(String, Class, int, int)
Defines a new parameter with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value.
addParameter(String, int, int)
Defines a new parameter with the given name and the specified SQLType.
addParameter(String, int, int, int)
Defines a new parameter with the given name and the specified SQLType.
addTable(String)
Defines a table name that is used in this SQL statement.
getColumnClass(int)
Returns the java class that is used for the values of the column.
getColumnClass(String)
Returns the java class that is used for the values of the column.
getColumnCount()
Returns the number of columns in the result set.
getColumnIndex(String)
Returns the index of the column based on its name.
getColumnLength(int)
Returns the length of the indexed column.
getColumnLength(String)
Returns the length of the named column.
getColumnName(int)
Returns the name of the specified column.
getColumnNames()
Returns an enumeration of the column names.
getColumnScale(int)
Returns the scale of the indexed column.
getColumnScale(String)
Returns the scale of the indexed column.
getColumnSQLType(int)
Returns the SQLType of the column in the database.
getColumnSQLType(String)
Returns the SQLType of the named column.
getName()
Returns the name associated with this StatementMetaData.
getNextMetaData()
Returns the next chained StatementMetaData, or null if this is the final StatementMetaData.
getParameterClass(int)
Returns the java class that is used for the value of the parameter.
getParameterClass(String)
Returns the java class that is used for the value of the parameter.
getParameterCount()
Returns the number of parameters that have been defined for this SQL statement.
getParameterIndex(String)
Returns the index of the parameter based on its name.
getParameterLength(int)
Returns the length of the specified parameter.
getParameterLength(String)
Returns the length of the specified parameter.
getParameterMode(int)
Returns the mode of the specified parameter.
getParameterMode(String)
Returns the mode of the specified parameter.
getParameterName(int)
Returns the name of the specified parameter.
getParameterScale(int)
Returns the scale of the specified parameter.
getParameterScale(String)
Returns the scale of the specified parameter.
getParameterSQLType(int)
Returns the SQLType of the specified parameter.
getParameterSQLType(String)
Returns the SQLType of the specified parameter.
getSQL()
Returns the SQL statement for this StatementMetadata.
getTables()
Returns an enumeration of tables for this SQL statement.
removeColumn(int)
Removes the column from the list of defined columns.
removeColumn(String)
Removes the column from the list of defined columns.
removeParameter(int)
Removes the parameter from the list of defined parameters.
removeParameter(String)
Removes the parameter from the list of defined parameters.
removeTable(String)
Removes the table from the list of defined tables.
setColumnLength(int, int)
Sets a user-defined length for the specified column.
setColumnLength(String, int)
Sets a user-defined length for the specified column.
setColumnScale(int, int)
Sets a user-defined scale for the specified column.
setColumnScale(String, int)
Sets a user-defined scale for the specified column.
setColumnSQLType(int, int)
Sets the SQLType of the specified column.
setColumnSQLType(String, int)
Sets the SQLType of the specified column.
setName(String)
Sets the name for this StatementMetaData.
setNextMetaData(StatementMetaData)
Chains the specified StatementMetaData after this one.
setParameterLength(int, int)
Sets a user-defined length for the specified parameter.
setParameterLength(String, int)
Sets a user-defined length for the specified parameter.
setParameterMode(int, int)
Sets a mode for the specified parameter.
setParameterMode(String, int)
Sets a mode for the specified parameter.
setParameterScale(int, int)
Sets a user-defined scale for the specified parameter.
setParameterScale(String, int)
Sets a user-defined scale for the specified parameter.
setParameterSQLType(int, int)
Sets the SQLType for the specified parameter.
setParameterSQLType(String, int)
Sets the SQLType for the specified parameter.
setSQL(String)
Sets the SQL statement for this StatementMetadata.

Fields

PARM_MODE_INOUT
 public static final int PARM_MODE_INOUT

PARM_MODE_INPUT
 public static final int PARM_MODE_INPUT

PARM_MODE_OUTPUT
 public static final int PARM_MODE_OUTPUT


Constructors

StatementMetaData
 public StatementMetaData() 
Constructs a new StatementMetaData.


Methods

addColumn
 public void addColumn(String columnName,
                       Class javaClass,
                       int sourceSQLType) throws DataException
Defines a new column with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value. The index of the defined column is determined by the order in which the columns were defined. The first defined column has an index of 1.

Use the class literal syntax xxx.class to get an instance of a java class to pass as the second parameter, where xxx is the name you would code, for example boolean.class or String.class.

The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
columnName - the name of the column
javaClass - the java class for the column
sourceSQLType - the SQLtype of the column in the database
Throws: DataException
badJavaClass - if the javaClass parameter is null
Throws: DataException
errorMakeField - if the class specified in the javaClass parameter is not supported
Throws: DataException
duplicateColumn - if the column name is a duplicate of an existing column
See Also:
removeColumn
addColumn
 public void addColumn(String columnName,
                       int targetSQLType,
                       int sourceSQLType) throws DataException
Defines a new column with the given name. The index of the defined column is determined by the order in which the columns were defined. The first defined column has an index of 1.

As part of the definition, you define the SQL data type of the column in the database, as well as the SQL data type you want the data treated as. The data will be retrieved into the default java class for the SQL type you want the data treated as. The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
columnName - the name of the column
targetSQLType - the SQLtype that the column will be treated as
sourceSQLType - the SQLtype of the column in the database
Throws: DataException
badSQLType - if the SQLtype is invalid or unsupported
Throws: DataException
duplicateColumn - if the column name is a duplicate of an existing column
See Also:
removeColumn
addParameter
 public void addParameter(String name,
                          Class javaClass,
                          int sourceSQLType) throws DataException
Defines a new parameter with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value. The mode of the parameter defaults to PARM_MODE_INPUT. The index of the defined parameter is determined by the order in which the parameters were defined. The first defined parameter has an index of 1.

Use the class literal syntax xxx.class to get an instance of a java class to pass as the second parameter, where xxx is the name you would code, for example boolean.class or String.class.

The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
parameterName - the name of the parameter
javaClass - the java class to use for input and output of the parameter value
sourceSQLType - the SQLtype of the parameter
Throws: DataException
badJavaClass - if the javaClass parameter is null
Throws: DataException
errorMakeField - if the class specified in the javaClass parameter is not supported
Throws: DataException
duplicateParm - if the parameter name is a duplicate of an existing parameter
See Also:
removeParameter
addParameter
 public void addParameter(String parameterName,
                          Class javaClass,
                          int sourceSQLType,
                          int mode) throws DataException
Defines a new parameter with the given name whose value can be passed as an instance of the specified java class, and whose SQL type is the specified value. The index of the defined parameter is determined by the order in which the parameters were defined. The first defined parameter has an index of 1.

Use the class literal syntax xxx.class to get an instance of a java class to pass as the second parameter, where xxx is the name you would code, for example boolean.class or String.class.

The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
parameterName - the name of the parameter
javaClass - the java class to use for input and output of the parameter value
sourceSQLType - the SQLtype of the parameter
mode - the use of the parameter for input, output, or both
Throws: DataException
badJavaClass - if the javaClass parameter is null
Throws: DataException
errorMakeField - if the class specified in the javaClass parameter is not supported
Throws: DataException
duplicateParm - if the parameter name is a duplicate of an existing parameter
See Also:
removeParameter
addParameter
 public void addParameter(String parameterName,
                          int targetSQLType,
                          int sourceSQLType) throws DataException
Defines a new parameter with the given name and the specified SQLType. The mode of the parameter defaults to PARM_MODE_INPUT. The index of the defined parameter is determined by the order in which the parameters were defined. The first defined parameter has an index of 1.

As part of the definition, you define the SQL data type of the parameter in the database, as well as the SQL data type you want the data treated as. The data will be stored in the default java class for the SQL type you want the data treated as. The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
parameterName - the name of the parameter
targetSQLType - the SQLtype that the parameter will be treated as
sourceSQLType - the SQLtype of the parameter in the database.
mode - the use of the parameter for input, output, or both
Throws: DataException
badSQLType - if the SQLtype is invalid or unsupported
Throws: DataException
duplicateParm - if the parameter name is a duplicate of an existing parameter
See Also:
removeParameter
addParameter
 public void addParameter(String parameterName,
                          int targetSQLType,
                          int sourceSQLType,
                          int mode) throws DataException
Defines a new parameter with the given name and the specified SQLType. The index of the defined parameter is determined by the order in which the parameters were defined. The first defined parameter has an index of 1.

As part of the definition, you define the SQL data type of the parameter in the database, as well as the SQL data type you want the data treated as. The data will be stored in the default java class for the SQL type you want the data treated as. The default java class for each SQL data type is shown in the default mapping table in the overview documentation of the StatementMetaData class itself.

Parameters:
parameterName - the name of the parameter
targetSQLType - the SQLtype that the parameter will be treated as
sourceSQLType - the SQLtype of the parameter in the database.
mode - the use of the parameter for input, output, or both
Throws: DataException
badSQLType - if the SQLtype is invalid or unsupported
Throws: DataException
duplicateParm - if the parameter name is a duplicate of an existing parameter
See Also:
removeParameter
addTable
 public void addTable(String tableName) 
Defines a table name that is used in this SQL statement.

Parameters:
tableName - the table name
See Also:
removeTable
getColumnClass
 public Class getColumnClass(int columnNumber) 
Returns the java class that is used for the values of the column. The index of the first column is 1. If the columns have been defined by addColumn, this method returns the java class used in the definition. If the columns have not been defined by addColumn, the java class is not available until after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
Returns:
the java class for the column
Throws: IndexOutOfBoundsException
if the column index is not defined
getColumnClass
 public Class getColumnClass(String columnName) 
Returns the java class that is used for the values of the column. If the columns have been defined by addColumn, this method returns the java class used in the definition. If the columns have not been defined by addColumn, the java class is not available until after the SQL statement has been executed.

Parameters:
columnName - the name of the column
Returns:
the java class for the column
Throws: IndexOutOfBoundsException
if the column name is not defined
getColumnCount
 public int getColumnCount() 
Returns the number of columns in the result set. If the columns have been defined by addColumn, this method returns the number of columns that have currently been defined. If the columns have not been defined by addColumn, the number of columns is not available until after the SQL statement has been executed.

Returns:
the number of columns
getColumnIndex
 public int getColumnIndex(String columnName) 
Returns the index of the column based on its name. If the columns have been defined by addColumn, this method returns an index representing the order that the columns were defined. If the columns have not been defined by addColumn, the column index is not available until after the SQL statement has been executed. The first defined column has an index of 1.

Parameters:
columnName - the name of the column
Returns:
the column index
Throws: IndexOutOfBoundsException
if the column name is not defined
getColumnLength
 public int getColumnLength(int columnNumber) 
Returns the length of the indexed column. The index of the first column is 1. If the columns have not been defined by addColumn, the length is not available until after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
Returns:
the column length
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
setColumnLength
getColumnLength
 public int getColumnLength(String columnName) 
Returns the length of the named column. If the columns have not been defined by addColumn, the length is not available until after the SQL statement has been executed.

Parameters:
columnName - the name of the column
Returns:
the column length
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
setColumnLength
getColumnName
 public String getColumnName(int columnNumber) 
Returns the name of the specified column. The index of the first column is 1. If the columns have not been defined by addColumn, the name is not available until after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
Returns:
the column name
Throws: IndexOutOfBoundsException
if the column index is not defined
getColumnNames
 public Enumeration getColumnNames() 
Returns an enumeration of the column names. If the columns have been defined by addColumn , this method returns the names of columns that have currently been defined. If the columns have not been defined by addColumn, the names of the columns are not available until after the SQL statement has been executed.

Returns:
the column names
getColumnScale
 public int getColumnScale(int columnNumber) 
Returns the scale of the indexed column. The index of the first column is 1. If the columns have not been defined by addColumn, the scale is not available until after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
Returns:
the column scale
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
setColumnScale
getColumnScale
 public int getColumnScale(String columnName) 
Returns the scale of the indexed column. If the columns have not been defined by addColumn, the scale is not available until after the SQL statement has been executed.

Parameters:
columnName - the name of the column
Returns:
the column scale
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
setColumnScale
getColumnSQLType
 public int getColumnSQLType(int columnNumber) 
Returns the SQLType of the column in the database. The index of the first column is 1. If the columns have not been defined by addColumn, the SQLType is not available until after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
Returns:
the column SQLType
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
setColumnSQLType
getColumnSQLType
 public int getColumnSQLType(String columnName) 
Returns the SQLType of the named column. If the columns have not been defined by addColumn, the SQLType is not available until after the SQL statement has been executed.

Parameters:
columnName - the name of the column
Returns:
the column SQLType
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
setColumnSQLType
getName
 public String getName() 
Returns the name associated with this StatementMetaData.

Returns:
the name of this StatementMetaData
See Also:
setName
getNextMetaData
 public StatementMetaData getNextMetaData() 
Returns the next chained StatementMetaData, or null if this is the final StatementMetaData. Chaining of StatementMetaData objects is used to associate multiple meta data objects with a CallableStatement. For a CallableStatement, the first StatementMetaData object describes the CALL statement that executes the stored procedure, including any parameters used for input and/or output. Any StatementMetaData objects chained behind the first one describe result sets that the stored procedure returns.

Returns:
the next chained StatementMetaData object
See Also:
setNextMetaData
getParameterClass
 public Class getParameterClass(int parameterNumber) 
Returns the java class that is used for the value of the parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the java class for the parameter
Throws: IndexOutOfBoundsException
if the parameter index is not defined
getParameterClass
 public Class getParameterClass(String parameterName) 
Returns the java class that is used for the value of the parameter.

Parameters:
parameterName - the name of the parameter
Returns:
the java class for the parameter
Throws: IndexOutOfBoundsException
if the parameter name is not defined
getParameterCount
 public int getParameterCount() 
Returns the number of parameters that have been defined for this SQL statement.

Returns:
the number of parameters
getParameterIndex
 public int getParameterIndex(String parameterName) 
Returns the index of the parameter based on its name. The first defined parameter has an index of 1.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter index
Throws: IndexOutOfBoundsException
if the parameter name is not defined
getParameterLength
 public int getParameterLength(int parameterNumber) 
Returns the length of the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the parameter length
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
setParameterLength
getParameterLength
 public int getParameterLength(String parameterName) 
Returns the length of the specified parameter.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter length
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
setParameterLength
getParameterMode
 public int getParameterMode(int parameterNumber) 
Returns the mode of the specified parameter. The mode of the parameter indicates whether it is used for input, output, or both input and output. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the parameter mode (PARM_MODE_INPUT, PARM_MODE_OUTPUT, PARM_MODE_INOUT)
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
setParameterMode
getParameterMode
 public int getParameterMode(String parameterName) 
Returns the mode of the specified parameter. The mode of the parameter indicates whether it is used for input, output, or both input and output.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter mode (PARM_MODE_INPUT, PARM_MODE_OUTPUT, PARM_MODE_INOUT)
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
setParameterMode
getParameterName
 public String getParameterName(int parameterNumber) 
Returns the name of the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the parameter name
Throws: IndexOutOfBoundsException
if the parameter index is not defined
getParameterScale
 public int getParameterScale(int parameterNumber) 
Returns the scale of the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the parameter scale
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
setParameterScale
getParameterScale
 public int getParameterScale(String parameterName) 
Returns the scale of the specified parameter.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter scale
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
setParameterScale
getParameterSQLType
 public int getParameterSQLType(int parameterNumber) 
Returns the SQLType of the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Returns:
the parameter SQLType
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
setParameterSQLType
getParameterSQLType
 public int getParameterSQLType(String parameterName) 
Returns the SQLType of the specified parameter.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter SQLType
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
setParameterSQLType
getSQL
 public String getSQL() 
Returns the SQL statement for this StatementMetadata.

Returns:
the SQL statement
See Also:
setSQL
getTables
 public Enumeration getTables() 
Returns an enumeration of tables for this SQL statement.

Returns:
an enumeration of tables for this statement
removeColumn
 public void removeColumn(int columnNumber) 
Removes the column from the list of defined columns. The indexes of any columns after this one are decremented by 1. The index of the first column is 1.

Parameters:
columnNumber - the index of the column
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
addColumn
removeColumn
 public void removeColumn(String columnName) 
Removes the column from the list of defined columns. The indexes of any columns after this one are decremented by 1.

Parameters:
columnName - the name of the column
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
addColumn
removeParameter
 public void removeParameter(int parameterNumber) 
Removes the parameter from the list of defined parameters. The indexes of any parameters after this one are decremented by 1. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
addParameter
removeParameter
 public void removeParameter(String parameterName) 
Removes the parameter from the list of defined parameters. The indexes of any parameters after this one are decremented by 1.

Parameters:
parameterName - the name of the parameter
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
addParameter
removeTable
 public void removeTable(String tableName) throws DataException
Removes the table from the list of defined tables.

Parameters:
tableName - the table name
Throws: DataException
noSuchTable - if the table name is not defined
See Also:
addTable
setColumnLength
 public void setColumnLength(int columnNumber,
                             int definedLength) 
Sets a user-defined length for the specified column. The index of the first column is 1. This method should only be used if the column was defined by addColumn. Otherwise the column length will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
definedLength - the length of the column
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
getColumnLength
setColumnLength
 public void setColumnLength(String columnName,
                             int definedLength) 
Sets a user-defined length for the specified column. This method should only be used if the column was defined by addColumn. Otherwise the column length will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnName - the name of the column
definedLength - the length of the column
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
getColumnLength
setColumnScale
 public void setColumnScale(int columnNumber,
                            int definedScale) 
Sets a user-defined scale for the specified column. The index of the first column is 1. This method should only be used if the column was defined by addColumn. Otherwise the column scale will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
definedScale - the scale of the column
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
getColumnScale
setColumnScale
 public void setColumnScale(String columnName,
                            int definedScale) 
Sets a user-defined scale for the specified column. This method should only be used if the column was defined by addColumn. Otherwise the column scale will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnName - the name of the column
definedScale - the scale of the column
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
getColumnScale
setColumnSQLType
 public void setColumnSQLType(int columnNumber,
                              int type) 
Sets the SQLType of the specified column. The index of the first column is 1. This method should only be used if the column was defined by addColumn. Otherwise the column SQLType will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnNumber - the index of the column
type - the SQLType of the column
Throws: IndexOutOfBoundsException
if the column index is not defined
See Also:
getColumnSQLType
setColumnSQLType
 public void setColumnSQLType(String columnName,
                              int type) 
Sets the SQLType of the specified column. This method should only be used if the column was defined by addColumn. Otherwise the column SQLType will be obtained from the database when the columns are described after the SQL statement has been executed.

Parameters:
columnName - the name of the column
type - the SQLType of the column
Throws: IndexOutOfBoundsException
if the column name is not defined
See Also:
getColumnSQLType
setName
 public void setName(String name) 
Sets the name for this StatementMetaData.

Parameters:
name - the name of this StatementMetaData
See Also:
getName
setNextMetaData
 public void setNextMetaData(StatementMetaData aMetaData) 
Chains the specified StatementMetaData after this one. Chaining of StatementMetaData objects is used to associate multiple meta data objects with a CallableStatement. For a CallableStatement, the first StatementMetaData object describes the CALL statement that executes the stored procedure, including any parameters used for input and/or output. Any StatementMetaData objects chained behind the first one describe result sets that the stored procedure returns.

Parameters:
aMetaData - StatementMetaData to put next in the chain
See Also:
getNextMetaData
setParameterLength
 public void setParameterLength(int parameterNumber,
                                int definedLength) 
Sets a user-defined length for the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
definedLength - the length of the parameter
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
getParameterLength
setParameterLength
 public void setParameterLength(String parameterName,
                                int definedLength) 
Sets a user-defined length for the specified parameter.

Parameters:
parameterName - the name of the parameter
definedLength - the length of the parameter
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
getParameterLength
setParameterMode
 public void setParameterMode(int parameterNumber,
                              int aMode) 
Sets a mode for the specified parameter. The mode of the parameter indicates whether it is used for input, output, or both input and output. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
aMode - the mode of the parameter (PARM_MODE_INPUT, PARM_MODE_OUTPUT, PARM_MODE_INOUT)
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
getParameterMode
setParameterMode
 public void setParameterMode(String parameterName,
                              int aMode) 
Sets a mode for the specified parameter. The mode of the parameter indicates whether it is used for input, output, or both input and output.

Parameters:
parameterName - the name of the parameter
aMode - the mode of the parameter (PARM_MODE_INPUT, PARM_MODE_OUTPUT, PARM_MODE_INOUT)
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
getParameterMode
setParameterScale
 public void setParameterScale(int parameterNumber,
                               int definedScale) 
Sets a user-defined scale for the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
definedScale - the scale of the parameter
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
getParameterScale
setParameterScale
 public void setParameterScale(String parameterName,
                               int definedScale) 
Sets a user-defined scale for the specified parameter.

Parameters:
parameterName - the name of the parameter
definedScale - the scale of the parameter
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
getParameterScale
setParameterSQLType
 public void setParameterSQLType(int parameterNumber,
                                 int type) 
Sets the SQLType for the specified parameter. The index of the first parameter is 1.

Parameters:
parameterNumber - the index of the parameter
type - the SQLType of the parameter
Throws: IndexOutOfBoundsException
if the parameter index is not defined
See Also:
getParameterSQLType
setParameterSQLType
 public void setParameterSQLType(String parameterName,
                                 int type) 
Sets the SQLType for the specified parameter.

Parameters:
parameterName - the name of the parameter
type - the SQLType of the parameter
Throws: IndexOutOfBoundsException
if the parameter name is not defined
See Also:
getParameterSQLType
setSQL
 public void setSQL(String aStatement) 
Sets the SQL statement for this StatementMetadata.

Parameters:
sStatement - the SQL statement
See Also:
getSQL

Where Am I? Class Hierarchy All Classes All Fields and Methods