java.sql

Interface CallableStatement

All Superinterfaces:
PreparedStatement, Statement

public interface CallableStatement
extends PreparedStatement

This interface provides a mechanism for calling stored procedures.

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 index)
This method returns the value of the specified parameter as a Java Array.
Array
getArray(String parameterName)
BigDecimal
getBigDecimal(int parameterIndex)
This method returns the value of the specified parameter as a Java BigDecimal.
BigDecimal
getBigDecimal(int parameterIndex, int scale)
Deprecated. Use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName) instead.
BigDecimal
getBigDecimal(String parameterName)
Blob
getBlob(int index)
This method returns the value of the specified parameter as a Java Blob.
Blob
getBlob(String parameterName)
boolean
getBoolean(int parameterIndex)
This method returns the value of the specified parameter as a Java boolean.
boolean
getBoolean(String parameterName)
byte
getByte(int parameterIndex)
This method returns the value of the specified parameter as a Java byte.
byte
getByte(String parameterName)
byte[]
getBytes(int parameterIndex)
This method returns the value of the specified parameter as a Java byte array.
byte[]
getBytes(String parameterName)
Clob
getClob(int index)
This method returns the value of the specified parameter as a Java Clob.
Clob
getClob(String parameterName)
Date
getDate(int parameterIndex)
This method returns the value of the specified parameter as a Java java.sql.Date.
Date
getDate(int parameterIndex, Calendar cal)
This method returns the value of the specified parameter as a Java java.sql.Date.
Date
getDate(String parameterName)
Date
getDate(String parameterName, Calendar cal)
double
getDouble(int parameterIndex)
This method returns the value of the specified parameter as a Java double.
double
getDouble(String parameterName)
float
getFloat(int parameterIndex)
This method returns the value of the specified parameter as a Java float.
float
getFloat(String parameterName)
int
getInt(int parameterIndex)
This method returns the value of the specified parameter as a Java int.
int
getInt(String parameterName)
long
getLong(int parameterIndex)
This method returns the value of the specified parameter as a Java long.
long
getLong(String parameterName)
Object
getObject(int parameterIndex)
This method returns the value of the specified parameter as a Java Object.
Object
getObject(int index, Map map)
This method returns the value of the specified parameter as a Java Object.
Object
getObject(String parameterName)
Object
getObject(String parameterName, Map map)
Ref
getRef(int index)
This method returns the value of the specified parameter as a Java Ref.
Ref
getRef(String parameterName)
short
getShort(int parameterIndex)
This method returns the value of the specified parameter as a Java short.
short
getShort(String parameterName)
String
getString(int parameterIndex)
This method returns the value of the specified parameter as a Java String.
String
getString(String parameterName)
Time
getTime(int parameterIndex)
This method returns the value of the specified parameter as a Java java.sql.Time.
Time
getTime(int parameterIndex, Calendar cal)
This method returns the value of the specified parameter as a Java java.sql.Time.
Time
getTime(String parameterName)
Time
getTime(String parameterName, Calendar cal)
Timestamp
getTimestamp(int parameterIndex)
This method returns the value of the specified parameter as a Java java.sql.Timestamp.
Timestamp
getTimestamp(int parameterIndex, Calendar cal)
This method returns the value of the specified parameter as a Java java.sql.Timestamp.
Timestamp
getTimestamp(String parameterName)
Timestamp
getTimestamp(String parameterName, Calendar cal)
URL
getURL(int parameterIndex)
URL
getURL(String parameterName)
void
registerOutParameter(int parameterIndex, int sqlType)
This method registers the specified parameter as an output parameter of the specified SQL type.
void
registerOutParameter(int parameterIndex, int sqlType, int scale)
This method registers the specified parameter as an output parameter of the specified SQL type and scale.
void
registerOutParameter(int paramIndex, int sqlType, String typeName)
This method registers the specified parameter as an output parameter of the specified SQL type.
void
registerOutParameter(String parameterName, int sqlType)
This method registers the specified parameter as an output parameter of the specified SQL type.
void
registerOutParameter(String parameterName, int sqlType, int scale)
This method registers the specified parameter as an output parameter of the specified SQL type.
void
registerOutParameter(String parameterName, int sqlType, String typeName)
This method registers the specified parameter as an output parameter of the specified SQL type.
void
setAsciiStream(String parameterName, InputStream x, int length)
void
setBigDecimal(String parameterName, BigDecimal x)
void
setBinaryStream(String parameterName, InputStream x, int length)
void
setBoolean(String parameterName, boolean x)
void
setByte(String parameterName, byte x)
void
setBytes(String parameterName, byte[] x)
void
setCharacterStream(String parameterName, Reader reader, int length)
void
setDate(String parameterName, Date x)
void
setDate(String parameterName, Date x, Calendar cal)
void
setDouble(String parameterName, double x)
void
setFloat(String parameterName, float x)
void
setInt(String parameterName, int x)
void
setLong(String parameterName, long x)
void
setNull(String parameterName, int sqlType)
void
setNull(String parameterName, int sqlType, String typeName)
void
setObject(String parameterName, Object x)
void
setObject(String parameterName, Object x, int targetSqlType)
void
setObject(String parameterName, Object x, int targetSqlType, int scale)
void
setShort(String parameterName, short x)
void
setString(String parameterName, String x)
void
setTime(String parameterName, Time x)
void
setTime(String parameterName, Time x, Calendar cal)
void
setTimestamp(String parameterName, Timestamp x)
void
setTimestamp(String parameterName, Timestamp x, Calendar cal)
void
setURL(String parameterName, URL val)
boolean
wasNull()
This method tests whether the value of the last parameter that was fetched was actually a SQL NULL value.

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, setURL, setUnicodeStream

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 Details

