java.lang.Object
org.postgresql.pljava.jdbc.SPIStatement
- All Implemented Interfaces:
AutoCloseable
,Statement
,Wrapper
,SPIReadOnlyControl
- Direct Known Subclasses:
SPIPreparedStatement
Implementation of
Statement
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
cancel()
void
void
Specify that the statement, when next executed, will have haveread_only
set tofalse
unconditionally.void
void
close()
void
void
Specify that the statement, when next executed, will have the behavior recommended in the PostgreSQL SPI documentation:read_only
will be set totrue
if the currently-executing PL/Java function is declaredIMMUTABLE
,false
otherwise.boolean
boolean
Return of auto generated keys is not yet supported.boolean
Return of auto generated keys is not yet supported.boolean
Return of auto generated keys is not yet supported.int[]
protected long
executeBatchEntry
(Object batchEntry) long[]
protected boolean
executePlan
(ExecutionPlan plan, Object[] paramValues) executeQuery
(String statement) int
executeUpdate
(String statement) int
executeUpdate
(String statement, int autoGeneratedKeys) Return of auto generated keys is not yet supported.int
executeUpdate
(String statement, int[] columnIndexes) Return of auto generated keys is not yet supported.int
executeUpdate
(String statement, String[] columnNames) Return of auto generated keys is not yet supported.void
Specify that the statement, when next executed, will have haveread_only
set totrue
unconditionally.Returns the Connection from that created this statement.int
int
long
int
int
boolean
boolean
getMoreResults
(int current) int
int
int
int
int
protected void
internalAddBatch
(Object batch) The argument is either aString
containing SQL (if from aStatement
, or anObject
array of length three (if from aPreparedStatement
) holding parameter values, SQL types, and PG type Oids.boolean
isClosed()
boolean
boolean
boolean
isWrapperFor
(Class<?> iface) void
setCursorName
(String cursorName) void
setEscapeProcessing
(boolean enable) void
setFetchDirection
(int direction) OnlyResultSet.FETCH_FORWARD
is supported.void
setFetchSize
(int size) void
setMaxFieldSize
(int size) void
setMaxRows
(int rows) void
setPoolable
(boolean poolable) void
setQueryTimeout
(int seconds) <T> T
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, isSimpleIdentifier, setLargeMaxRows
-
Constructor Details
-
SPIStatement
-
-
Method Details
-
addBatch
- Specified by:
addBatch
in interfaceStatement
- Throws:
SQLException
-
cancel
- Specified by:
cancel
in interfaceStatement
- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatch
in interfaceStatement
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceStatement
- Throws:
SQLException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
executePlan
- Throws:
SQLException
-
execute
Return of auto generated keys is not yet supported.- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
execute
Return of auto generated keys is not yet supported.- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
execute
Return of auto generated keys is not yet supported.- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
executeBatch
- Specified by:
executeBatch
in interfaceStatement
- Throws:
SQLException
-
executeLargeBatch
- Specified by:
executeLargeBatch
in interfaceStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
Return of auto generated keys is not yet supported.- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
executeUpdate
Return of auto generated keys is not yet supported.- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
executeUpdate
Return of auto generated keys is not yet supported.- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported.
-
getConnection
Returns the Connection from that created this statement.- Specified by:
getConnection
in interfaceStatement
- Throws:
SQLException
- if the statement is closed.
-
getFetchDirection
- Specified by:
getFetchDirection
in interfaceStatement
- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSize
in interfaceStatement
- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeys
in interfaceStatement
- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRows
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSet
in interfaceStatement
- Throws:
SQLException
-
getResultSetConcurrency
public int getResultSetConcurrency()- Specified by:
getResultSetConcurrency
in interfaceStatement
-
getResultSetHoldability
- Specified by:
getResultSetHoldability
in interfaceStatement
- Throws:
SQLException
-
getResultSetType
public int getResultSetType()- Specified by:
getResultSetType
in interfaceStatement
-
getUpdateCount
- Specified by:
getUpdateCount
in interfaceStatement
- Throws:
SQLException
-
getLargeUpdateCount
- Specified by:
getLargeUpdateCount
in interfaceStatement
- Throws:
SQLException
-
getWarnings
- Specified by:
getWarnings
in interfaceStatement
- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorName
in interfaceStatement
- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessing
in interfaceStatement
- Throws:
SQLException
-
setFetchDirection
OnlyResultSet.FETCH_FORWARD
is supported.- Specified by:
setFetchDirection
in interfaceStatement
- Throws:
SQLException
- indicating that this feature is not supported for other values ondirection
.
-
setFetchSize
- Specified by:
setFetchSize
in interfaceStatement
- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRows
in interfaceStatement
- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
internalAddBatch
The argument is either aString
containing SQL (if from aStatement
, or anObject
array of length three (if from aPreparedStatement
) holding parameter values, SQL types, and PG type Oids.- Throws:
SQLException
-
executeBatchEntry
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletion
in interfaceStatement
- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolable
in interfaceStatement
- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolable
in interfaceStatement
- Throws:
SQLException
-
isClosed
- Specified by:
isClosed
in interfaceStatement
- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletion
in interfaceStatement
- Throws:
SQLException
-
defaultReadOnly
public void defaultReadOnly()Description copied from interface:SPIReadOnlyControl
Specify that the statement, when next executed, will have the behavior recommended in the PostgreSQL SPI documentation:read_only
will be set totrue
if the currently-executing PL/Java function is declaredIMMUTABLE
,false
otherwise.- Specified by:
defaultReadOnly
in interfaceSPIReadOnlyControl
-
forceReadOnly
public void forceReadOnly()Description copied from interface:SPIReadOnlyControl
Specify that the statement, when next executed, will have haveread_only
set totrue
unconditionally.- Specified by:
forceReadOnly
in interfaceSPIReadOnlyControl
-
clearReadOnly
public void clearReadOnly()Description copied from interface:SPIReadOnlyControl
Specify that the statement, when next executed, will have haveread_only
set tofalse
unconditionally.- Specified by:
clearReadOnly
in interfaceSPIReadOnlyControl
-