Save This Page
Home » MySQL-JDBC-5.1.11 » com.mysql.jdbc » [javadoc | source]
com.mysql.jdbc
public interface: Connection [javadoc | source]

All Implemented Interfaces:
    Connection, ConnectionProperties

All Known Implementing Classes:
    ConnectionWrapper, ConnectionImpl, JDBC4Connection, JDBC4ConnectionWrapper, ReplicationConnection

This interface contains methods that are considered the "vendor extension" to the JDBC API for MySQL's implementation of java.sql.Connection. 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 ConnectionImpl throughout the code).
Method from com.mysql.jdbc.Connection Summary:
changeUser,   clearHasTriedMaster,   clientPrepareStatement,   clientPrepareStatement,   clientPrepareStatement,   clientPrepareStatement,   clientPrepareStatement,   clientPrepareStatement,   getActiveStatementCount,   getAutoIncrementIncrement,   getIdleFor,   getLog,   getProperties,   getServerCharacterEncoding,   getServerTimezoneTZ,   getStatementComment,   hasSameProperties,   hasTriedMaster,   initializeExtension,   isAbonormallyLongQuery,   isInGlobalTx,   isMasterConnection,   isNoBackslashEscapesSet,   isSameResource,   lowerCaseTableNames,   parserKnowsUnicode,   ping,   reportQueryTime,   resetServerState,   serverPrepareStatement,   serverPrepareStatement,   serverPrepareStatement,   serverPrepareStatement,   serverPrepareStatement,   serverPrepareStatement,   setFailedOver,   setInGlobalTx,   setPreferSlaveDuringFailover,   setStatementComment,   shutdownServer,   supportsIsolationLevel,   supportsQuotedIdentifiers,   supportsTransactions,   versionMeetsMinimum
Method from com.mysql.jdbc.Connection Detail:
 abstract public  void changeUser(String userName,
    String newPassword) throws SQLException
    Changes the user on this connection by performing a re-authentication. If authentication fails, the connection will remain under the context of the current user.
 abstract public  void clearHasTriedMaster()
 abstract public PreparedStatement clientPrepareStatement(String sql) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement clientPrepareStatement(String sql,
    int autoGenKeyIndex) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement clientPrepareStatement(String sql,
    int[] autoGenKeyIndexes) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement clientPrepareStatement(String sql,
    String[] autoGenKeyColNames) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement clientPrepareStatement(String sql,
    int resultSetType,
    int resultSetConcurrency) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement clientPrepareStatement(String sql,
    int resultSetType,
    int resultSetConcurrency,
    int resultSetHoldability) throws SQLException
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public int getActiveStatementCount()
    Returns the number of statements active on this connection, which haven't been .close()d.
 abstract public int getAutoIncrementIncrement()
    Returns the -session- value of 'auto_increment_increment' from the server if it exists, or '1' if not.
 abstract public long getIdleFor()
    Reports how long this connection has been idle. This time (reported in milliseconds) is updated once a query has completed.
 abstract public Log getLog() throws SQLException
    Returns the log mechanism that should be used to log information from/for this Connection.
 public Properties getProperties()
    Returns the parsed and passed in properties for this connection.
 abstract public String getServerCharacterEncoding()
    Returns the server's character set
 abstract public TimeZone getServerTimezoneTZ()
    Returns the TimeZone that represents the configured timezone for the server.
 abstract public String getStatementComment()
    Returns the comment that will be prepended to all statements sent to the server.
 public boolean hasSameProperties(Connection c)
    Does this connection have the same properties as another?
 abstract public boolean hasTriedMaster()
    Has this connection tried to execute a query on the "master" server (first host in a multiple host list).
 abstract public  void initializeExtension(Extension ex) throws SQLException
 abstract public boolean isAbonormallyLongQuery(long millisOrNanos)
 abstract public boolean isInGlobalTx()
    Is this connection currently a participant in an XA transaction?
 abstract public boolean isMasterConnection()
    Is this connection connected to the first host in the list if there is a list of servers in the URL?
 abstract public boolean isNoBackslashEscapesSet()
    Is the server in a sql_mode that doesn't allow us to use \\ to escape things?
 abstract public boolean isSameResource(Connection c)
    Does this connection have the same resource name as the given connection (for XA)?
 abstract public boolean lowerCaseTableNames()
    Is the server configured to use lower-case table names only?
 abstract public boolean parserKnowsUnicode()
    Does the server this connection is connected to support unicode?
 abstract public  void ping() throws SQLException
    Detect if the connection is still good by sending a ping command to the server.
 abstract public  void reportQueryTime(long millisOrNanos)
 abstract public  void resetServerState() throws SQLException
    Resets the server-side state of this connection. Doesn't work for MySQL versions older than 4.0.6 or if isParanoid() is set (it will become a no-op in these cases). Usually only used from connection pooling code.
 abstract public PreparedStatement serverPrepareStatement(String sql) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement serverPrepareStatement(String sql,
    int autoGenKeyIndex) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement serverPrepareStatement(String sql,
    int[] autoGenKeyIndexes) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement serverPrepareStatement(String sql,
    String[] autoGenKeyColNames) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement serverPrepareStatement(String sql,
    int resultSetType,
    int resultSetConcurrency) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public PreparedStatement serverPrepareStatement(String sql,
    int resultSetType,
    int resultSetConcurrency,
    int resultSetHoldability) throws SQLException
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
 abstract public  void setFailedOver(boolean flag)
 public  void setInGlobalTx(boolean flag)
    Set the state of being in a global (XA) transaction.
 abstract public  void setPreferSlaveDuringFailover(boolean flag)
 abstract public  void setStatementComment(String comment)
    Sets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.
 abstract public  void shutdownServer() throws SQLException
    Used by MiniAdmin to shutdown a MySQL server
 abstract public boolean supportsIsolationLevel()
    Does the server this connection is connected to support quoted isolation levels?
 abstract public boolean supportsQuotedIdentifiers()
    Does the server this connection is connected to support quoted identifiers?
 abstract public boolean supportsTransactions()
    Does the server this connection is connected to support quoted identifiers?
 abstract public boolean versionMeetsMinimum(int major,
    int minor,
    int subminor) throws SQLException
    Does the server this connection is connected to meet or exceed the given version?