Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
: Class RealSQLCallableStatement (RealSQL-JDBC) (realsqlcallablestatement.html)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.northgateis.reality.realsql.RealSQLStatement | +--com.northgateis.reality.realsql.RealSQLPreparedStatement | +--com.northgateis.reality.realsql.RealSQLCallableStatement
RealSQLCallableStatement is an implementation of the JDBC 2.0 CallableStatement interface.
When instantiated this object is used to execute an SQL stored procedure, which in a Reality database are DATABASIC subroutines. The stored procedure SQL escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number. The first parameter is 1.
Reality does not support the ability to return a ResultSet when executing a stored procedure, therefore all procedures are regarded as prcedures that perform an update, even though the procedure may or may not perform any physical updates on the database.
{ ?= CALL PROCEDURE_NAME(ARG1, ARG2, ...) }
{ CALL PROCEDURE_NAME(ARG1, ARG2, ...) }
For example the following procedure converts a char-value 'P2' to its corresponding ASCII character string value 'P1' and detects if this character is either a Numeric, or Upper/Lower case leter, returning this in 'P3'.
{ ?= CALL GETCHAR(?, ?) } Where P1 and P3 are registered as OUT parameters and P2 as an IN parameter. GETCHAR is defined by the following DATABASIC subroutine. 001 SUBROUTINE(RESULT, ARG1, ARG2) 002 IF ARG1 >= 48 AND ARG1 <= 59 THEN 003 ARG2 = "Numeric" 004 END ELSE IF ARG1 >= 65 AND ARG1 <= 90 THEN 005 ARG2 = "Upper" 006 END ELSE IF ARG1 >= 97 AND ARG1 <= 122 THEN 007 ARG2 = "Lower" 008 END ELSE 009 ARG2 = "Invalid" 010 END 011 RESULT = CHAR(ARG1) 012 RETURN
CallableStatement
,
Connection.prepareCall(java.lang.String)
,
ResultSet
Method Summary | |
void | clearParameters() Clears the current output parameters. |
boolean | execute() Executes the stored procedure with its current parameter values. |
java.sql.ResultSet | executeQuery() Executes the stored query with its current parameter values. |
int | executeUpdate() Executes the stored update with its current parameter values. |
java.sql.Array | getArray(int index) Currently not supported by the RealSQL-JDBC driver. |
java.math.BigDecimal | getBigDecimal(int index) Retrieves the specified parameter as a BigDecimal value. |
java.math.BigDecimal | getBigDecimal(int index,
int scale) Retrieves the specified parameter as a BigDecimal value. |
java.sql.Blob | getBlob(int index) Currently not supported by the RealSQL-JDBC driver. |
boolean | getBoolean(int index) Retrieves the specified parameter as a boolean value. |
byte | getByte(int index) Retrives the specified parameter as a byte value. |
byte[] | getBytes(int index) Retrieves the specified parameter as a byte[] value. |
java.sql.Clob | getClob(int index) Currently not supported by the RealSQL-JDBC driver. |
java.sql.Date | getDate(int index) Retrieves the specified parameter as a java.sql.Date value. |
java.sql.Date | getDate(int index,
java.util.Calendar cal) JDBC 2.0 Retrieves the specified parameter as a java.sql.Date value, using the given Calendar object. |
double | getDouble(int index) Retrieves the specified parameter as a double value. |
float | getFloat(int index) Retrieves the specified parameter as a float value. |
int | getInt(int index) Retrieves the specified parameter as an integer value. |
long | getLong(int index) Retrieves the specified parameter as a long value. |
java.lang.Object | getObject(int index) Retrieves the specified parameter as a Java object value. |
java.lang.Object | getObject(int index,
java.util.Map map) Currently not supported by the RealSQL-JDBC driver. |
java.sql.Ref | getRef(int index) Currently not supported by the RealSQL-JDBC driver. |
short | getShort(int index) Retrieves the specified parameter as a short value. |
java.lang.String | getString(int index) Rerieves the specified parameter as a String value. |
java.sql.Time | getTime(int index) Retrieved the specified parameter as a Time value. |
java.sql.Time | getTime(int index,
java.util.Calendar cal) Retrieves the specified parameter as a Time value. |
java.sql.Timestamp | getTimestamp(int index) Retrieves the specified parameter as a Timestamp value. |
java.sql.Timestamp | getTimestamp(int index,
java.util.Calendar cal) Retrieves the specified parameter as a Timestamp value. |
void | registerOutParameter(int index,
int sqlType) Registers the OUT parameter in ordinal position index to the JDBC type sqlType. |
void | registerOutParameter(int index,
int sqlType,
int scale) Registers the OUT parameter in ordinal position index to the JDBC type sqlType. |
void | registerOutParameter(int index,
int sqlType,
java.lang.String typeName) Currently not supported by the RealSQL-JDBC driver. |
boolean | wasNull() Indicates whether or not the last OUTPUT parameter read had the value of SQL NULL. |
Methods inherited from class com.northgateis.reality.realsql.RealSQLPreparedStatement |
addBatch,
close,
getInputParam,
getMetaData,
getParamCount,
sendParams,
setArray,
setAsciiStream,
setBigDecimal,
setBinaryStream,
setBlob,
setBoolean,
setByte,
setBytes,
setCharacterStream,
setClob,
setDate,
setDate,
setDouble,
setFloat,
setInt,
setLong,
setNull,
setNull,
setObject,
setObject,
setObject,
setRef,
setShort,
setString,
setTime,
setTime,
setTimestamp,
setTimestamp,
setUnicodeStream,
validateIndex |
Methods inherited from class com.northgateis.reality.realsql.RealSQLStatement |
addBatch,
addResultSet,
cancel,
clearBatch,
clearWarnings,
completeLoad,
execute,
executeBatch,
executeCatalogQuery,
executeCommon,
executeQuery,
executeQueryCommon,
executeStmt,
executeUpdate,
executeUpdateCommon,
getConnection,
getFetchDirection,
getFetchSize,
getMaxFieldSize,
getMaxRows,
getMoreResults,
getQueryTimeout,
getResultSet,
getResultSetConcurrency,
getResultSetType,
getUpdateCount,
getWarnings,
isCatalogQuery,
methodNotSupported,
prepareStmt,
reset,
setCursorName,
setEscapeProcessing,
setFetchDirection,
setFetchSize,
setMaxFieldSize,
setMaxRows,
setQueryTimeout |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public void clearParameters() throws java.sql.SQLException
public boolean execute() throws java.sql.SQLException
Reality does not support stored procedures that return a ResultSet. This method will either return false or throw an SQLException indicating an SQL non-update query has been issued.
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
Reality does not support stored procedures that return a ResultSet, therefore this method will always throw an exception.
public int executeUpdate() throws java.sql.SQLException
The update count returned will always be zero, if necessary clients must use an OUTPUT parameter to return the number of records updated.
public java.sql.Array getArray(int index) throws java.sql.SQLException
JDBC 2.0 Retrieves an Array parameter.
index
- of the parameter to be retrieved.public java.math.BigDecimal getBigDecimal(int index) throws java.sql.SQLException
index
- of the parameter to be retrieved.public java.math.BigDecimal getBigDecimal(int index, int scale) throws java.sql.SQLException
index
- the parameter to be retrieved.scale
- of the BigDecimal value.public java.sql.Blob getBlob(int index) throws java.sql.SQLException
Retrieves the specified parameter as a Blob value.
index
- the parameter to be retrieved.public boolean getBoolean(int index) throws java.sql.SQLException
index
- the parameter to retrieved.public byte getByte(int index) throws java.sql.SQLException
index
- the paramter to be retrieved.public byte[] getBytes(int index) throws java.sql.SQLException
index
- the paramter to be retrieved.byte
- array value specified by index.public java.sql.Clob getClob(int index) throws java.sql.SQLException
Retrieves the specified parameter as a Clob value.
index
- the parameter to be retrieved.public java.sql.Date getDate(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.sql.Date getDate(int index, java.util.Calendar cal) throws java.sql.SQLException
index
- the parameter to be retrieved.cal
- the Calendar to use.public double getDouble(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public float getFloat(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public int getInt(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public long getLong(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.lang.Object getObject(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.lang.Object getObject(int index, java.util.Map map) throws java.sql.SQLException
Retrieves the specified parameter as a Java object value according to the SQL type specified, uses map for the custom mapping of the parameter value.
index
- the parameter to be retrieved.map
- the object to use.public java.sql.Ref getRef(int index) throws java.sql.SQLException
Retrieves the specified parameter as a Ref value.
index
- the parameter to be retrieved.public short getShort(int index) throws java.sql.SQLException
index
- the parameter to be retrived.public java.lang.String getString(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.sql.Time getTime(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.sql.Time getTime(int index, java.util.Calendar cal) throws java.sql.SQLException
index
- the parameter to be retrieved.cal
- the Calendar to use.public java.sql.Timestamp getTimestamp(int index) throws java.sql.SQLException
index
- the parameter to be retrieved.public java.sql.Timestamp getTimestamp(int index, java.util.Calendar cal) throws java.sql.SQLException
index
- the parameter to be retrieved.cal
- the Calendar to use.public void registerOutParameter(int index, int sqlType) throws java.sql.SQLException
index
- of the output parameter being registered.sqlType
- the JDBC Data Type.public void registerOutParameter(int index, int sqlType, int scale) throws java.sql.SQLException
index
- of the output parameter being registered.sqlType
- the JDBC Data Type.scale
- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.public void registerOutParameter(int index, int sqlType, java.lang.String typeName) throws java.sql.SQLException
Registers the OUT parameter in ordinal position index to the JDBC type sqlType. This version of the method registerOutParameter should be used for a user-named or REF output parameter.
Reality does not support a user-named or REF output parameter.
index
- of the output parameter being registered.sqlType
- the JDBC Data Type.typeName
- the fully-qualified name of an SQL structured type; not used.public boolean wasNull() throws java.sql.SQLException
Reality interprets a zero-length value to be a NULL value.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |