public class StoredProcedure extends Object
MultiQueryMetaData
which holds the metadata
about what the user has specified.
Modifier and Type | Class and Description |
---|---|
static class |
StoredProcedure.PARAM
An enumeration on type of parameter for a Stored Procedure.
|
static class |
StoredProcedure.SQL |
Constructor and Description |
---|
StoredProcedure(ResultSet rs)
1.
|
StoredProcedure(String name)
Create a procedure of the given name.
|
Modifier and Type | Method and Description |
---|---|
StoredProcedure |
addParameter(StoredProcedure.PARAM param,
String var,
String typeName)
Adds the given parameter declaration.
|
StoredProcedure |
addParameter(String var,
String typeName)
Adds an
IN parameter of the given name and type. |
String |
getCallSQL()
Gets the SQL for calling this procedure.
|
Column[] |
getColumns() |
String |
getCreateSQL()
Gets the SQL for creating this procedure.
|
String |
getDropSQL()
Gets the SQL for dropping this procedure.
|
Column[] |
getInColumns() |
Column[] |
getInOutColumns() |
String |
getName()
Gets the name of this procedure.
|
Column[] |
getOutColumns() |
Column[] |
getResultColumns() |
Column[] |
getReturnColumns() |
void |
setCatalog(DBIdentifier catalog) |
StoredProcedure |
setExternalName(Class<?> cls,
String method,
Class<?>... paramTypes) |
StoredProcedure |
setLanguage(String language) |
void |
setName(String name) |
StoredProcedure |
setParameterStyle(String lang)
Sets the language whose parameter passing convention will be used to pass paramater values.
|
StoredProcedure |
setResult(int i) |
StoredProcedure |
setResult(int i,
boolean dynamic) |
void |
setSchema(DBIdentifier schema) |
StoredProcedure |
setSQL(StoredProcedure.SQL sql)
Adds a read SQL statement via an external method.
|
String |
toString() |
public StoredProcedure(String name)
public StoredProcedure(ResultSet rs) throws SQLException
1. PROCEDURE_CAT - String - the procedure catalog name 2. PROCEDURE_SCHEM - String - the procedure schema name (possibly null) 3. PROCEDURE_NAME - String - the procedure name 4. COLUMN_NAME - String - the name of the column 5. COLUMN_TYPE - short - the kind of column or parameter, as follows: DatabaseMetaData.procedureColumnUnknown - type unknown DatabaseMetaData.procedureColumnIn - an IN parameter DatabaseMetaData.procedureColumnInOut - an INOUT parameter DatabaseMetaData.procedureColumnOut - an OUT parameter DatabaseMetaData.procedureColumnReturn - a return value DatabaseMetaData.procedureReturnsResult - a result column in a result set 6. DATA_TYPE - int - the SQL type of the data, as in java.sql.Types 7. TYPE_NAME - String - the SQL type name, for a UDT it is fully qualified 8. PRECISION - int - the precision 9. LENGTH - int - the length of the data in bytes 10.SCALE - short - the scale for numeric types 11.RADIX - short - the Radix for numeric data (typically 2 or 10) 12.NULLABLE - short - can the data contain null: DatabaseMetaData.procedureNoNulls - NULLs not permitted DatabaseMetaData.procedureNullable - NULLs are permitted DatabaseMetaData.procedureNullableUnknown - NULL status unknown 13.REMARKS - String - an explanatory comment about the data item
SQLException
public void setCatalog(DBIdentifier catalog)
public void setSchema(DBIdentifier schema)
public void setName(String name)
public Column[] getInColumns()
public Column[] getInOutColumns()
public Column[] getOutColumns()
public Column[] getReturnColumns()
public Column[] getResultColumns()
public Column[] getColumns()
public String getName()
public StoredProcedure addParameter(String var, String typeName)
IN
parameter of the given name and type.var
- name of the variabletypeName
- name of the SQL type e.g. VARCAR(32)
public StoredProcedure addParameter(StoredProcedure.PARAM param, String var, String typeName)
param
- type of parameter.var
- name of the variabletypeName
- name of the SQL type e.g. VARCAR(32)
public StoredProcedure setLanguage(String language)
public String getCreateSQL()
public String getDropSQL()
public String getCallSQL()
public StoredProcedure setSQL(StoredProcedure.SQL sql)
public StoredProcedure setParameterStyle(String lang)
lang
- public StoredProcedure setExternalName(Class<?> cls, String method, Class<?>... paramTypes)
public StoredProcedure setResult(int i)
public StoredProcedure setResult(int i, boolean dynamic)
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.