Top Description Inners Fields Constructors Methods
com.mysql.cj.jdbc

public Class ConnectionImpl

extends Object
implements JdbcConnection, SessionEventListener, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, com.mysql.cj.Session.SessionEventListener, com.mysql.cj.jdbc.JdbcConnection, com.mysql.cj.TransactionEventHandler, com.mysql.cj.MysqlConnection, java.sql.Connection, java.lang.AutoCloseable, java.sql.Wrapper
Imports
java.io.Serializable, java.lang.ref.WeakReference, java.net.InetSocketAddress, .SocketAddress, java.sql.Blob, .Clob, .DatabaseMetaData, .DriverManager, .NClob, .ResultSet, .SQLClientInfoException, .SQLException, .SQLPermission, .SQLWarning, .SQLXML, .Savepoint, .Struct, java.util.HashMap, .Iterator, .LinkedList, .List, .Map, .Properties, .Stack, java.util.concurrent.CopyOnWriteArrayList, .Executor, java.util.concurrent.locks.Lock, .ReentrantLock, java.util.stream.Collectors, com.mysql.cj.CacheAdapter, .CacheAdapterFactory, .LicenseConfiguration, .Messages, .NativeSession, .NoSubInterceptorWrapper, .PreparedQuery, .QueryInfo, .ServerVersion, .Session.SessionEventListener, com.mysql.cj.conf.HostInfo, .PropertyDefinitions.DatabaseTerm, .PropertyKey, .RuntimeProperty, com.mysql.cj.exceptions.CJCommunicationsException, .CJException, .ExceptionFactory, .ExceptionInterceptor, .ExceptionInterceptorChain, .MysqlErrorNumbers, .PasswordExpiredException, .UnableToConnectException, com.mysql.cj.interceptors.QueryInterceptor, com.mysql.cj.jdbc.exceptions.SQLError, .SQLExceptionsMapping, com.mysql.cj.jdbc.ha.MultiHostConnectionProxy, .MultiHostMySQLConnection, com.mysql.cj.jdbc.interceptors.ConnectionLifecycleInterceptor, com.mysql.cj.jdbc.result.CachedResultSetMetaData, .CachedResultSetMetaDataImpl, .ResultSetFactory, .ResultSetInternalMethods, .UpdatableResultSet, com.mysql.cj.log.ProfilerEvent, com.mysql.cj.protocol.ServerSessionStateController, .SocksProxySocketFactory, com.mysql.cj.protocol.a.NativeProtocol, com.mysql.cj.telemetry.TelemetryAttribute, .TelemetryScope, .TelemetrySpan, .TelemetrySpanName, com.mysql.cj.util.LRUCache, .StringUtils, .Util

A Connection represents a session with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.

A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is obtained with the getMetaData method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
ConnectionImpl.CompoundCacheKey

Used as a key for caching callable/prepared statements which (may) depend on current database.

private static class

Field Summary

Modifier and TypeField and Description
private static final SQLPermission
private int
private RuntimeProperty<Boolean>
private RuntimeProperty<Boolean>
private RuntimeProperty<Boolean>
private List<ConnectionLifecycleInterceptor>
pack-priv TelemetrySpan
private String
database

The database we're currently using.

private DatabaseMetaData
dbmd

Internal DBMD to use for various database-version specific features

private static final int
private static final int
private RuntimeProperty<Boolean>
private RuntimeProperty<Boolean>
private ExceptionInterceptor
private RuntimeProperty<Boolean>
private ClientInfoProvider
private boolean
isInGlobalTx

Is this connection associated with a global tx?

private int
isolationLevel

isolation level

private final Lock
private static Map<String, Integer>
mapTransIsolationNameToValue

Map mysql transaction isolation level name to java.sql.Connection.TRANSACTION_XXX.

protected ResultSetFactory
private final CopyOnWriteArrayList<JdbcStatement>
openStatements

An array of currently open statements.