getArray

public Array getArray(int index)
            throws SQLException
This method returns the value of the specified parameter as a Java Array.
Parameters:
Returns:
The parameter value as a Array.
Throws:
SQLException - If an error occurs.
Since:
1.2

getArray

public Array getArray(String parameterName)
            throws SQLException
Since:
1.4

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java BigDecimal.
Parameters:
parameterIndex - The index of the parameter to return.
Returns:
The parameter value as a BigDecimal.
Throws:
SQLException - If an error occurs.
Since:
1.2

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex,
                                int scale)
            throws SQLException

Deprecated. Use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName) instead.

This method returns the value of the specified parameter as a Java BigDecimal.
Parameters:
parameterIndex - The index of the parameter to return.
scale - The number of digits to the right of the decimal to return.
Returns:
The parameter value as a BigDecimal.
Throws:
SQLException - If an error occurs.

getBigDecimal

public BigDecimal getBigDecimal(String parameterName)
            throws SQLException
Since:
1.4

getBlob

public Blob getBlob(int index)
            throws SQLException
This method returns the value of the specified parameter as a Java Blob.
Parameters:
index - The index of the parameter to return.
Returns:
The parameter value as a Blob.
Throws:
SQLException - If an error occurs.
Since:
1.2

getBlob

public Blob getBlob(String parameterName)
            throws SQLException
Since:
1.4

getBoolean

