Mimer JDBC Engine 2.12

com.mimer.jdbc
Class CallableStatement

java.lang.Object
  |
  +--com.mimer.jdbc.Statement
        |
        +--com.mimer.jdbc.PreparedStatement
              |
              +--com.mimer.jdbc.CallableStatement
All Implemented Interfaces:
CallableStatement, PreparedStatement, Statement

public final class CallableStatement
extends PreparedStatement
implements CallableStatement

CallableStatement is the most generic object for executing SQL statements. Any SQL statement may be executed using CallableStatement. The main difference from PreparedStatement is that this object may handle output parameters.


Field Summary
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Method Summary
 Array getArray(int parameterIndex)
          Returns an SQL ARRAY object from an output parameter.
 BigDecimal getBigDecimal(int parameterIndex)
          Returns a java.math.BigDecimal object without scale.
 BigDecimal getBigDecimal(int parameterIndex, int scale)
          Returns a java.math.BigDecimal object with scale specification.
 Blob getBlob(int parameterIndex)
          Get a BLOB LOCATOR object.
 boolean getBoolean(int parameterIndex)
          Returns a boolean.
 byte getByte(int parameterIndex)
          Returns a byte.
 byte[] getBytes(int parameterIndex)
          Returns an array of bytes.
 Clob getClob(int parameterIndex)
          Get a CLOB LOCATOR object.
 Date getDate(int parameterIndex)
          Returns a Date.
 Date getDate(int parameterIndex, Calendar cal)
          Returns a Date with time zone compensation.
 double getDouble(int parameterIndex)
          Returns a double.
 float getFloat(int parameterIndex)
          Returns a float.
 int getInt(int parameterIndex)
          Returns an integer.
 long getLong(int parameterIndex)
          Returns an long.
 Object getObject(int parameterIndex)
          Returns an object.
 Object getObject(int parameterIndex, Map map)
          Returns an object using a type map.
 Ref getRef(int parameterIndex)
          Returns an object reference.
 short getShort(int parameterIndex)
          Returns a short.
 String getString(int parameterIndex)
          Returns a string.
 Time getTime(int parameterIndex)
          Returns a time.
 Time getTime(int parameterIndex, Calendar cal)
          Returns a Time with time zone compensation.
 Timestamp getTimestamp(int parameterIndex)
          Returns a timestamp.
 Timestamp getTimestamp(int parameterIndex, Calendar cal)
          Get a timestamp with timezone compensation.
 void registerOutParameter(int parameterIndex, int sqlType)
          Registers a type to an output parameter.
 void registerOutParameter(int parameterIndex, int sqlType, int scale)
          Registers a type to an output parameter.
 void registerOutParameter(int parameterIndex, int sqlType, String typeName)
          Registers a type to an output parameter.
 boolean wasNull()
          Returns true if the last column read was a NULL.
 
Methods inherited from class com.mimer.jdbc.PreparedStatement
addBatch, clearBatch, clearParameters, close, execute, executeBatch, executeQuery, executeUpdate, getMetaData, 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
 
Methods inherited from class com.mimer.jdbc.Statement
addBatch, cancel, clearStatement, clearWarnings, execute, executeQuery, executeUpdate, getConnection, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.CallableStatement
getArray, getBigDecimal, getBlob, getBoolean, getByte, getBytes, getClob, getDate, getDate, getDouble, getFloat, getInt, getLong, getObject, getObject, getRef, getShort, getString, getTime, getTime, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setBigDecimal, setBinaryStream, setBoolean, setByte, setBytes, setCharacterStream, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setURL
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, 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, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

getArray

public Array getArray(int parameterIndex)
               throws SQLException
Returns an SQL ARRAY object from an output parameter. Mimer SQL does not support SQL-99 ARRAY. Calls to this method will always throw an exception.

Specified by:
getArray in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
Always - throws SQLException, with SQLSTATE 2200G (type mismatch).
SQLException

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex)
                         throws SQLException
Returns a java.math.BigDecimal object without scale.

Specified by:
getBigDecimal in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex,
                                int scale)
                         throws SQLException
Returns a java.math.BigDecimal object with scale specification.

Specified by:
getBigDecimal in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
scale - The maximum number of digits to the right of the decimal point.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getBlob

public Blob getBlob(int parameterIndex)
             throws SQLException
Get a BLOB LOCATOR object.

Specified by:
getBlob in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

getBoolean

public boolean getBoolean(int parameterIndex)
                   throws SQLException
Returns a boolean.

If the parameter is a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING, this returns true if the character has the values "true" or "1".

Specified by:
getBoolean in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getByte

public byte getByte(int parameterIndex)
             throws SQLException
Returns a byte.

Specified by:
getByte in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into a byte. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getBytes

public byte[] getBytes(int parameterIndex)
                throws SQLException
Returns an array of bytes.

Specified by:
getBytes in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 08S01 is thrown on a network receive error. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getClob

public Clob getClob(int parameterIndex)
             throws SQLException
Get a CLOB LOCATOR object.

Specified by:
getClob in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

getDate

public Date getDate(int parameterIndex)
             throws SQLException
Returns a Date.

