Mimer JDBC/MIDP 2.12

com.mimer.jdbc
Class CallableStatement

java.lang.Object
  |
  +--com.mimer.jdbc.Statement
        |
        +--com.mimer.jdbc.PreparedStatement
              |
              +--com.mimer.jdbc.CallableStatement

public final class CallableStatement
extends PreparedStatement

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.


Method Summary
 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.
 int getInt(int parameterIndex)
          Returns an integer.
 long getLong(int parameterIndex)
          Returns an long.
 java.lang.Object getObject(int parameterIndex)
          Returns an object.
 short getShort(int parameterIndex)
          Returns a short.
 java.lang.String getString(int parameterIndex)
          Returns a string.
 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, java.lang.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, setAsciiStream, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setShort, setString
 
Methods inherited from class com.mimer.jdbc.Statement
addBatch, cancel, 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
 

Method Detail

getBlob

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

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".

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.

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.

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.

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.

getInt

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

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.

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 java.lang.Object getObject(int parameterIndex)
                           throws SQLException
Returns an object.

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.

getShort

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

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 java.lang.String getString(int parameterIndex)
                           throws SQLException
Returns a string.

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.

registerOutParameter

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

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.

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,
                                 java.lang.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.

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.

Returns:
true if SQL NULL.
Throws:
SQLException - if an error occurs.

Mimer JDBC/MIDP 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC for the CLDC/MID Profile Specification
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.