- java.lang.Object
-
- org.jooq.tools.jdbc.JDBC41Statement
-
- org.jooq.tools.jdbc.DefaultStatement
-
- org.jooq.tools.jdbc.DefaultPreparedStatement
-
- org.jooq.tools.jdbc.BatchedPreparedStatement
-
- All Implemented Interfaces:
AutoCloseable
,PreparedStatement
,Statement
,Wrapper
public class BatchedPreparedStatement extends DefaultPreparedStatement
A batched statement.This statement doesn't execute immediately, but buffers all bind variables in batch, delaying execution until a new SQL string is encountered. See
BatchedConnection
for details.- Author:
- Lukas Eder
- See Also:
BatchedConnection
-
-
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 Constructor Description BatchedPreparedStatement(String sql, BatchedConnection connection, PreparedStatement delegate)
-
Method Summary
-
Methods inherited from class org.jooq.tools.jdbc.DefaultPreparedStatement
clearParameters, getDelegate, getDelegatePreparedStatement, 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, setURL
-
Methods inherited from class org.jooq.tools.jdbc.DefaultStatement
cancel, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, getConnection, getDelegateStatement, getFetchDirection, getFetchSize, getLargeMaxRows, getMaxFieldSize, getMaxRows, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, wrap
-
Methods inherited from class org.jooq.tools.jdbc.JDBC41Statement
getObject, getObject
-
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
cancel, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, getConnection, getFetchDirection, getFetchSize, getLargeMaxRows, getMaxFieldSize, getMaxRows, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
-
-
-
Constructor Detail
-
BatchedPreparedStatement
public BatchedPreparedStatement(String sql, BatchedConnection connection, PreparedStatement delegate)
-
-
Method Detail
-
getBatchedConnection
public BatchedConnection getBatchedConnection() throws SQLException
- Throws:
SQLException
-
getExecuteImmediate
public boolean getExecuteImmediate()
-
setExecuteImmediate
public void setExecuteImmediate(boolean executeImmediate)
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrap
in interfaceWrapper
- Overrides:
unwrap
in classDefaultStatement
- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperFor
in interfaceWrapper
- Overrides:
isWrapperFor
in classDefaultStatement
- Throws:
SQLException
-
executeUpdate
public int executeUpdate() throws SQLException
- Specified by:
executeUpdate
in interfacePreparedStatement
- Overrides:
executeUpdate
in classDefaultPreparedStatement
- Throws:
SQLException
-
execute
public boolean execute() throws SQLException
- Specified by:
execute
in interfacePreparedStatement
- Overrides:
execute
in classDefaultPreparedStatement
- Throws:
SQLException
-
getUpdateCount
public int getUpdateCount() throws SQLException
- Specified by:
getUpdateCount
in interfaceStatement
- Overrides:
getUpdateCount
in classDefaultStatement
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate() throws SQLException
- Specified by:
executeLargeUpdate
in interfacePreparedStatement
- Overrides:
executeLargeUpdate
in classDefaultPreparedStatement
- Throws:
SQLException
-
getLargeUpdateCount
public long getLargeUpdateCount() throws SQLException
- Specified by:
getLargeUpdateCount
in interfaceStatement
- Overrides:
getLargeUpdateCount
in classDefaultStatement
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Overrides:
close
in classDefaultStatement
- Throws:
SQLException
-
getMoreResults
public boolean getMoreResults() throws SQLException
- Specified by:
getMoreResults
in interfaceStatement
- Overrides:
getMoreResults
in classDefaultStatement
- Throws:
SQLException
-
getMoreResults
public boolean getMoreResults(int current) throws SQLException
- Specified by:
getMoreResults
in interfaceStatement
- Overrides:
getMoreResults
in classDefaultStatement
- Throws:
SQLException
-
addBatch
public void addBatch() throws SQLException
- Specified by:
addBatch
in interfacePreparedStatement
- Overrides:
addBatch
in classDefaultPreparedStatement
- Throws:
SQLException
-
clearBatch
public void clearBatch() throws SQLException
- Specified by:
clearBatch
in interfaceStatement
- Overrides:
clearBatch
in classDefaultStatement
- Throws:
SQLException
-
executeBatch
public int[] executeBatch() throws SQLException
- Specified by:
executeBatch
in interfaceStatement
- Overrides:
executeBatch
in classDefaultStatement
- Throws:
SQLException
-
executeLargeBatch
public long[] executeLargeBatch() throws SQLException
- Specified by:
executeLargeBatch
in interfaceStatement
- Overrides:
executeLargeBatch
in classDefaultStatement
- Throws:
SQLException
-
addBatch
public void addBatch(String s) throws SQLException
- Specified by:
addBatch
in interfaceStatement
- Overrides:
addBatch
in classDefaultStatement
- Throws:
SQLException
-
execute
public boolean execute(String s) throws SQLException
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classDefaultStatement
- Throws:
SQLException
-
execute
public boolean execute(String s, int autoGeneratedKeys) throws SQLException
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classDefaultStatement
- Throws:
SQLException
-
execute
public boolean execute(String s, int[] columnIndexes) throws SQLException
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classDefaultStatement
- Throws:
SQLException
-
execute
public boolean execute(String sql, String[] columnNames) throws SQLException
- Specified by:
execute
in interfaceStatement
- Overrides:
execute
in classDefaultStatement
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String s) throws SQLException
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String s, int autoGeneratedKeys) throws SQLException
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String s, int[] columnIndexes) throws SQLException
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String s, String[] columnNames) throws SQLException
- Specified by:
executeUpdate
in interfaceStatement
- Overrides:
executeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String s) throws SQLException
- Specified by:
executeLargeUpdate
in interfaceStatement
- Overrides:
executeLargeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String s, int autoGeneratedKeys) throws SQLException
- Specified by:
executeLargeUpdate
in interfaceStatement
- Overrides:
executeLargeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String s, int[] columnIndexes) throws SQLException
- Specified by:
executeLargeUpdate
in interfaceStatement
- Overrides:
executeLargeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String s, String[] columnNames) throws SQLException
- Specified by:
executeLargeUpdate
in interfaceStatement
- Overrides:
executeLargeUpdate
in classDefaultStatement
- Throws:
SQLException
-
executeQuery
public ResultSet executeQuery(String s) throws SQLException
- Specified by:
executeQuery
in interfaceStatement
- Overrides:
executeQuery
in classDefaultStatement
- Throws:
SQLException
-
executeQuery
public ResultSet executeQuery() throws SQLException
- Specified by:
executeQuery
in interfacePreparedStatement
- Overrides:
executeQuery
in classDefaultPreparedStatement
- Throws:
SQLException
-
getResultSet
public ResultSet getResultSet() throws SQLException
- Specified by:
getResultSet
in interfaceStatement
- Overrides:
getResultSet
in classDefaultStatement
- Throws:
SQLException
-
getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException
- Specified by:
getGeneratedKeys
in interfaceStatement
- Overrides:
getGeneratedKeys
in classDefaultStatement
- Throws:
SQLException
-
-