See ResultSet.getDate(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Date object.

Specified by:
getDate in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 if the parameter type was a character which could not be casted to a date. 2200G is thrown if the parameter type wasn't castable to a date, see ResultSet for an overview of which parameter types are castable to which Java types.
See Also:
getDate(int,Calendar)

getDate

public Date getDate(int parameterIndex,
                    Calendar cal)
             throws SQLException
Returns a Date with time zone compensation.

See ResultSet.getDate(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Date object.

Specified by:
getDate in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
cal - Calendar object defining time zone.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 if the parameter type was a character which could not be casted to a date. 2200G is thrown if the parameter type wasn't castable to a date, see ResultSet for an overview of which parameter types are castable to which Java types.

getDouble

public double getDouble(int parameterIndex)
                 throws SQLException
Returns a double.

Specified by:
getDouble in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into a double. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getFloat

public float getFloat(int parameterIndex)
               throws SQLException
Returns a float.

Specified by:
getFloat in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into a float. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getInt

public int getInt(int parameterIndex)
           throws SQLException
Returns an integer.

Specified by:
getInt in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an int. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getLong

public long getLong(int parameterIndex)
             throws SQLException
Returns an long.

Specified by:
getLong in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an long. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a string, see ResultSet for an overview of which parameter types are castable to which Java types.

getObject

public Object getObject(int parameterIndex)
                 throws SQLException
Returns an object.

Specified by:
getObject in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is not valid.

getObject

public Object getObject(int parameterIndex,
                        Map map)
                 throws SQLException
Returns an object using a type map. Mimer SQL does not support user defined data types. This is scheduled to be introduced in Mimer 10.1, to be released in 2004. The type map is for the time being ignored.

Specified by:
getObject in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
map - The type map to use.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is not valid.

getRef

public Ref getRef(int parameterIndex)
           throws SQLException
Returns an object reference. Mimer SQL does not support object references. This call will always throw an exception.

Specified by:
getRef in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
Always - throws SQLException, with SQLSTATE 2200G (type mismatch).
SQLException

getShort

public short getShort(int parameterIndex)
               throws SQLException
Returns a short.

Specified by:
getShort in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an short. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the parameter type wasn't castable to a short, see ResultSet for an overview of which parameter types are castable to which Java types.

getString

public String getString(int parameterIndex)
                 throws SQLException
Returns a string.

Specified by:
getString in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

getTime

public Time getTime(int parameterIndex)
             throws SQLException
Returns a time.

See ResultSet.getTime(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Time object.

A warning (SQLWarning SQLSTATE 01S07) is registered if the time or timestamp contains a fraction that was truncated because the java time object doesn't hold second fractions.

Specified by:
getTime in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 is thrown if a character value could not be casted to a time value. 2200G is thrown if the parameter type wasn't castable to a time, see ResultSet for an overview of which parameter types are castable to which Java types.

getTime

public Time getTime(int parameterIndex,
                    Calendar cal)
             throws SQLException
Returns a Time with time zone compensation.

See ResultSet.getTime(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Time object.

Specified by:
getTime in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
cal - Calendar object defining time zone.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 if the parameter type was a character which could not be casted to a time. 2200G is thrown if the parameter type wasn't castable to a time, see ResultSet for an overview of which parameter types are castable to which Java types.

getTimestamp

public Timestamp getTimestamp(int parameterIndex)
                       throws SQLException
Returns a timestamp.

See ResultSet.getTime(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Timestamp object.

Specified by:
getTimestamp in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 is thrown if a character value could not be casted to a timestamp value. 2200G is thrown if the parameter type wasn't castable to a timestamp, see ResultSet for an overview of which parameter types are castable to which Java types.

getTimestamp

public Timestamp getTimestamp(int parameterIndex,
                              Calendar cal)
                       throws SQLException
Get a timestamp with timezone compensation.

See ResultSet.getTime(int) for information about casting a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING output parameter to java.sql.Timestamp object.

Specified by:
getTimestamp in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid. 22018 if the parameter type was a character which could not be casted to a timestamp. 2200G is thrown if the parameter type wasn't castable to a timestamp, see ResultSet for an overview of which parameter types are castable to which Java types.
See Also:
getTimestamp(int)

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType)
                          throws SQLException
Registers a type to an output parameter.

Specified by:
registerOutParameter in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
sqlType - The data type.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 int scale)
                          throws SQLException
Registers a type to an output parameter.

Specified by:
registerOutParameter in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
sqlType - The data type.
scale -
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 String typeName)
                          throws SQLException
Registers a type to an output parameter.

This method is supposed to be used in conjunction with user-defined types and references. Mimer SQL supports neither of these features. The typeName argument is therefore ignored.

Specified by:
registerOutParameter in interface CallableStatement
Parameters:
parameterIndex - The parameter number.
sqlType - The data type.
typeName -
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the CallableStatement is not open. 07009 is thrown if the parameterIndex is invalid.

wasNull

public boolean wasNull()
                throws SQLException
Returns true if the last column read was a NULL.

Specified by:
wasNull in interface CallableStatement
Returns:
true if SQL NULL.
Throws:
SQLException - if an error occurs.

Mimer JDBC Engine 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC Engine
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.