private HostInfo
private String
private int
private JdbcConnection
private LRUCache<ConnectionImpl.CompoundCacheKey, CallableStatement.CallableStatementParamInfo>
private final Lock
private String
password

The password we used

private RuntimeProperty<Boolean>
private RuntimeProperty<Integer>
private RuntimeProperty<Boolean>
protected JdbcPropertySet
protected Properties
props

Properties for this connection specified by user

private CacheAdapter<String, QueryInfo>
queryInfoCache

A cache of SQL to parsed prepared statement parameters.

private List<QueryInterceptor>
private boolean
readOnly

Are we in read-only mode?

private RuntimeProperty<Boolean>
private MultiHostConnectionProxy
private RuntimeProperty<Boolean>
protected LRUCache<String, CachedResultSetMetaData>
resultSetMetadataCache

Cache of ResultSet metadata

protected final Lock
protected static Map<?, ?>
private static final long
private LRUCache<ConnectionImpl.CompoundCacheKey, ServerPreparedStatement>
private LRUCache<String, Boolean>
private final Lock
private NativeSession
private static final SQLPermission
private JdbcConnection
private Map<String, Class<?>>
typeMap

The type map for UDTs (not implemented, but used by some third-party vendors, most notably IBM WebSphere)

private RuntimeProperty<Boolean>
private RuntimeProperty<Boolean>
private String
user

The user we're connected as

private RuntimeProperty<Boolean>
private RuntimeProperty<Boolean>

Constructor Summary

AccessConstructor and Description
protected
ConnectionImpl()

' For the delegate only

public
ConnectionImpl(HostInfo
the HostInfo instance that contains the host, user and connections attributes for this connection
hostInfo
)

Creates a connection to a MySQL Server.

Method Summary

Modifier and TypeMethod and Description
public void
abort(Executor
The Executor implementation which will be used by abort.
executor
)

Implements java.sql.Connection.abort.

Terminates an open connection.

public void
abortInternal()

Implements com.mysql.cj.jdbc.JdbcConnection.abortInternal.

Clobbers the physical network connection and marks this connection as closed.

private boolean
public void
changeUser(String
the username to authenticate with
userName
,
String
the password to authenticate with
newPassword
)

Implements com.mysql.cj.jdbc.JdbcConnection.changeUser.

Changes the user on this connection by performing a re-authentication.

public void
private void
checkTransactionIsolationLevel()

Set transaction isolation level to the value received from server if any.

public void
cleanup(Throwable
exception caused the connection clean up
whyCleanedUp
)

Implements com.mysql.cj.MysqlConnection.cleanup.

Destroys this connection and any underlying resources.

public void
clearWarnings()

Implements java.sql.Connection.clearWarnings.

Clears all warnings reported for this Connection object.

