Package nl.cwi.monetdb.jdbc
Class MonetCallableStatement
java.lang.Object
nl.cwi.monetdb.jdbc.MonetWrapper
nl.cwi.monetdb.jdbc.MonetStatement
nl.cwi.monetdb.jdbc.MonetPreparedStatement
nl.cwi.monetdb.jdbc.MonetCallableStatement
- All Implemented Interfaces:
AutoCloseable,CallableStatement,PreparedStatement,Statement,Wrapper
public class MonetCallableStatement extends MonetPreparedStatement implements CallableStatement
A
CallableStatement suitable for the MonetDB database.
The interface used to execute SQL stored procedures.
The JDBC API provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs.
This escape syntax has one form that includes a result parameter (MonetDB does not support this) and one that does not.
If used, the result parameter must be registered as an OUT parameter (MonetDB does not support this).
The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number, with the first parameter being 1.
{ call procedure-name [ (arg1, arg2, ...) ] }
{ ?= call procedure-name [ (arg1, arg2, ...) ] }
IN parameter values are set using the set methods inherited from PreparedStatement.
The type of all OUT parameters must be registered prior to executing the stored procedure;
their values are retrieved after execution via the get methods provided here.
Note: MonetDB does not support OUT or INOUT parameters. Only input parameters are supported.
A CallableStatement can return one ResultSet object or multiple ResultSet objects.
Multiple ResultSet objects are handled using operations inherited from Statement.
For maximum portability, a call's ResultSet objects and update counts should be processed prior to getting the values of output parameters.
This implementation of the CallableStatement interface reuses the implementation of MonetPreparedStatement for
preparing the call statement, bind parameter values and execute the call, possibly multiple times with different parameter values.
Note: currently we can not implement:
- all getXyz(parameterIndex/parameterName, ...) methods
- all registerOutParameter(parameterIndex/parameterName, int sqlType, ...) methods
- wasNull() method
because output parameters in stored procedures are not supported by MonetDB.- Version:
- 1.0
- Author:
- Martin van Dinther
-
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
Modifier and Type Method Description ArraygetArray(int parameterIndex)ArraygetArray(String parameterName)BigDecimalgetBigDecimal(int parameterIndex)BigDecimalgetBigDecimal(int parameterIndex, int scale)Deprecated.BigDecimalgetBigDecimal(String parameterName)BlobgetBlob(int parameterIndex)BlobgetBlob(String parameterName)booleangetBoolean(int parameterIndex)booleangetBoolean(String parameterName)bytegetByte(int parameterIndex)bytegetByte(String parameterName)byte[]getBytes(int parameterIndex)byte[]getBytes(String parameterName)ReadergetCharacterStream(int parameterIndex)ReadergetCharacterStream(String parameterName)ClobgetClob(int parameterIndex)ClobgetClob(String parameterName)DategetDate(int parameterIndex)DategetDate(int parameterIndex, Calendar cal)DategetDate(String parameterName)DategetDate(String parameterName, Calendar cal)doublegetDouble(int parameterIndex)doublegetDouble(String parameterName)floatgetFloat(int parameterIndex)floatgetFloat(String parameterName)intgetInt(int parameterIndex)intgetInt(String parameterName)longgetLong(int parameterIndex)longgetLong(String parameterName)ReadergetNCharacterStream(int parameterIndex)ReadergetNCharacterStream(String parameterName)NClobgetNClob(int parameterIndex)NClobgetNClob(String parameterName)StringgetNString(int parameterIndex)StringgetNString(String parameterName)ObjectgetObject(int parameterIndex)<T> TgetObject(int parameterIndex, Class<T> type)ObjectgetObject(int parameterIndex, Map<String,Class<?>> map)ObjectgetObject(String parameterName)<T> TgetObject(String parameterName, Class<T> type)ObjectgetObject(String parameterName, Map<String,Class<?>> map)RefgetRef(int parameterIndex)RefgetRef(String parameterName)RowIdgetRowId(int parameterIndex)RowIdgetRowId(String parameterName)shortgetShort(int parameterIndex)shortgetShort(String parameterName)SQLXMLgetSQLXML(int parameterIndex)SQLXMLgetSQLXML(String parameterName)StringgetString(int parameterIndex)StringgetString(String parameterName)TimegetTime(int parameterIndex)TimegetTime(int parameterIndex, Calendar cal)TimegetTime(String parameterName)TimegetTime(String parameterName, Calendar cal)TimestampgetTimestamp(int parameterIndex)TimestampgetTimestamp(int parameterIndex, Calendar cal)TimestampgetTimestamp(String parameterName)TimestampgetTimestamp(String parameterName, Calendar cal)URLgetURL(int parameterIndex)URLgetURL(String parameterName)voidregisterOutParameter(int parameterIndex, int sqlType)voidregisterOutParameter(int parameterIndex, int sqlType, int scale)voidregisterOutParameter(int parameterIndex, int sqlType, String typeName)voidregisterOutParameter(String parameterName, int sqlType)voidregisterOutParameter(String parameterName, int sqlType, int scale)voidregisterOutParameter(String parameterName, int sqlType, String typeName)voidsetAsciiStream(String parameterName, InputStream x)voidsetAsciiStream(String parameterName, InputStream x, int length)voidsetAsciiStream(String parameterName, InputStream x, long length)voidsetBigDecimal(String parameterName, BigDecimal x)voidsetBinaryStream(String parameterName, InputStream x)voidsetBinaryStream(String parameterName, InputStream x, int length)voidsetBinaryStream(String parameterName, InputStream x, long length)voidsetBlob(String parameterName, InputStream inputStream)voidsetBlob(String parameterName, InputStream inputStream, long length)voidsetBlob(String parameterName, Blob x)voidsetBoolean(String parameterName, boolean x)voidsetByte(String parameterName, byte x)voidsetBytes(String parameterName, byte[] x)voidsetCharacterStream(String parameterName, Reader reader)voidsetCharacterStream(String parameterName, Reader reader, int length)voidsetCharacterStream(String parameterName, Reader reader, long length)voidsetClob(String parameterName, Reader reader)voidsetClob(String parameterName, Reader reader, long length)voidsetClob(String parameterName, Clob x)voidsetDate(String parameterName, Date x)voidsetDate(String parameterName, Date x, Calendar cal)voidsetDouble(String parameterName, double x)voidsetFloat(String parameterName, float x)voidsetInt(String parameterName, int x)voidsetLong(String parameterName, long x)voidsetNCharacterStream(String parameterName, Reader value)voidsetNCharacterStream(String parameterName, Reader value, long length)voidsetNClob(String parameterName, Reader reader)voidsetNClob(String parameterName, Reader reader, long length)voidsetNClob(String parameterName, NClob value)voidsetNString(String parameterName, String value)voidsetNull(String parameterName, int sqlType)voidsetNull(String parameterName, int sqlType, String typeName)voidsetObject(String parameterName, Object x)voidsetObject(String parameterName, Object x, int targetSqlType)voidsetObject(String parameterName, Object x, int targetSqlType, int scale)voidsetRowId(String parameterName, RowId x)voidsetShort(String parameterName, short x)voidsetSQLXML(String parameterName, SQLXML xmlObject)voidsetString(String parameterName, String x)voidsetTime(String parameterName, Time x)voidsetTime(String parameterName, Time x, Calendar cal)voidsetTimestamp(String parameterName, Timestamp x)voidsetTimestamp(String parameterName, Timestamp x, Calendar cal)voidsetURL(String parameterName, URL val)booleanwasNull()Methods inherited from class nl.cwi.monetdb.jdbc.MonetPreparedStatement
addBatch, addBatch, clearParameters, close, execute, execute, executeQuery, executeQuery, executeUpdate, executeUpdate, finalize, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURLMethods inherited from class nl.cwi.monetdb.jdbc.MonetStatement
cancel, clearBatch, clearWarnings, closeOnCompletion, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, internalBatch, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.CallableStatement
registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setObject, setObjectMethods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURLMethods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
Method Details
-
getArray
- Specified by:
getArrayin interfaceCallableStatement- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceCallableStatement- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceCallableStatement- Throws:
SQLException
-
getBigDecimal
Deprecated.- Specified by:
getBigDecimalin interfaceCallableStatement- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceCallableStatement- Throws:
SQLException
-
getBlob
- Specified by:
getBlobin interfaceCallableStatement- Throws:
SQLException
-
getBlob
- Specified by:
getBlobin interfaceCallableStatement- Throws:
SQLException
-
getBoolean
- Specified by:
getBooleanin interfaceCallableStatement- Throws:
SQLException
-
getBoolean
- Specified by:
getBooleanin interfaceCallableStatement- Throws:
SQLException
-
getByte
- Specified by:
getBytein interfaceCallableStatement- Throws:
SQLException
-
getByte
- Specified by:
getBytein interfaceCallableStatement- Throws:
SQLException
-
getBytes
- Specified by:
getBytesin interfaceCallableStatement- Throws:
SQLException
-
getBytes
- Specified by:
getBytesin interfaceCallableStatement- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
getClob
- Specified by:
getClobin interfaceCallableStatement- Throws:
SQLException
-
getClob
- Specified by:
getClobin interfaceCallableStatement- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceCallableStatement- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceCallableStatement- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceCallableStatement- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceCallableStatement- Throws:
SQLException
-
getDouble
- Specified by:
getDoublein interfaceCallableStatement- Throws:
SQLException
-
getDouble
- Specified by:
getDoublein interfaceCallableStatement- Throws:
SQLException
-
getFloat
- Specified by:
getFloatin interfaceCallableStatement- Throws:
SQLException
-
getFloat
- Specified by:
getFloatin interfaceCallableStatement- Throws:
SQLException
-
getInt
- Specified by:
getIntin interfaceCallableStatement- Throws:
SQLException
-
getInt
- Specified by:
getIntin interfaceCallableStatement- Throws:
SQLException
-
getLong
- Specified by:
getLongin interfaceCallableStatement- Throws:
SQLException
-
getLong
- Specified by:
getLongin interfaceCallableStatement- Throws:
SQLException
-
getNCharacterStream
- Specified by:
getNCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
getNCharacterStream
- Specified by:
getNCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
getNClob
- Specified by:
getNClobin interfaceCallableStatement- Throws:
SQLException
-
getNClob
- Specified by:
getNClobin interfaceCallableStatement- Throws:
SQLException
-
getNString
- Specified by:
getNStringin interfaceCallableStatement- Throws:
SQLException
-
getNString
- Specified by:
getNStringin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceCallableStatement- Throws:
SQLException
-
getRef
- Specified by:
getRefin interfaceCallableStatement- Throws:
SQLException
-
getRef
- Specified by:
getRefin interfaceCallableStatement- Throws:
SQLException
-
getRowId
- Specified by:
getRowIdin interfaceCallableStatement- Throws:
SQLException
-
getRowId
- Specified by:
getRowIdin interfaceCallableStatement- Throws:
SQLException
-
getShort
- Specified by:
getShortin interfaceCallableStatement- Throws:
SQLException
-
getShort
- Specified by:
getShortin interfaceCallableStatement- Throws:
SQLException
-
getSQLXML
- Specified by:
getSQLXMLin interfaceCallableStatement- Throws:
SQLException
-
getSQLXML
- Specified by:
getSQLXMLin interfaceCallableStatement- Throws:
SQLException
-
getString
- Specified by:
getStringin interfaceCallableStatement- Throws:
SQLException
-
getString
- Specified by:
getStringin interfaceCallableStatement- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceCallableStatement- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceCallableStatement- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceCallableStatement- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceCallableStatement- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceCallableStatement- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceCallableStatement- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceCallableStatement- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceCallableStatement- Throws:
SQLException
-
getURL
- Specified by:
getURLin interfaceCallableStatement- Throws:
SQLException
-
getURL
- Specified by:
getURLin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
registerOutParameter
public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException- Specified by:
registerOutParameterin interfaceCallableStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfaceCallableStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfaceCallableStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfaceCallableStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfaceCallableStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfaceCallableStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfaceCallableStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfaceCallableStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfaceCallableStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfaceCallableStatement- Throws:
SQLException
-
setBlob
public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException- Specified by:
setBlobin interfaceCallableStatement- Throws:
SQLException
-
setBoolean
- Specified by:
setBooleanin interfaceCallableStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfaceCallableStatement- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfaceCallableStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
setCharacterStream
public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException- Specified by:
setCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
setCharacterStream
public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException- Specified by:
setCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfaceCallableStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfaceCallableStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfaceCallableStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfaceCallableStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfaceCallableStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfaceCallableStatement- Throws:
SQLException
-
setFloat
- Specified by:
setFloatin interfaceCallableStatement- Throws:
SQLException
-
setInt
- Specified by:
setIntin interfaceCallableStatement- Throws:
SQLException
-
setLong
- Specified by:
setLongin interfaceCallableStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
setNCharacterStream
public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException- Specified by:
setNCharacterStreamin interfaceCallableStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfaceCallableStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfaceCallableStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfaceCallableStatement- Throws:
SQLException
-
setNString
- Specified by:
setNStringin interfaceCallableStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfaceCallableStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfaceCallableStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfaceCallableStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfaceCallableStatement- Throws:
SQLException
-
setObject
public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException- Specified by:
setObjectin interfaceCallableStatement- Throws:
SQLException
-
setRowId
- Specified by:
setRowIdin interfaceCallableStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfaceCallableStatement- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXMLin interfaceCallableStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfaceCallableStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfaceCallableStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfaceCallableStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfaceCallableStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfaceCallableStatement- Throws:
SQLException
-
setURL
- Specified by:
setURLin interfaceCallableStatement- Throws:
SQLException
-
wasNull
- Specified by:
wasNullin interfaceCallableStatement- Throws:
SQLException
-