- All Implemented Interfaces:
AutoCloseable
,PreparedStatement
,Statement
,Wrapper
,SPIReadOnlyControl
PreparedStatement
for the SPI connection.- Author:
- Thomas Hallgren
-
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch()
void
The prepared statement cannot have other statements added too it.void
void
close()
boolean
execute()
boolean
The prepared statement cannot be used for executing oter statements.protected long
executeBatchEntry
(Object batchEntry) int
ResultSetMetaData is not yet supported.Due to the design of theSPI_prepare
, it is currently impossible to obtain the correct parameter meta data before all the parameters have been set, hence a ParameterMetaData obtained prior to setting the paramteres will have all parameters set to the default typeTypes.VARCHAR
.void
void
setAsciiStream
(int parameterIndex, InputStream x) void
setAsciiStream
(int columnIndex, InputStream value, int length) void
setAsciiStream
(int parameterIndex, InputStream x, long length) void
setBigDecimal
(int columnIndex, BigDecimal value) void
setBinaryStream
(int parameterIndex, InputStream x) void
setBinaryStream
(int columnIndex, InputStream value, int length) void
setBinaryStream
(int parameterIndex, InputStream x, long length) void
setBlob
(int parameterIndex, InputStream inputStream) void
setBlob
(int parameterIndex, InputStream inputStream, long length) void
void
setBoolean
(int columnIndex, boolean value) void
setByte
(int columnIndex, byte value) void
setBytes
(int columnIndex, byte[] value) void
setCharacterStream
(int parameterIndex, Reader reader) void
setCharacterStream
(int columnIndex, Reader value, int length) void
setCharacterStream
(int parameterIndex, Reader reader, long length) void
void
void
void
void
void
setDouble
(int columnIndex, double value) void
setFloat
(int columnIndex, float value) void
setInt
(int columnIndex, int value) void
setLong
(int columnIndex, long value) void
setNCharacterStream
(int parameterIndex, Reader value) void
setNCharacterStream
(int parameterIndex, Reader value, long length) void
void
void
void
setNString
(int parameterIndex, String value) void
setNull
(int columnIndex, int sqlType) void
This method can (and is the only method that can, until JDBC 4.2 SQLType is implemented) assign a specific PostgreSQL type, by name, to a PreparedStatement parameter.void
void
void
Implemented onsetObject(int,Object,int)
, discarding scale.void
void
void
setShort
(int columnIndex, short value) void
void
void
void
void
setTimestamp
(int columnIndex, Timestamp value) void
setTimestamp
(int columnIndex, Timestamp value, Calendar cal) void
setUnicodeStream
(int columnIndex, InputStream value, int arg2) void
toString()
Methods inherited from class org.postgresql.pljava.jdbc.SPIStatement
cancel, clearBatch, clearReadOnly, clearWarnings, closeOnCompletion, defaultReadOnly, execute, execute, execute, executeBatch, executeLargeBatch, executePlan, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, forceReadOnly, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, internalAddBatch, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, setObject, setObject
Methods inherited from interface java.sql.Statement
cancel, clearBatch, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, 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
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
SPIPreparedStatement
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Overrides:
close
in classSPIStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfacePreparedStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfacePreparedStatement
- Throws:
SQLException
-
setNull
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
-
setBoolean
- Specified by:
setBoolean
in interfacePreparedStatement
- Throws:
SQLException
-
setByte
- Specified by:
setByte
in interfacePreparedStatement
- Throws:
SQLException
-
setShort
- Specified by:
setShort
in interfacePreparedStatement
- Throws:
SQLException
-
setInt
- Specified by:
setInt
in interfacePreparedStatement
- Throws:
SQLException
-
setLong
- Specified by:
setLong
in interfacePreparedStatement
- Throws:
SQLException
-
setFloat
- Specified by:
setFloat
in interfacePreparedStatement
- Throws:
SQLException
-
setDouble
- Specified by:
setDouble
in interfacePreparedStatement
- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimal
in interfacePreparedStatement
- Throws:
SQLException
-
setString
- Specified by:
setString
in interfacePreparedStatement
- Throws:
SQLException
-
setBytes
- Specified by:
setBytes
in interfacePreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setUnicodeStream
- Specified by:
setUnicodeStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
clearParameters
- Specified by:
clearParameters
in interfacePreparedStatement
- Throws:
SQLException
-
setObject
Implemented onsetObject(int,Object,int)
, discarding scale.- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
setObject
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
setObject
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfacePreparedStatement
- Throws:
SQLException
-
execute
The prepared statement cannot be used for executing oter statements.- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classSPIStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
addBatch
- Specified by:
addBatch
in interfacePreparedStatement
- Throws:
SQLException
-
addBatch
The prepared statement cannot have other statements added too it.- Specified by:
addBatch
in interfaceStatement
- Overrides:
addBatch
in classSPIStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setRef
- Specified by:
setRef
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setArray
- Specified by:
setArray
in interfacePreparedStatement
- Throws:
SQLException
-
getMetaData
ResultSetMetaData is not yet supported.- Specified by:
getMetaData
in interfacePreparedStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
setDate
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
-
setNull
This method can (and is the only method that can, until JDBC 4.2 SQLType is implemented) assign a specific PostgreSQL type, by name, to a PreparedStatement parameter.However, to avoid a substantial behavior change in a 1.5.x minor release, its effect is limited for now. Any subsequent assignment of a non-null value for the parameter, using any of the setter methods or setObject-accepted classes from pre-JDBC 4.2, will reset the associated PostgreSQL type to what would have been assigned according to the JDBC
sqlType
or the type of the object.In contrast, setObject with any of the object types newly recognized in PL/Java 1.5.1 will not overwrite the PostgreSQL type assigned by this method, but will let it stand, on the assumption that the object's native to-Datum coercions will include one that applies to the type. If not, an exception will result.
The
sqlType
supplied here will be remembered, only to be used by the somewhat-functionally-impairedParameterMetaData
implementation. It is not checked for compatibility with the supplied PostgreSQLtypeName
in any way.- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
-
setURL
- Specified by:
setURL
in interfacePreparedStatement
- Throws:
SQLException
-
toString
-
getParameterMetaData
Due to the design of theSPI_prepare
, it is currently impossible to obtain the correct parameter meta data before all the parameters have been set, hence a ParameterMetaData obtained prior to setting the paramteres will have all parameters set to the default typeTypes.VARCHAR
. Once the parameters have been set, a fair attempt is made to generate this object based on the supplied values.- Specified by:
getParameterMetaData
in interfacePreparedStatement
- Returns:
- The meta data for parameter values.
- Throws:
SQLException
-
executeBatchEntry
- Overrides:
executeBatchEntry
in classSPIStatement
- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXML
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNString
- Specified by:
setNString
in interfacePreparedStatement
- Throws:
SQLException
-
setRowId
- Specified by:
setRowId
in interfacePreparedStatement
- Throws:
SQLException
-