public PreparedStatement
clientPrepareStatement(String
statement
sql
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public PreparedStatement
clientPrepareStatement(String
statement
sql
,
int
autoGenKeyIndex
autoGenKeyIndex
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public PreparedStatement
clientPrepareStatement(String
statement
sql
,
int
resultSetType
resultSetType
,
int
resultSetConcurrency
resultSetConcurrency
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public PreparedStatement
clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, boolean processEscapeCodesIfNeeded)

public PreparedStatement
clientPrepareStatement(String
statement
sql
,
int[]
autoGenKeyIndexes
autoGenKeyIndexes
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public PreparedStatement
clientPrepareStatement(String
statement
sql
,
String[]
autoGenKeyColNames
autoGenKeyColNames
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public PreparedStatement
clientPrepareStatement(String
statement
sql
,
int
resultSetType
resultSetType
,
int
resultSetConcurrency
resultSetConcurrency
,
int
resultSetHoldability
resultSetHoldability
)

Implements com.mysql.cj.jdbc.JdbcConnection.clientPrepareStatement.

Prepares a statement on the client, using client-side emulation (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

public void
close()

Implements java.sql.Connection.close.

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

private void
closeAllOpenStatements()

Closes all currently open statements.

private void
public void
commit()

Implements java.sql.Connection.commit.

Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.

private void
connectOneTryOnly(boolean isForReconnect)

private void
connectWithRetries(boolean isForReconnect)

public Array
createArrayOf(String
the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned by Array.getBaseTypeName
typeName
,
Object[]
the elements that populate the returned object
elements
)

Implements java.sql.Connection.createArrayOf.

Factory method for creating Array objects.

public Blob
createBlob()

Implements java.sql.Connection.createBlob.

Constructs an object that implements the Blob interface.

public Clob
createClob()

Implements java.sql.Connection.createClob.

Constructs an object that implements the Clob interface.

public NClob
createNClob()

Implements java.sql.Connection.createNClob.

Constructs an object that implements the NClob interface.

public void
createNewIO(boolean
is this request for a re-connect
isForReconnect
)

Implements com.mysql.cj.MysqlConnection.createNewIO.

Creates an IO channel to the server.

private void
public SQLXML
createSQLXML()

Implements java.sql.Connection.createSQLXML.

Constructs an object that implements the SQLXML interface.

public Statement
createStatement()

Implements java.sql.Connection.createStatement.

Creates a Statement object for sending SQL statements to the database.

public Statement
createStatement(int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.

public Statement
createStatement(int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.

public Struct
createStruct(String
the SQL type name of the SQL structured type that this Struct object maps to. The typeName is the name of a user-defined type that has been defined for this database. It is the value returned by Struct.getSQLTypeName.
typeName
,
Object[]
the attributes that populate the returned object
attributes
)

Implements java.sql.Connection.createStruct.

Factory method for creating Struct objects.

public void
public void
doClose(Throwable
the exception that caused this method call
reason
,
CloseOption...
options indicating how the close was initiated and/or what should be performed during the close
options
)

Implements com.mysql.cj.jdbc.JdbcConnection.doClose.

Close the connection and release resources.

public JdbcConnection
public int
getActiveStatementCount()

Implements com.mysql.cj.jdbc.JdbcConnection.getActiveStatementCount.

Returns the number of statements active on this connection, which haven't been .close()d.

public boolean
getAutoCommit()

Implements java.sql.Connection.getAutoCommit.

Retrieves the current auto-commit mode for this Connection object.

public int
getAutoIncrementIncrement()

Implements com.mysql.cj.jdbc.JdbcConnection.getAutoIncrementIncrement.

Returns the session value of 'auto_increment_increment' from the server if it exists, or '1' if not.

public CachedResultSetMetaData
getCachedMetaData(String
the query that is the key to the cache
sql
)

Implements com.mysql.cj.jdbc.JdbcConnection.getCachedMetaData.

Returns cached metadata (or null if not cached) for the given query, which must match _exactly_.

public String
getCatalog()

Implements java.sql.Connection.getCatalog.

Retrieves this Connection object's current catalog name.

public String
public String
getClientInfo(String
The name of the client info property to retrieve
name
)

Implements java.sql.Connection.getClientInfo.

Returns the value of the client info property specified by name.

public Properties
getClientInfo()

Implements java.sql.Connection.getClientInfo.

Returns a list containing the name and current value of each client info property supported by the driver.

public ClientInfoProvider
public Lock
public String
getDatabase()

Implements com.mysql.cj.jdbc.JdbcConnection.getDatabase.

Retrieves this connection object's current database name.

public ExceptionInterceptor
public int
getHoldability()

Implements java.sql.Connection.getHoldability.

Retrieves the current holdability of ResultSet objects created using this Connection object.

public String
public String
public long
public long

Returns:

number of ms that this connection has been idle, 0 if the driver is busy retrieving results.
getIdleFor
()

Implements com.mysql.cj.jdbc.JdbcConnection.getIdleFor.

NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle.

public static JdbcConnection

Returns:

new ConnectionImpl instance
getInstance
(HostInfo
HostInfo instance
hostInfo
)

Creates a connection instance.

public Lock
private int
public DatabaseMetaData
getMetaData()

Implements java.sql.Connection.getMetaData.

Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection.

private DatabaseMetaData
getMetaData(boolean checkClosed, boolean checkForInfoSchema)

public Statement
public Statement
public JdbcConnection
public JdbcConnection
public int
getNetworkTimeout()

Implements java.sql.Connection.getNetworkTimeout.

Retrieves the number of milliseconds the driver will wait for a database request to complete.

public Properties
getProperties()

Implements com.mysql.cj.MysqlConnection.getProperties.

Returns the parsed and passed in properties for this connection.

public JdbcPropertySet
private JdbcConnection
public List<QueryInterceptor>
public String
getSchema()

Implements java.sql.Connection.getSchema.

Retrieves this Connection object's current schema name.

public ServerSessionStateController
public ServerVersion
public NativeSession
public int
getSessionMaxRows()

Implements com.mysql.cj.jdbc.JdbcConnection.getSessionMaxRows.

Returns the sql select limit max-rows for this session.

public String
getStatementComment()

Implements com.mysql.cj.jdbc.JdbcConnection.getStatementComment.

Returns the comment that will be prepended to all statements sent to the server.

public int
getTransactionIsolation()

Implements java.sql.Connection.getTransactionIsolation.

Retrieves this Connection object's current transaction isolation level.

public Map<String, Class<?>>
getTypeMap()

Implements java.sql.Connection.getTypeMap.

Retrieves the Map object associated with this Connection object.

public String
public String
public SQLWarning
getWarnings()

Implements java.sql.Connection.getWarnings.

Retrieves the first warning reported by calls on this Connection object.

private void
handleAutoCommitDefaults()

Resets a default auto-commit value of 0 to 1, as required by JDBC specification.

public void
public void
public void
public boolean
hasSameProperties(JdbcConnection
connection
c
)

Implements com.mysql.cj.jdbc.JdbcConnection.hasSameProperties.

Does this connection have the same properties as another?

private void
initializePropsFromServer()

Sets varying properties that depend on server information.

public void
initializeResultsMetadataFromCache(String
the query that the metadata pertains too.
sql
,
CachedResultSetMetaData
metadata (if it exists) to populate the cache.
cachedMetaData
,
ResultSetInternalMethods
the result set to retrieve metadata from, or apply to.
resultSet
)

Implements com.mysql.cj.jdbc.JdbcConnection.initializeResultsMetadataFromCache.

Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key.

public void
public boolean
isClosed()

Implements java.sql.Connection.isClosed.

Retrieves whether this Connection object has been closed.

public boolean
isInGlobalTx()

Implements com.mysql.cj.jdbc.JdbcConnection.isInGlobalTx.

Is this connection currently a participant in an XA transaction?

public boolean
public boolean
isReadOnly()

Implements java.sql.Connection.isReadOnly.

Retrieves whether this Connection object is in read-only mode.

public boolean
isReadOnly(boolean
in some cases, for example when restoring connection with autoReconnect=true, we can rely only on saved readOnly state, so use useSessionStatus=false in that case
useSessionStatus
)

Implements com.mysql.cj.jdbc.JdbcConnection.isReadOnly.

Tests to see if the connection is in Read Only Mode.

public boolean
isSameResource(JdbcConnection
connection
otherConnection
)

Implements com.mysql.cj.jdbc.JdbcConnection.isSameResource.

Does this connection have the same resource name as the given connection (for XA)?

public boolean
isServerLocal()

Implements com.mysql.cj.jdbc.JdbcConnection.isServerLocal.

Is the server this connection is connected to "local" (i.e. same host) as the application?

public boolean
isSourceConnection()

Implements com.mysql.cj.jdbc.JdbcConnection.isSourceConnection.

Is this connection connected to the first host in the list if there is a list of servers in the URL?

public boolean
isValid(int
The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operationcompletes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.
timeout
)

Implements java.sql.Connection.isValid.

Returns true if the connection has not been closed and is still valid.

public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

public boolean
lowerCaseTableNames()

Implements com.mysql.cj.jdbc.JdbcConnection.lowerCaseTableNames.

Is the server configured to use lower-case table names only?

public String
nativeSQL(String
an SQL statement that may contain one or more '?' parameter placeholders
sql
)

Implements java.sql.Connection.nativeSQL.

Converts the given SQL statement into the system's native SQL grammar.

private CallableStatement
public void
ping()

Implements com.mysql.cj.jdbc.JdbcConnection.ping.

Detect if the connection is still good by sending a ping command to the server.

public void
pingInternal(boolean checkForClosedConnection, int timeoutMillis)

Implements com.mysql.cj.jdbc.JdbcConnection.pingInternal.

public CallableStatement
prepareCall(String
an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is specified using JDBC call escape syntax.
sql
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object for calling database stored procedures.

public CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.

public CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.

public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
)

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object for sending parameterized SQL statements to the database.

public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int
a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
autoGenKeyIndex
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.

public PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.

public PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.

public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int[]
an array of column indexes indicating the columns that should be returned from the inserted row or rows
autoGenKeyIndexes
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.

public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
String[]
an array of column names indicating the columns that should be returned from the inserted row or rows
autoGenKeyColNames
)

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.

public void
public void
registerStatement(JdbcStatement
the Statement instance to remove
stmt
)

Implements com.mysql.cj.jdbc.JdbcConnection.registerStatement.

Register a Statement instance as open.

public void
releaseSavepoint(Savepoint
the Savepoint object to be removed
savepoint
)

Implements java.sql.Connection.releaseSavepoint.

Removes the specified Savepoint and subsequent Savepoint objects from the current transaction.

public void
resetServerState()

Implements com.mysql.cj.jdbc.JdbcConnection.resetServerState.

Resets the server-side state of this connection.

public void
rollback()

Implements java.sql.Connection.rollback.

Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.

public void
rollback(final Savepoint
the Savepoint object to roll back to
savepoint
)

Implements java.sql.Connection.rollback.

Undoes all changes made after the given Savepoint object was set.

private void
public PreparedStatement
serverPrepareStatement(String
statement
sql
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public PreparedStatement
serverPrepareStatement(String
statement
sql
,
int
autoGenKeyIndex
autoGenKeyIndex
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public PreparedStatement
serverPrepareStatement(String
statement
sql
,
int
resultSetType
resultSetType
,
int
resultSetConcurrency
resultSetConcurrency
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public PreparedStatement
serverPrepareStatement(String
statement
sql
,
int
resultSetType
resultSetType
,
int
resultSetConcurrency
resultSetConcurrency
,
int
resultSetHoldability
resultSetHoldability
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public PreparedStatement
serverPrepareStatement(String
statement
sql
,
int[]
autoGenKeyIndexes
autoGenKeyIndexes
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public PreparedStatement
serverPrepareStatement(String
statement
sql
,
String[]
autoGenKeyColNames
autoGenKeyColNames
)

Implements com.mysql.cj.jdbc.JdbcConnection.serverPrepareStatement.

Prepares a statement on the server (regardless of the configuration property 'useServerPrepStmts') with the same semantics as the method java.sql.Connection.prepareStatement() with the same argument types.

public void
setAutoCommit(final boolean
true to enable auto-commit mode; false to disable it
autoCommitFlag
)

Implements java.sql.Connection.setAutoCommit.

Sets this connection's auto-commit mode to the given state.

public void
setCatalog(final String
the name of a catalog (subspace in this Connection object's database) in which to work
catalog
)

Implements java.sql.Connection.setCatalog.

Sets the given catalog name in order to select a subspace of this Connection object's database in which to work.

public void
setClientInfo(String
The name of the client info property to set
name
,
String
The value to set the client info property to. If the value is null, the current value of the specified property is cleared.
value
)

Implements java.sql.Connection.setClientInfo.

Sets the value of the client info property specified by name to the value specified by value.

public void
setClientInfo(Properties
the list of client info properties to set
properties
)

Implements java.sql.Connection.setClientInfo.

Sets the value of the connection's client info properties.

public void
setDatabase(final String
the database for this connection to use
db
)

Implements com.mysql.cj.jdbc.JdbcConnection.setDatabase.

Set current database for this connection.

public void
setFailedOver(boolean
The failedOver flag to set.
flag
)

Implements com.mysql.cj.jdbc.JdbcConnection.setFailedOver.

public void
setHoldability(int
a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
arg0
)

Implements java.sql.Connection.setHoldability.

Changes the default holdability of ResultSet objects created using this Connection object to the given holdability.

public void
setInGlobalTx(boolean
the state flag
flag
)

Implements com.mysql.cj.jdbc.JdbcConnection.setInGlobalTx.

Set the state of being in a global (XA) transaction.

public void
setNetworkTimeout(Executor
The Executor implementation which will be used by setNetworkTimeout.
executor
,
final int
The time in milliseconds to wait for the database operation to complete. If the JDBC driver does not support milliseconds, the JDBC driver will round the value up to the nearest second. If the timeout period expires before the operation completes, a SQLException will be thrown. A value of 0 indicates that there is not timeout for database operations.
milliseconds
)

Implements java.sql.Connection.setNetworkTimeout.

Sets the maximum period a Connection or objects created from the Connection will wait for the database to reply to any one request.

public void
public void
setReadOnly(boolean
true enables read-only mode; false disables it
readOnlyFlag
)

Implements java.sql.Connection.setReadOnly.

Puts this connection in read-only mode as a hint to the driver to enable database optimizations.

public void
public Savepoint
setSavepoint()

Implements java.sql.Connection.setSavepoint.

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.

private void
public Savepoint
setSavepoint(String
a String containing the name of the savepoint
name
)

Implements java.sql.Connection.setSavepoint.

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.

public void
setSchema(String
the name of a schema in which to work
schema
)

Implements java.sql.Connection.setSchema.

Sets the given schema name to access.

public void
setSessionMaxRows(int
the new max-rows value to set.
max
)

Implements com.mysql.cj.jdbc.JdbcConnection.setSessionMaxRows.

Sets the sql select limit max-rows for this session if different from current.

public void
setStatementComment(String
the comment that will be prepended to all statements sent to the server.
comment
)

Implements com.mysql.cj.jdbc.JdbcConnection.setStatementComment.

Sets the comment that will be prepended to all statements sent to the server.

public void
setTransactionIsolation(int
one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE. (Note that Connection.TRANSACTION_NONE cannot be used because it specifies that transactions are not supported.)
level
)

Implements java.sql.Connection.setTransactionIsolation.

Attempts to change the transaction isolation level for this Connection object to the one given.

public void
setTypeMap(Map<String, Class<?>>
the java.util.Map object to install as the replacement for this Connection object's default type map
map
)

Implements java.sql.Connection.setTypeMap.

Installs the given TypeMap object as the type map for this Connection object.

private void
public void
shutdownServer()

Implements com.mysql.cj.jdbc.JdbcConnection.shutdownServer.

Used by MiniAdmin to shutdown a MySQL server

public boolean
public void
public void
public void
public void
unregisterStatement(JdbcStatement
the Statement instance to remove
stmt
)

Implements com.mysql.cj.jdbc.JdbcConnection.unregisterStatement.

Remove the given statement from the list of open statements

public void
public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

public boolean
versionMeetsMinimum(int major, int minor, int subminor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait