|
MySQL Connector/J size='-1'>5.1.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mysql.jdbc.ConnectionPropertiesImpl
com.mysql.jdbc.ConnectionImpl
public class ConnectionImpl
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.
Connection,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.mysql.jdbc.ConnectionPropertiesImpl |
|---|
ConnectionPropertiesImpl.LongConnectionProperty |
| Field Summary | |
|---|---|
static java.util.Map |
charsetMap
The mapping between MySQL charset names and Java charset names. |
protected static java.lang.String |
DEFAULT_LOGGER_CLASS
Default logger class name |
protected java.util.Properties |
props
Properties for this connection specified by user |
protected LRUCache |
resultSetMetadataCache
Cache of ResultSet metadata |
| Fields inherited from class com.mysql.jdbc.ConnectionPropertiesImpl |
|---|
largeRowSizeThreshold, ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL, ZERO_DATETIME_BEHAVIOR_EXCEPTION, ZERO_DATETIME_BEHAVIOR_ROUND |
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
protected |
ConnectionImpl()
' For the delegate only |
protected |
ConnectionImpl(java.lang.String hostToConnectTo,
int portToConnectTo,
java.util.Properties info,
java.lang.String databaseToConnectTo,
java.lang.String url)
Creates a connection to a MySQL Server. |
| Method Summary | ||
|---|---|---|
protected void |
abortInternal()
Clobbers the physical network connection and marks this connection as closed. |
|
protected static java.sql.SQLException |
appendMessageToException(java.sql.SQLException sqlEx,
java.lang.String messageToAppend)
|
|
void |
changeUser(java.lang.String userName,
java.lang.String newPassword)
Changes the user on this connection by performing a re-authentication. |
|
protected void |
checkClosed()
|
|
void |
clearHasTriedMaster()
|
|
void |
clearWarnings()
After this call, getWarnings returns null until a new warning is reported for this connection. |
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql)
DOCUMENT ME! |
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
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. |
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
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. |
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
DOCUMENT ME! |
|
protected java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
boolean processEscapeCodesIfNeeded)
|
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
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. |
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
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. |
|
void |
close()
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them to be automatically released (cant think why off the top of my head) Note: A Connection is automatically closed when it is garbage collected. |
|
void |
commit()
The method commit() makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection. |
|
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
|
|
java.sql.Blob |
createBlob()
|
|
Clob |
createClob()
|
|
java.sql.NClob |
createNClob()
|
|
protected void |
createNewIO(boolean isForReconnect)
Creates an IO channel to the server |
|
java.sql.SQLXML |
createSQLXML()
|
|
java.sql.Statement |
createStatement()
SQL statements without parameters are normally executed using Statement objects. |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
JDBC 2.0 Same as createStatement() above, but allows the default result set type and result set concurrency type to be overridden. |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
|
protected void |
dumpTestcaseQuery(java.lang.String query)
|
|
protected Connection |
duplicate()
|
|
protected java.lang.String |
extractSqlFromPacket(java.lang.String possibleSqlQuery,
com.mysql.jdbc.Buffer queryPacket,
int endOfQueryPacketPosition)
|
|
protected void |
finalize()
DOCUMENT ME! |
|
protected java.lang.StringBuffer |
generateConnectionCommentBlock(java.lang.StringBuffer buf)
|
|
int |
getActiveStatementCount()
Returns the number of statements active on this connection, which haven't been .close()d. |
|
boolean |
getAutoCommit()
Gets the current auto-commit state |
|
protected CachedResultSetMetaData |
getCachedMetaData(java.lang.String sql)
Returns cached metadata (or null if not cached) for the given query, which must match _exactly_. |
|
protected java.util.Calendar |
getCalendarInstanceForSessionOrNew()
Optimization to only use one calendar per-session, or calculate it for each call, depending on user configuration |
|
protected static java.util.Timer |
getCancelTimer()
|
|
java.lang.String |
getCatalog()
Return the connections current catalog name, or null if no catalog name is set, or we dont support catalogs. |
|
protected java.lang.String |
getCharacterSetMetadata()
|
|
protected java.lang.String |
getCharsetNameForIndex(int charsetIndex)
Returns the Java character encoding name for the given MySQL server charset index |
|
java.util.Properties |
getClientInfo()
|
|
java.lang.String |
getClientInfo(java.lang.String name)
|
|
protected java.util.TimeZone |
getDefaultTimeZone()
DOCUMENT ME! |
|
protected java.lang.String |
getErrorMessageEncoding()
|
|
int |
getHoldability()
|
|
long |
getIdleFor()
NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle. |
|
protected static Connection |
getInstance(java.lang.String hostToConnectTo,
int portToConnectTo,
java.util.Properties info,
java.lang.String databaseToConnectTo,
java.lang.String url)
Creates a connection instance -- We need to provide factory-style methods so we can support both JDBC3 (and older) and JDBC4 runtimes, otherwise the class verifier complains when it tries to load JDBC4-only interface classes that are present in JDBC4 method signatures. |
|
protected com.mysql.jdbc.MysqlIO |
getIO()
Returns the IO channel to the server |
|
Log |
getLog()
Returns the log mechanism that should be used to log information from/for this Connection. |
|
protected int |
getMaxBytesPerChar(java.lang.String javaCharsetName)
|
|
java.sql.DatabaseMetaData |
getMetaData()
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. |
|
protected java.sql.Statement |
getMetadataSafeStatement()
|
|
java.lang.String |
getServerCharacterEncoding()
Returns the server's character set |
|
java.util.TimeZone |
getServerTimezoneTZ()
DOCUMENT ME! |
|
protected java.util.Calendar |
getSessionLockedCalendar()
|
|
java.lang.String |
getStatementComment()
Returns the comment that will be prepended to all statements sent to the server. |
|
int |
getTransactionIsolation()
Get this Connection's current transaction isolation mode. |
|
java.util.Map |
getTypeMap()
JDBC 2.0 Get the type-map object associated with this connection. |
|
protected java.util.Calendar |
getUtcCalendar()
|
|
java.sql.SQLWarning |
getWarnings()
The first warning reported by calls on this Connection is returned. |
|
boolean |
hasSameProperties(Connection c)
|
|
boolean |
hasTriedMaster()
Has this connection tried to execute a query on the "master" server (first host in a multiple host list). |
|
protected void |
incrementNumberOfPreparedExecutes()
|
|
protected void |
incrementNumberOfPrepares()
|
|
protected void |
incrementNumberOfResultSetsCreated()
|
|
void |
initializeExtension(Extension ex)
|
|
protected void |
initializeResultsMetadataFromCache(java.lang.String sql,
CachedResultSetMetaData cachedMetaData,
ResultSetInternalMethods resultSet)
Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key. |
|
boolean |
isAbonormallyLongQuery(long millisOrNanos)
|
|
protected boolean |
isClientTzUTC()
|
|
boolean |
isClosed()
DOCUMENT ME! |
|
protected boolean |
isCursorFetchEnabled()
|
|
boolean |
isInGlobalTx()
Is this connection currently a participant in an XA transaction? |
|
boolean |
isMasterConnection()
Is this connection connected to the first host in the list if there is a list of servers in the URL? |
|
boolean |
isNoBackslashEscapesSet()
Is the server in a sql_mode that doesn't allow us to use \\ to escape things? |
|
boolean |
isReadOnly()
Tests to see if the connection is in Read Only Mode. |
|
protected boolean |
isRunningOnJDK13()
|
|
boolean |
isSameResource(Connection otherConnection)
Does this connection have the same resource name as the given connection (for XA)? |
|
protected boolean |
isServerTzUTC()
|
|
boolean |
isValid(int timeout)
|
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
boolean |
lowerCaseTableNames()
Is the server configured to use lower-case table names only? |
|
java.lang.String |
nativeSQL(java.lang.String sql)
A driver may convert the JDBC sql grammar into its system's native SQL grammar prior to sending it; nativeSQL returns the native form of the statement that the driver would have sent. |
|
boolean |
parserKnowsUnicode()
DOCUMENT ME! |
|
void |
ping()
Detect if the connection is still good |
|
protected void |
pingInternal(boolean checkForClosedConnection)
|
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
DOCUMENT ME! |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
JDBC 2.0 Same as prepareCall() above, but allows the default result set type and result set concurrency type to be overridden. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGenKeyIndex)
|
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
|
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
JDBC 2.0 Same as prepareStatement() above, but allows the default result set type and result set concurrency type to be overridden. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
|
|
protected void |
realClose(boolean calledExplicitly,
boolean issueRollback,
boolean skipLocalTeardown,
java.lang.Throwable reason)
Closes connection and frees resources. |
|
protected void |
recachePreparedStatement(ServerPreparedStatement pstmt)
|
|
protected void |
registerQueryExecutionTime(long queryTimeMs)
DOCUMENT ME! |
|
void |
releaseSavepoint(java.sql.Savepoint arg0)
|
|
protected void |
reportNumberOfTablesAccessed(int numTablesAccessed)
|
|
void |
reportQueryTime(long millisOrNanos)
|
|
void |
resetServerState()
Resets the server-side state of this connection. |
|
void |
rollback()
The method rollback() drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection. |
|
void |
rollback(java.sql.Savepoint savepoint)
|
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql)
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. |
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
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. |
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
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. |
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
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. |
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
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. |
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
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. |
|
protected boolean |
serverSupportsConvertFn()
|
|
void |
setAutoCommit(boolean autoCommitFlag)
If a connection is in auto-commit mode, than all its SQL statements will be executed and committed as individual transactions. |
|
void |
setCatalog(java.lang.String catalog)
A sub-space of this Connection's database may be selected by setting a catalog name. |
|
void |
setClientInfo(java.util.Properties properties)
|
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
|
void |
setFailedOver(boolean flag)
|
|
void |
setHoldability(int arg0)
|
|
void |
setInGlobalTx(boolean flag)
Set the state of being in a global (XA) transaction. |
|
void |
setPreferSlaveDuringFailover(boolean flag)
|
|
void |
setReadOnly(boolean readOnlyFlag)
You can put a connection in read-only mode as a hint to enable database optimizations Note: setReadOnly cannot be called while in the middle of a transaction |
|
protected void |
setReadOnlyInternal(boolean readOnlyFlag)
|
|
java.sql.Savepoint |
setSavepoint()
|
|
java.sql.Savepoint |
setSavepoint(java.lang.String name)
|
|
void |
setStatementComment(java.lang.String comment)
Sets the comment that will be prepended to all statements sent to the server. |
|
void |
setTransactionIsolation(int level)
DOCUMENT ME! |
|
void |
setTypeMap(java.util.Map map)
JDBC 2.0 Install a type-map object as the default type-map for this connection |
|
void |
shutdownServer()
Used by MiniAdmin to shutdown a MySQL server |
|
boolean |
supportsIsolationLevel()
DOCUMENT ME! |
|
boolean |
supportsQuotedIdentifiers()
DOCUMENT ME! |
|
boolean |
supportsTransactions()
DOCUMENT ME! |
|
protected void |
transactionBegun()
|
|
protected void |
transactionCompleted()
|
|
|
unwrap(java.lang.Class<T> iface)
|
|
boolean |
versionMeetsMinimum(int major,
int minor,
int subminor)
Does the server this connection is connected to meet or exceed the given version? |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.Map charsetMap
protected static final java.lang.String DEFAULT_LOGGER_CLASS
protected java.util.Properties props
protected LRUCache resultSetMetadataCache
| Constructor Detail |
|---|
protected ConnectionImpl()
protected ConnectionImpl(java.lang.String hostToConnectTo,
int portToConnectTo,
java.util.Properties info,
java.lang.String databaseToConnectTo,
java.lang.String url)
throws java.sql.SQLException
hostToConnectTo - the hostname of the database serverportToConnectTo - the port number the server is listening oninfo - a Properties[] list holding the user and passworddatabaseToConnectTo - the database to connect tourl - the URL of the connectiond - the Driver instantation of the connection
java.sql.SQLException - if a database access error occurs| Method Detail |
|---|
protected static java.sql.SQLException appendMessageToException(java.sql.SQLException sqlEx,
java.lang.String messageToAppend)
protected static java.util.Timer getCancelTimer()
protected static Connection getInstance(java.lang.String hostToConnectTo,
int portToConnectTo,
java.util.Properties info,
java.lang.String databaseToConnectTo,
java.lang.String url)
throws java.sql.SQLException
java.sql.SQLException
public void changeUser(java.lang.String userName,
java.lang.String newPassword)
throws java.sql.SQLException
userName - the username to authenticate withnewPassword - the password to authenticate with
java.sql.SQLException - if authentication fails, or some other error occurs while
performing the command.
protected void checkClosed()
throws java.sql.SQLException
java.sql.SQLException
protected void abortInternal()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void clearHasTriedMaster()
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurs
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql)
throws java.sql.SQLException
sql - DOCUMENT ME!
java.sql.SQLException - DOCUMENT ME!Connection.prepareStatement(String)
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int)
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
sql - DOCUMENT ME!resultSetType - DOCUMENT ME!resultSetConcurrency - DOCUMENT ME!
java.sql.SQLException - DOCUMENT ME!Connection.prepareStatement(String, int, int)
protected java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
boolean processEscapeCodesIfNeeded)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int[])
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, String[])
public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int, int, int)
public void close()
throws java.sql.SQLException
close in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurs
public void commit()
throws java.sql.SQLException
Note: MySQL does not support transactions, so this method is a no-op.
commit in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurssetAutoCommit
protected void createNewIO(boolean isForReconnect)
throws java.sql.SQLException
isForReconnect - is this request for a re-connect
java.sql.SQLException - if a database access error occurs
CommunicationsException - DOCUMENT ME!
public java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException - passed through from the constructor
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.ConnectionresultSetType - a result set type, see ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException - if a database-access error occurs.
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionConnection.createStatement(int, int, int)protected void dumpTestcaseQuery(java.lang.String query)
protected Connection duplicate()
throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String extractSqlFromPacket(java.lang.String possibleSqlQuery,
com.mysql.jdbc.Buffer queryPacket,
int endOfQueryPacketPosition)
throws java.sql.SQLException
java.sql.SQLException
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - DOCUMENT ME!protected java.lang.StringBuffer generateConnectionCommentBlock(java.lang.StringBuffer buf)
public int getActiveStatementCount()
Connection
public boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException - if an error occurssetAutoCommitprotected java.util.Calendar getCalendarInstanceForSessionOrNew()
public java.lang.String getCatalog()
throws java.sql.SQLException
Note: MySQL's notion of catalogs are individual databases.
getCatalog in interface java.sql.Connectionjava.sql.SQLException - if a database access error occursprotected java.lang.String getCharacterSetMetadata()
protected java.lang.String getCharsetNameForIndex(int charsetIndex)
throws java.sql.SQLException
charsetIndex -
java.sql.SQLException - if the character set index isn't known by the driverprotected java.util.TimeZone getDefaultTimeZone()
protected java.lang.String getErrorMessageEncoding()
public int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLExceptionConnection.getHoldability()public long getIdleFor()
protected com.mysql.jdbc.MysqlIO getIO()
throws java.sql.SQLException
java.sql.SQLException - if the connection is closed.
public Log getLog()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs
protected int getMaxBytesPerChar(java.lang.String javaCharsetName)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurs
protected java.sql.Statement getMetadataSafeStatement()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String getServerCharacterEncoding()
public java.util.TimeZone getServerTimezoneTZ()
protected java.util.Calendar getSessionLockedCalendar()
public int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurs
public java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLException - if a database error occursprotected java.util.Calendar getUtcCalendar()
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurspublic boolean hasSameProperties(Connection c)
public boolean hasTriedMaster()
Connection
protected void incrementNumberOfPreparedExecutes()
protected void incrementNumberOfPrepares()
protected void incrementNumberOfResultSetsCreated()
protected boolean isClientTzUTC()
public boolean isClosed()
isClosed in interface java.sql.Connection
protected boolean isCursorFetchEnabled()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isInGlobalTx()
Connection
public boolean isMasterConnection()
public boolean isNoBackslashEscapesSet()
public boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLException - if a database access error occursprotected boolean isRunningOnJDK13()
public boolean isSameResource(Connection otherConnection)
Connection
protected boolean isServerTzUTC()
public boolean lowerCaseTableNames()
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionsql - a SQL statement that may contain one or more '?' parameter
placeholders
java.sql.SQLException - if a database access error occurspublic boolean parserKnowsUnicode()
public void ping()
throws java.sql.SQLException
java.sql.SQLException - if the ping fails
protected void pingInternal(boolean checkForClosedConnection)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionsql - DOCUMENT ME!
java.sql.SQLException - DOCUMENT ME!
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionsql - the SQL representing the callable statementresultSetType - a result set type, see ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException - if a database-access error occurs.
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionConnection.prepareCall(String, int, int, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation if the driver supports precompilation. In this case, the statement is not sent to the database until the PreparedStatement is executed. This has no direct effect on users; however it does affect which method throws certain java.sql.SQLExceptions
MySQL does not support precompilation of statements, so they are handled by the driver.
prepareStatement in interface java.sql.Connectionsql - a SQL statement that may contain one or more '?' IN parameter
placeholders
java.sql.SQLException - if a database access error occurs.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionConnection.prepareStatement(String, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionsql - the SQL query containing place holdersresultSetType - a result set type, see ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException - if a database-access error occurs.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionConnection.prepareStatement(String, int, int, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionConnection.prepareStatement(String, int[])
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionConnection.prepareStatement(String, String[])
protected void realClose(boolean calledExplicitly,
boolean issueRollback,
boolean skipLocalTeardown,
java.lang.Throwable reason)
throws java.sql.SQLException
calledExplicitly - is this being called from close()issueRollback - should a rollback() be issued?
java.sql.SQLException - if an error occurs
protected void recachePreparedStatement(ServerPreparedStatement pstmt)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void registerQueryExecutionTime(long queryTimeMs)
queryTimeMs -
public void releaseSavepoint(java.sql.Savepoint arg0)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionConnection.releaseSavepoint(Savepoint)protected void reportNumberOfTablesAccessed(int numTablesAccessed)
public void resetServerState()
throws java.sql.SQLException
java.sql.SQLException - if the operation fails while resetting server state.
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - if a database access error occurscommit
public void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionConnection.rollback(Savepoint)
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String)
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int)
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int, int)
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int, int, int)
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, int[])
public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionConnection.prepareStatement(String, String[])
protected boolean serverSupportsConvertFn()
throws java.sql.SQLException
java.sql.SQLException
public void setAutoCommit(boolean autoCommitFlag)
throws java.sql.SQLException
Note: MySQL does not support transactions, so this method is a no-op.
setAutoCommit in interface java.sql.ConnectionautoCommitFlag - -
true enables auto-commit; false disables it
java.sql.SQLException - if a database access error occurs
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
Note: MySQL's notion of catalogs are individual databases.
setCatalog in interface java.sql.Connectioncatalog - the database for this connection to use
java.sql.SQLException - if a database access error occurspublic void setFailedOver(boolean flag)
failedOver - The failedOver to set.
public void setHoldability(int arg0)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionConnection.setHoldability(int)public void setInGlobalTx(boolean flag)
Connection
public void setPreferSlaveDuringFailover(boolean flag)
preferSlaveDuringFailover - The preferSlaveDuringFailover to set.
public void setReadOnly(boolean readOnlyFlag)
throws java.sql.SQLException
setReadOnly in interface java.sql.ConnectionreadOnlyFlag - -
true enables read-only mode; false disables it
java.sql.SQLException - if a database access error occurs
protected void setReadOnlyInternal(boolean readOnlyFlag)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionConnection.setSavepoint()
public java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionConnection.setSavepoint(String)
public void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionlevel - DOCUMENT ME!
java.sql.SQLException - DOCUMENT ME!
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionmap - the type mapping
java.sql.SQLException - if a database error occurs.
public void shutdownServer()
throws java.sql.SQLException
java.sql.SQLException - if the command can not be issued.public boolean supportsIsolationLevel()
public boolean supportsQuotedIdentifiers()
public boolean supportsTransactions()
public boolean versionMeetsMinimum(int major,
int minor,
int subminor)
throws java.sql.SQLException
Connection
java.sql.SQLExceptionprotected CachedResultSetMetaData getCachedMetaData(java.lang.String sql)
sql - the query that is the key to the cache
protected void initializeResultsMetadataFromCache(java.lang.String sql,
CachedResultSetMetaData cachedMetaData,
ResultSetInternalMethods resultSet)
throws java.sql.SQLException
sql - the query that the metadata pertains too.cachedMetaData - metadata (if it exists) to populate the cache.resultSet - the result set to retreive metadata from, or apply to.
java.sql.SQLExceptionpublic java.lang.String getStatementComment()
public void setStatementComment(java.lang.String comment)
comment - the comment that will be prepended to all statements
sent to the server.public void reportQueryTime(long millisOrNanos)
public boolean isAbonormallyLongQuery(long millisOrNanos)
public void initializeExtension(Extension ex)
throws java.sql.SQLException
java.sql.SQLException
protected void transactionBegun()
throws java.sql.SQLException
java.sql.SQLException
protected void transactionCompleted()
throws java.sql.SQLException
java.sql.SQLException
public Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLException
public boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLException
public void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
|
MySQL Connector/J size='-1'>5.1.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||