public boolean getBoolean(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java boolean.
Parameters:
Returns:
The parameter value as a boolean.
Throws:
SQLException - If an error occurs.

getBoolean

public boolean getBoolean(String parameterName)
            throws SQLException
Since:
1.4

getByte

public byte getByte(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java byte.
Parameters:
Returns:
The parameter value as a byte.
Throws:
SQLException - If an error occurs.

getByte

public byte getByte(String parameterName)
            throws SQLException
Since:
1.4

getBytes

public byte[] getBytes(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java byte array.
Parameters:
parameterIndex - The index of the parameter to return.
Returns:
The parameter value as a byte array
Throws:
SQLException - If an error occurs.

getBytes

public byte[] getBytes(String parameterName)
            throws SQLException
Since:
1.4

getClob

public Clob getClob(int index)
            throws SQLException
This method returns the value of the specified parameter as a Java Clob.
Parameters:
index - The index of the parameter to return.
Returns:
The parameter value as a Clob.
Throws:
SQLException - If an error occurs.
Since:
1.2

getClob

public Clob getClob(String parameterName)
            throws SQLException
Since:
1.4

getDate

public Date getDate(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Date.
Parameters:
Returns:
The parameter value as a java.sql.Date.
Throws:
SQLException - If an error occurs.

getDate

public Date getDate(int parameterIndex,
                    Calendar cal)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Date.
Parameters:
parameterIndex - The index of the parameter to return.
cal - The Calendar to use for timezone and locale.
Returns:
The parameter value as a java.sql.Date.
Throws:
SQLException - If an error occurs.
Since:
1.2

getDate

public Date getDate(String parameterName)
            throws SQLException
Since:
1.4

getDate

public Date getDate(String parameterName,
                    Calendar cal)
            throws SQLException
Since:
1.4

getDouble

public double getDouble(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java double.
Parameters:
Returns:
The parameter value as a double.
Throws:
SQLException - If an error occurs.

getDouble

public double getDouble(String parameterName)
            throws SQLException
Since:
1.4

getFloat

public float getFloat(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java float.
Parameters:
Returns:
The parameter value as a float.
Throws:
SQLException - If an error occurs.

getFloat

public float getFloat(String parameterName)
            throws SQLException
Since:
1.4

getInt

public int getInt(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java int.
Parameters:
Returns:
The parameter value as a int.
Throws:
SQLException - If an error occurs.

getInt

public int getInt(String parameterName)
            throws SQLException
Since:
1.4

getLong

public long getLong(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java long.
Parameters:
Returns:
The parameter value as a long.
Throws:
SQLException - If an error occurs.

getLong

public long getLong(String parameterName)
            throws SQLException
Since:
1.4

getObject

public Object getObject(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java Object.
Parameters:
parameterIndex - The index of the parameter to return.
Returns:
The parameter value as an Object.
Throws:
SQLException - If an error occurs.
Since:
1.2

getObject

public Object getObject(int index,
                        Map map)
            throws SQLException
This method returns the value of the specified parameter as a Java Object.
Parameters:
index - The index of the parameter to return.
map - The mapping to use for conversion from SQL to Java types.
Returns:
The parameter value as an Object.
Throws:
SQLException - If an error occurs.
Since:
1.2

getObject

public Object getObject(String parameterName)
            throws SQLException
Since:
1.4

getObject

public Object getObject(String parameterName,
                        Map map)
            throws SQLException
Since:
1.4

getRef

public Ref getRef(int index)
            throws SQLException
This method returns the value of the specified parameter as a Java Ref.
Parameters:
index - The index of the parameter to return.
Returns:
The parameter value as a Ref.
Throws:
SQLException - If an error occurs.
Since:
1.2

getRef

public Ref getRef(String parameterName)
            throws SQLException
Since:
1.4

getShort

public short getShort(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java short.
Parameters:
Returns:
The parameter value as a short.
Throws:
SQLException - If an error occurs.

getShort

public short getShort(String parameterName)
            throws SQLException
Since:
1.4

getString

public String getString(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java String.
Parameters:
Returns:
The parameter value as a String.
Throws:
SQLException - If an error occurs.

getString

public String getString(String parameterName)
            throws SQLException
Since:
1.4

getTime

public Time getTime(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Time.
Parameters:
Returns:
The parameter value as a java.sql.Time.
Throws:
SQLException - If an error occurs.

getTime

public Time getTime(int parameterIndex,
                    Calendar cal)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Time.
Parameters:
parameterIndex - The index of the parameter to return.
cal - The Calendar to use for timezone and locale.
Returns:
The parameter value as a java.sql.Time.
Throws:
SQLException - If an error occurs.
Since:
1.2

getTime

public Time getTime(String parameterName)
            throws SQLException
Since:
1.4

getTime

public Time getTime(String parameterName,
                    Calendar cal)
            throws SQLException
Since:
1.4

getTimestamp

public Timestamp getTimestamp(int parameterIndex)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Timestamp.
Parameters:
Returns:
The parameter value as a java.sql.Timestamp.
Throws:
SQLException - If an error occurs.

getTimestamp

public Timestamp getTimestamp(int parameterIndex,
                              Calendar cal)
            throws SQLException
This method returns the value of the specified parameter as a Java java.sql.Timestamp.
Parameters:
Returns:
The parameter value as a java.sql.Timestamp.
Throws:
SQLException - If an error occurs.
Since:
1.2

getTimestamp

public Timestamp getTimestamp(String parameterName)
            throws SQLException
Since:
1.4

getTimestamp

public Timestamp getTimestamp(String parameterName,
                              Calendar cal)
            throws SQLException
Since:
1.4

getURL

public URL getURL(int parameterIndex)
            throws SQLException
Since:
1.4

getURL

public URL getURL(String parameterName)
            throws SQLException
Since:
1.4

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type.
Parameters:
Throws:
SQLException - If an error occurs.

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 int scale)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type and scale.
Parameters:
scale - The scale of the value that will be returned.
Throws:
SQLException - If an error occurs.

registerOutParameter

public void registerOutParameter(int paramIndex,
                                 int sqlType,
                                 String typeName)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type.
Parameters:
Throws:
SQLException - If an error occurs.
Since:
1.2

registerOutParameter

public void registerOutParameter(String parameterName,
                                 int sqlType)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type.
Parameters:
parameterName - The name of the parameter to register as output.
sqlType - The SQL type value from Types.
Throws:
SQLException - If an error occurs.
Since:
1.4

registerOutParameter

public void registerOutParameter(String parameterName,
                                 int sqlType,
                                 int scale)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type. This version of registerOutParameter is used for NUMERIC or DECIMAL types.
Parameters:
parameterName - The name of the parameter to register as output.
sqlType - The SQL type value from Types.
scale - Number of digits to the right of the decimal point.
Throws:
SQLException - If an error occurs.
Since:
1.4

registerOutParameter

public void registerOutParameter(String parameterName,
                                 int sqlType,
                                 String typeName)
            throws SQLException
This method registers the specified parameter as an output parameter of the specified SQL type. This version of registerOutParameter is used for user-named or REF types. If the type of the output parameter does not have such a type, the typeName argument is ignored.
Parameters:
parameterName - The name of the parameter to register as output.
sqlType - The SQL type value from Types.
typeName - The SQL structured type name.
Throws:
SQLException - If an error occurs.
Since:
1.4

setAsciiStream

public void setAsciiStream(String parameterName,
                           InputStream x,
                           int length)
            throws SQLException
Since:
1.4

setBigDecimal

public void setBigDecimal(String parameterName,
                          BigDecimal x)
            throws SQLException
Since:
1.4

setBinaryStream

public void setBinaryStream(String parameterName,
                            InputStream x,
                            int length)
            throws SQLException
Since:
1.4

setBoolean

public void setBoolean(String parameterName,
                       boolean x)
            throws SQLException
Since:
1.4

setByte

public void setByte(String parameterName,
                    byte x)
            throws SQLException
Since:
1.4

setBytes

public void setBytes(String parameterName,
                     byte[] x)
            throws SQLException
Since:
1.4

setCharacterStream

public void setCharacterStream(String parameterName,
                               Reader reader,
                               int length)
            throws SQLException
Since:
1.4

setDate

public void setDate(String parameterName,
                    Date x)
            throws SQLException
Since:
1.4

setDate

public void setDate(String parameterName,
                    Date x,
                    Calendar cal)
            throws SQLException
Since:
1.4

setDouble

public void setDouble(String parameterName,
                      double x)
            throws SQLException
Since:
1.4

setFloat

public void setFloat(String parameterName,
                     float x)
            throws SQLException
Since:
1.4

setInt

public void setInt(String parameterName,
                   int x)
            throws SQLException
Since:
1.4

setLong

public void setLong(String parameterName,
                    long x)
            throws SQLException
Since:
1.4

setNull

public void setNull(String parameterName,
                    int sqlType)
            throws SQLException
Since:
1.4

setNull

public void setNull(String parameterName,
                    int sqlType,
                    String typeName)
            throws SQLException
Since:
1.4

setObject

public void setObject(String parameterName,
                      Object x)
            throws SQLException
Since:
1.4

setObject

public void setObject(String parameterName,
                      Object x,
                      int targetSqlType)
            throws SQLException
Since:
1.4

setObject

public void setObject(String parameterName,
                      Object x,
                      int targetSqlType,
                      int scale)
            throws SQLException
Since:
1.4

setShort

public void setShort(String parameterName,
                     short x)
            throws SQLException
Since:
1.4

setString

public void setString(String parameterName,
                      String x)
            throws SQLException
Since:
1.4

setTime

public void setTime(String parameterName,
                    Time x)
            throws SQLException
Since:
1.4

setTime

public void setTime(String parameterName,
                    Time x,
                    Calendar cal)
            throws SQLException
Since:
1.4

setTimestamp

public void setTimestamp(String parameterName,
                         Timestamp x)
            throws SQLException
Since:
1.4

setTimestamp

public void setTimestamp(String parameterName,
                         Timestamp x,
                         Calendar cal)
            throws SQLException
Since:
1.4

setURL

public void setURL(String parameterName,
                   URL val)
            throws SQLException
Since:
1.4

wasNull

public boolean wasNull()
            throws SQLException
This method tests whether the value of the last parameter that was fetched was actually a SQL NULL value.
Returns:
true if the last parameter fetched was a NULL, false otherwise.
Throws:
SQLException - If an error occurs.

CallableStatement.java -- A statement for calling stored procedures. Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.