com.mysql.cj.jdbc

## Interface JdbcStatement

All Superinterfaces:
  AutoCloseable, Query, Statement, Wrapper

All Known Subinterfaces:
  JdbcPreparedStatement

    public interface JdbcStatement
    extends Statement, Query

This interface contains methods that are considered the "vendor extension" to the JDBC API for MySQL's implementation of java.sql.Statement. For those looking further into the driver implementation, it is not an API that is used for plugability of implementations inside our driver (which is why there are still references to StatementImpl throughout the code).

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.mysql.cj.Query

`Query.CancelStatus`

### Field Summary

Fields
`static int` `MAX_ROWS`

### 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

All Methods Instance Methods Abstract Methods
`void` `clearAttributes()`
`void` `disableStreamingResults()` Resets this statements fetch size and result set type to the values they had before enableStreamingResults() was called.
`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.
`ExceptionInterceptor` `getExceptionInterceptor()`
`InputStream` `getLocalInfileInputStream()` Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement.
`int` `getOpenResultSetCount()` Returns the number of open result sets for this statement.
`Query` `getQuery()`
`ResultSetInternalMethods` `getResultSetInternal()`
`void` `removeOpenResultSet(ResultSetInternalMethods rs)` Callback for result set instances to remove them from the Set that tracks them per-statement
`void` `setAttribute(String name, Object value)`
`void` `setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)`
`void` `setLocalInfileInputStream(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` `setPingTarget(PingTarget pingTarget)`

### Methods inherited from interface java.sql.Statement

`addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, 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, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Methods inherited from interface com.mysql.cj.Query

`addBatch, checkCancelTimeout, clearBatchedArgs, closeQuery, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getQueryAttributesBindings, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, statementBegins, stopQueryTimer`

### Field Detail

#### MAX_ROWS

    static final int MAX_ROWS

See Also:
  Constant Field Values

### Method Detail

#### enableStreamingResults

    void enableStreamingResults()
                         throws SQLException

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.

Throws:
  `SQLException` - if an error occurs

#### disableStreamingResults

    void disableStreamingResults()
                          throws SQLException

Resets this statements fetch size and result set type to the values they had before enableStreamingResults() was called.

Throws:
  `SQLException` - if an error occurs

#### setLocalInfileInputStream

    void setLocalInfileInputStream(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. This stream will be read to completion upon execution of a "LOAD DATA LOCAL INFILE" statement, and will automatically be closed by the driver, so it needs to be reset before each call to execute*() that would cause the MySQL server to request data to fulfill the request for "LOAD DATA LOCAL INFILE". If this value is set to NULL, the driver will revert to using a FileInputStream or URLInputStream as required.

Parameters:
  `stream` - input stream

#### getLocalInfileInputStream

    InputStream getLocalInfileInputStream()

Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement. This method returns NULL if no such stream has been set via setLocalInfileInputStream().

Returns:
  input stream

#### setPingTarget

    void setPingTarget(PingTarget pingTarget)

#### getExceptionInterceptor

    ExceptionInterceptor getExceptionInterceptor()

#### removeOpenResultSet

    void removeOpenResultSet(ResultSetInternalMethods rs)

Callback for result set instances to remove them from the Set that tracks them per-statement

Parameters:
  `rs` - result set

#### getOpenResultSetCount

    int getOpenResultSetCount()

Returns the number of open result sets for this statement.

Returns:
  the number of open result sets for this statement

#### setHoldResultsOpenOverClose

    void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)

#### getQuery

    Query getQuery()

#### setAttribute

    void setAttribute(String name,
                      Object value)

#### clearAttributes

    void clearAttributes()

#### getResultSetInternal

    ResultSetInternalMethods getResultSetInternal()

Copyright © 2016, 2024, Oracle and/or its affiliates.