public class StatementImpl extends java.lang.Object implements Statement
Modifier and Type | Class and Description |
---|---|
(package private) class |
StatementImpl.CancelTask
Thread used to implement query timeouts...Eventually we could be more
efficient and have one thread with timers, but this is a straightforward
and simple way to implement a feature that isn't used all that often.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Object> |
batchedArgs
Holds batched commands
|
protected java.util.ArrayList<ResultSetRow> |
batchedGeneratedKeys |
protected java.lang.Object |
cancelTimeoutMutex
Mutex to prevent race between returning query results and noticing
that we're timed-out or cancelled.
|
protected SingleByteCharsetConverter |
charConverter
The character converter to use (if available)
|
protected java.lang.String |
charEncoding
The character encoding to use (if available)
|
protected boolean |
clearWarningsCalled
Has clearWarnings() been called?
|
protected MySQLConnection |
connection
The connection that created us
|
protected long |
connectionId |
protected boolean |
continueBatchOnError |
protected java.lang.String |
currentCatalog
The catalog in use
|
protected boolean |
doEscapeProcessing
Should we process escape codes?
|
protected com.mysql.jdbc.profiler.ProfilerEventHandler |
eventSink
If we're profiling, where should events go to?
|
protected ResultSetInternalMethods |
generatedKeysResults |
protected boolean |
holdResultsOpenOverClose
Should this statement hold results open over .close() irregardless of
connection's setting?
|
protected boolean |
isClosed
Has this statement been closed?
|
protected long |
lastInsertId
The auto_increment value for the last insert
|
protected boolean |
lastQueryIsOnDupKeyUpdate
Whether or not the last query was of the form ON DUPLICATE KEY UPDATE
|
protected int |
maxFieldSize
The max field size for this statement
|
protected int |
maxRows
The maximum number of rows to return for this statement (-1 means _all_
rows)
|
protected static java.lang.String[] |
ON_DUPLICATE_KEY_UPDATE_CLAUSE |
protected java.util.Set<ResultSetInternalMethods> |
openResults
Set of currently-open ResultSets
|
protected boolean |
pedantic
Are we in pedantic mode?
|
protected static java.lang.String |
PING_MARKER |
protected PingTarget |
pingTarget |
protected java.lang.String |
pointOfOrigin
Where this statement was created, only used if profileSql or
useUsageAdvisor set to true.
|
protected boolean |
profileSQL
Should we profile?
|
protected ResultSetInternalMethods |
results
The current results
|
protected int |
resultSetConcurrency
The concurrency for this result set (updatable or not)
|
protected int |
resultSetType
The type of this result set (scroll sensitive or in-sensitive)
|
protected boolean |
retrieveGeneratedKeys |
protected boolean |
sendFractionalSeconds |
(package private) static int |
statementCounter
Used to generate IDs when profiling.
|
protected java.util.concurrent.atomic.AtomicBoolean |
statementExecuting
Are we currently executing a statement?
|
protected int |
statementId
Used to identify this statement when profiling.
|
protected int |
timeoutInMillis
The timeout for a query
|
protected long |
updateCount
The update count for this statement
|
protected boolean |
useLegacyDatetimeCode |
static byte |
USES_VARIABLES_FALSE |
static byte |
USES_VARIABLES_TRUE |
static byte |
USES_VARIABLES_UNKNOWN |
protected boolean |
useUsageAdvisor
Should we use the usage advisor?
|
protected boolean |
version5013OrNewer |
protected java.sql.SQLWarning |
warningChain
The warnings chain.
|
protected boolean |
wasCancelled |
protected boolean |
wasCancelledByTimeout |
Constructor and Description |
---|
StatementImpl(MySQLConnection c,
java.lang.String catalog)
Constructor for a Statement.
|
Modifier and Type | Method and Description |
---|---|
void |
addBatch(java.lang.String sql) |
void |
cancel()
Cancels this Statement object if both the DBMS and driver support
aborting an SQL statement.
|
protected MySQLConnection |
checkClosed()
Checks if closed() has been called, and throws an exception if so
|
protected void |
checkForDml(java.lang.String sql,
char firstStatementChar)
Checks if the given SQL query with the given first non-ws char is a DML
statement.
|
protected void |
checkNullOrEmptyQuery(java.lang.String sql)
Method checkNullOrEmptyQuery.
|
void |
clearBatch()
JDBC 2.0 Make the set of commands in the current batch empty.
|
void |
clearWarnings()
After this call, getWarnings returns null until a new warning is reported
for this Statement.
|
void |
close()
In many cases, it is desirable to immediately release a Statement's
database and JDBC resources instead of waiting for this to happen when it
is automatically closed.
|
protected void |
closeAllOpenResults()
Close any open result sets that have been 'held open'
|
void |
closeOnCompletion() |
protected boolean |
containsOnDuplicateKeyInString(java.lang.String sql) |
protected boolean |
createStreamingResultSet()
We only stream result sets when they are forward-only, read-only, and the
fetch size has been set to Integer.MIN_VALUE
|
void |
disableStreamingResults()
Resets this statements fetch size and result set type to the values
they had before enableStreamingResults() was called.
|
protected void |
doPingInstead() |
void |
enableStreamingResults()
Workaround for containers that 'check' for sane values of
Statement.setFetchSize() so that applications can use
the Java variant of libmysql's mysql_use_result() behavior.
|
boolean |
execute(java.lang.String sql)
Execute a SQL statement that may return multiple results.
|
boolean |
execute(java.lang.String sql,
int returnGeneratedKeys) |
boolean |
execute(java.lang.String sql,
int[] generatedKeyIndices) |
boolean |
execute(java.lang.String sql,
java.lang.String[] generatedKeyNames) |
int[] |
executeBatch()
JDBC 2.0 Submit a batch of commands to the database for execution.
|
protected long[] |
executeBatchInternal() |
long[] |
executeLargeBatch()
JDBC 4.2
Same as
executeBatch() but returns long[] instead of int[]. |
long |
executeLargeUpdate(java.lang.String sql)
JDBC 4.2
Same as
executeUpdate(String) but returns long instead of int. |
long |
executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys)
JDBC 4.2
Same as
executeUpdate(String, int) but returns long instead of int. |
long |
executeLargeUpdate(java.lang.String sql,
int[] columnIndexes)
JDBC 4.2
Same as
executeUpdate(String, int[]) but returns long instead of int. |
long |
executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
JDBC 4.2
Same as
executeUpdate(String, String[]) but returns long instead of int. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a SQL statement that returns a single ResultSet
|
protected void |
executeSimpleNonQuery(MySQLConnection c,
java.lang.String nonQuery) |
int |
executeUpdate(java.lang.String sql)
Execute a SQL INSERT, UPDATE or DELETE statement.
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys) |
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes) |
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames) |
protected long |
executeUpdateInternal(java.lang.String sql,
boolean isBatch,
boolean returnGeneratedKeys) |
protected static int |
findStartOfStatement(java.lang.String sql) |
protected ResultSetInternalMethods |
generatePingResultSet() |
java.util.List<java.lang.Object> |
getBatchedArgs()
Get the batched args as added by the addBatch method(s).
|
protected void |
getBatchedGeneratedKeys(int maxKeys) |
protected void |
getBatchedGeneratedKeys(java.sql.Statement batchedStatement) |
protected java.util.Calendar |
getCalendarInstanceForSessionOrNew()
Optimization to only use one calendar per-session, or calculate it for
each call, depending on user configuration
|
java.sql.Connection |
getConnection()
JDBC 2.0 Return the Connection that produced the Statement.
|
ExceptionInterceptor |
getExceptionInterceptor() |
int |
getFetchDirection()
JDBC 2.0 Determine the fetch direction.
|
int |
getFetchSize()
JDBC 2.0 Determine the default fetch size.
|
java.sql.ResultSet |
getGeneratedKeys() |
protected ResultSetInternalMethods |
getGeneratedKeysInternal() |
protected ResultSetInternalMethods |
getGeneratedKeysInternal(long numKeys) |
protected int |
getId()
Returns the id used when profiling
|
long |
getLargeMaxRows()
JDBC 4.2
Same as
getMaxRows() but returns long instead of int. |
long |
getLargeUpdateCount()
JDBC 4.2
Same as
getUpdateCount() but returns long instead of int; |
long |
getLastInsertID()
getLastInsertID returns the value of the auto_incremented key after an
executeQuery() or excute() call.
|
java.io.InputStream |
getLocalInfileInputStream()
Returns the InputStream instance that will be used to send
data in response to a "LOAD DATA LOCAL INFILE" statement.
|
long |
getLongUpdateCount()
getLongUpdateCount returns the current result as an update count, if the
result is a ResultSet or there are no more results, -1 is returned.
|
int |
getMaxFieldSize()
The maxFieldSize limit (in bytes) is the maximum amount of data returned
for any column value; it only applies to BINARY, VARBINARY,
LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR columns.
|
int |
getMaxRows()
The maxRows limit is set to limit the number of rows that any ResultSet
can contain.
|
boolean |
getMoreResults()
getMoreResults moves to a Statement's next result.
|
boolean |
getMoreResults(int current) |
protected static int |
getOnDuplicateKeyLocation(java.lang.String sql,
boolean dontCheckOnDuplicateKeyUpdateInSQL,
boolean rewriteBatchedStatements,
boolean noBackslashEscapes) |
int |
getOpenResultSetCount()
Returns the number of open result sets for this statement.
|
int |
getQueryTimeout()
The queryTimeout limit is the number of seconds the driver will wait for
a Statement to execute.
|
java.sql.ResultSet |
getResultSet()
getResultSet returns the current result as a ResultSet.
|
int |
getResultSetConcurrency()
JDBC 2.0 Determine the result set concurrency.
|
int |
getResultSetHoldability() |
protected ResultSetInternalMethods |
getResultSetInternal() |
int |
getResultSetType()
JDBC 2.0 Determine the result set type.
|
int |
getUpdateCount()
getUpdateCount returns the current result as an update count, if the
result is a ResultSet or there are no more results, -1 is returned.
|
java.sql.SQLWarning |
getWarnings()
The first warning reported by calls on this Statement is returned.
|
protected java.sql.SQLException |
handleExceptionForBatch(int endOfBatchIndex,
int numValuesPerBatch,
long[] updateCounts,
java.sql.SQLException ex) |
protected boolean |
hasDeadlockOrTimeoutRolledBackTx(java.sql.SQLException ex) |
protected void |
implicitlyCloseAllOpenResults()
Close all result sets in this statement.
|
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
protected int |
processMultiCountsAndKeys(StatementImpl batchedStatement,
int updateCountCounter,
long[] updateCounts) |
protected void |
realClose(boolean calledExplicitly,
boolean closeOpenResults)
Closes this statement, and frees resources.
|
void |
removeOpenResultSet(ResultSetInternalMethods rs)
Callback for result set instances to remove them from the Set that
tracks them per-statement
|
protected void |
resetCancelledState() |
void |
setCursorName(java.lang.String name)
setCursorName defines the SQL cursor name that will be used by subsequent
execute methods.
|
void |
setEscapeProcessing(boolean enable)
If escape scanning is on (the default), the driver will do escape
substitution before sending the SQL to the database.
|
void |
setFetchDirection(int direction)
JDBC 2.0 Give a hint as to the direction in which the rows in a result
set will be processed.
|
void |
setFetchSize(int rows)
JDBC 2.0 Give the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed.
|
void |
setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose) |
void |
setLargeMaxRows(long max)
JDBC 4.2
Same as
setMaxRows(int) but accepts a long value instead of an int. |
void |
setLocalInfileInputStream(java.io.InputStream stream)
Sets an InputStream instance that will be used to send data
to the MySQL server for a "LOAD DATA LOCAL INFILE" statement
rather than a FileInputStream or URLInputStream that represents
the path given as an argument to the statement.
|
void |
setMaxFieldSize(int max)
Sets the maxFieldSize
|
void |
setMaxRows(int max)
Set the maximum number of rows
|
void |
setPingTarget(PingTarget pingTarget) |
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds)
Sets the queryTimeout limit
|
(package private) void |
setResultSetConcurrency(int concurrencyFlag)
Sets the concurrency for result sets generated by this statement
|
(package private) void |
setResultSetType(int typeFlag)
Sets the result set type for result sets generated by this statement
|
protected void |
setupStreamingTimeout(MySQLConnection con)
Adjust net_write_timeout to a higher value if we're streaming result sets.
|
protected void |
statementBegins() |
<T> T |
unwrap(java.lang.Class<T> iface) |
protected static final java.lang.String PING_MARKER
protected static final java.lang.String[] ON_DUPLICATE_KEY_UPDATE_CLAUSE
protected java.lang.Object cancelTimeoutMutex
static int statementCounter
public static final byte USES_VARIABLES_FALSE
public static final byte USES_VARIABLES_TRUE
public static final byte USES_VARIABLES_UNKNOWN
protected boolean wasCancelled
protected boolean wasCancelledByTimeout
protected java.util.List<java.lang.Object> batchedArgs
protected SingleByteCharsetConverter charConverter
protected java.lang.String charEncoding
protected volatile MySQLConnection connection
protected long connectionId
protected java.lang.String currentCatalog
protected boolean doEscapeProcessing
protected com.mysql.jdbc.profiler.ProfilerEventHandler eventSink
protected boolean isClosed
protected long lastInsertId
protected int maxFieldSize
protected int maxRows
protected java.util.Set<ResultSetInternalMethods> openResults
protected boolean pedantic
protected java.lang.String pointOfOrigin
protected boolean profileSQL
protected ResultSetInternalMethods results
protected ResultSetInternalMethods generatedKeysResults
protected int resultSetConcurrency
protected int resultSetType
protected int statementId
protected int timeoutInMillis
protected long updateCount
protected boolean useUsageAdvisor
protected java.sql.SQLWarning warningChain
protected boolean clearWarningsCalled
protected boolean holdResultsOpenOverClose
protected java.util.ArrayList<ResultSetRow> batchedGeneratedKeys
protected boolean retrieveGeneratedKeys
protected boolean continueBatchOnError
protected PingTarget pingTarget
protected boolean useLegacyDatetimeCode
protected boolean sendFractionalSeconds
protected boolean lastQueryIsOnDupKeyUpdate
protected final java.util.concurrent.atomic.AtomicBoolean statementExecuting
protected final boolean version5013OrNewer
public StatementImpl(MySQLConnection c, java.lang.String catalog) throws java.sql.SQLException
c
- the Connection instantation that creates uscatalog
- the database name in use when we were createdjava.sql.SQLException
- if an error occurs.public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
sql
- java.sql.SQLException
public java.util.List<java.lang.Object> getBatchedArgs()
public void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
protected MySQLConnection checkClosed() throws java.sql.SQLException
java.sql.SQLException
- if this statement has been closedprotected void checkForDml(java.lang.String sql, char firstStatementChar) throws java.sql.SQLException
sql
- the SQL to checkfirstStatementChar
- the UC first non-ws char of the statementjava.sql.SQLException
- if the statement contains DMLprotected void checkNullOrEmptyQuery(java.lang.String sql) throws java.sql.SQLException
sql
- the SQL to checkjava.sql.SQLException
- if query is null or empty.public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurs, or the driver does not
support batch statementspublic void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurs (why?)public void close() throws java.sql.SQLException
Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed, its current ResultSet, if one exists, is also closed.
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occursprotected void closeAllOpenResults() throws java.sql.SQLException
java.sql.SQLException
protected void implicitlyCloseAllOpenResults() throws java.sql.SQLException
java.sql.SQLException
public void removeOpenResultSet(ResultSetInternalMethods rs)
Statement
public int getOpenResultSetCount()
Statement
protected boolean createStreamingResultSet()
public void enableStreamingResults() throws java.sql.SQLException
Statement
java.sql.SQLException
public void disableStreamingResults() throws java.sql.SQLException
Statement
java.sql.SQLException
protected void setupStreamingTimeout(MySQLConnection con) throws java.sql.SQLException
java.sql.SQLException
public boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- any SQL statementjava.sql.SQLException
- if a database access error occursprotected void statementBegins()
protected void resetCancelledState() throws java.sql.SQLException
java.sql.SQLException
public boolean execute(java.lang.String sql, int returnGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
execute(String, int)
public boolean execute(java.lang.String sql, int[] generatedKeyIndices) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
execute(String, int[])
public boolean execute(java.lang.String sql, java.lang.String[] generatedKeyNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
execute(String, String[])
public int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurs, or the driver does not
support batch statementsjava.sql.BatchUpdateException
protected long[] executeBatchInternal() throws java.sql.SQLException
java.sql.SQLException
protected final boolean hasDeadlockOrTimeoutRolledBackTx(java.sql.SQLException ex)
protected int processMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, long[] updateCounts) throws java.sql.SQLException
java.sql.SQLException
protected java.sql.SQLException handleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, long[] updateCounts, java.sql.SQLException ex) throws java.sql.BatchUpdateException, java.sql.SQLException
java.sql.BatchUpdateException
java.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
sql
- typically a static SQL SELECT statementjava.sql.SQLException
- if a database access error occursprotected void doPingInstead() throws java.sql.SQLException
java.sql.SQLException
protected ResultSetInternalMethods generatePingResultSet() throws java.sql.SQLException
java.sql.SQLException
protected void executeSimpleNonQuery(MySQLConnection c, java.lang.String nonQuery) throws java.sql.SQLException
java.sql.SQLException
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
sql
- a SQL statementjava.sql.SQLException
- if a database access error occursprotected long executeUpdateInternal(java.lang.String sql, boolean isBatch, boolean returnGeneratedKeys) throws java.sql.SQLException
java.sql.SQLException
public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
executeUpdate(String, int)
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
executeUpdate(String, int[])
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
executeUpdate(String, String[])
protected java.util.Calendar getCalendarInstanceForSessionOrNew() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurspublic int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
protected ResultSetInternalMethods getGeneratedKeysInternal() throws java.sql.SQLException
java.sql.SQLException
protected ResultSetInternalMethods getGeneratedKeysInternal(long numKeys) throws java.sql.SQLException
java.sql.SQLException
protected int getId()
public long getLastInsertID()
This gets around the un-threadsafe behavior of "select LAST_INSERT_ID()" which is tied to the Connection that created this Statement, and therefore could have had many INSERTS performed before one gets a chance to call "select LAST_INSERT_ID()".
public long getLongUpdateCount()
This method returns longs as MySQL server versions newer than 3.22.4 return 64-bit values for update counts
public int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurspublic int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurspublic boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurspublic boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
getMoreResults(int)
public int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurs (why?)public int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
getResultSetHoldability()
protected ResultSetInternalMethods getResultSetInternal()
public int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
- if an error occurs.public int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurspublic java.sql.SQLWarning getWarnings() throws java.sql.SQLException
The Warning chain is automatically cleared each time a statement is (re)executed.
Note: If you are processing a ResultSet then any warnings associated with ResultSet reads will be chained on the ResultSet object.
getWarnings
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occursprotected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws java.sql.SQLException
calledExplicitly
- was this called from close()?java.sql.SQLException
- if an error occurspublic void setCursorName(java.lang.String name) throws java.sql.SQLException
Note: This MySQL driver does not support cursors.
setCursorName
in interface java.sql.Statement
name
- the new cursor namejava.sql.SQLException
- if a database access error occurspublic void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
enable
- true to enable; false to disablejava.sql.SQLException
- if a database access error occurspublic void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
direction
- the initial direction for processing rowsjava.sql.SQLException
- if a database-access error occurs or direction is not one
of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or
ResultSet.FETCH_UNKNOWNpublic void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
rows
- the number of rows to fetchjava.sql.SQLException
- if a database-access error occurs, or the condition 0
<= rows <= this.getMaxRows() is not satisfied.public void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)
public void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
max
- the new max column size limit; zero means unlimitedjava.sql.SQLException
- if size exceeds buffer sizepublic void setMaxRows(int max) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
max
- the new max rows limit; zero means unlimitedjava.sql.SQLException
- if a database access error occursgetMaxRows
public void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
seconds
- -
the new query timeout limit in secondsjava.sql.SQLException
- if a database access error occursvoid setResultSetConcurrency(int concurrencyFlag)
concurrencyFlag
- void setResultSetType(int typeFlag)
typeFlag
- protected void getBatchedGeneratedKeys(java.sql.Statement batchedStatement) throws java.sql.SQLException
java.sql.SQLException
protected void getBatchedGeneratedKeys(int maxKeys) throws java.sql.SQLException
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Statement
java.sql.SQLException
public boolean isPoolable() throws java.sql.SQLException
isPoolable
in interface java.sql.Statement
java.sql.SQLException
public void setPoolable(boolean poolable) throws java.sql.SQLException
setPoolable
in interface java.sql.Statement
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface Wrapper
java.sql.SQLException
Wrapper.isWrapperFor(Class)
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
protected static int findStartOfStatement(java.lang.String sql)
public java.io.InputStream getLocalInfileInputStream()
Statement
public void setLocalInfileInputStream(java.io.InputStream stream)
Statement
public void setPingTarget(PingTarget pingTarget)
public ExceptionInterceptor getExceptionInterceptor()
protected boolean containsOnDuplicateKeyInString(java.lang.String sql)
protected static int getOnDuplicateKeyLocation(java.lang.String sql, boolean dontCheckOnDuplicateKeyUpdateInSQL, boolean rewriteBatchedStatements, boolean noBackslashEscapes)
public void closeOnCompletion() throws java.sql.SQLException
closeOnCompletion
in interface java.sql.Statement
java.sql.SQLException
public boolean isCloseOnCompletion() throws java.sql.SQLException
isCloseOnCompletion
in interface java.sql.Statement
java.sql.SQLException
public long[] executeLargeBatch() throws java.sql.SQLException
executeBatch()
but returns long[] instead of int[].java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate(String)
but returns long instead of int.java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate(String, int)
but returns long instead of int.java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate(String, int[])
but returns long instead of int.java.sql.SQLException
public long executeLargeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate(String, String[])
but returns long instead of int.java.sql.SQLException
public long getLargeMaxRows() throws java.sql.SQLException
getMaxRows()
but returns long instead of int.java.sql.SQLException
public long getLargeUpdateCount() throws java.sql.SQLException
getUpdateCount()
but returns long instead of int;java.sql.SQLException
public void setLargeMaxRows(long max) throws java.sql.SQLException
setMaxRows(int)
but accepts a long value instead of an int.java.sql.SQLException