| java.lang.Object com.mysql.jdbc.ConnectionPropertiesImpl com.mysql.jdbc.ConnectionImpl
ConnectionImpl | public class ConnectionImpl extends ConnectionPropertiesImpl implements Connection(Code) | | 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.
author: Mark Matthews version: $Id: ConnectionImpl.java 6562 2007-09-05 16:02:17Z mmatthews $ See Also: java.sql.Connection |
Inner Class :class CompoundCacheKey | |
Method Summary | |
protected void | abortInternal() Clobbers the physical network connection and marks
this connection as closed. | protected static SQLException | appendMessageToException(SQLException sqlEx, String messageToAppend) | public void | changeUser(String userName, String newPassword) Changes the user on this connection by performing a re-authentication. | protected void | checkClosed() | public void | clearHasTriedMaster() | public void | clearWarnings() After this call, getWarnings returns null until a new warning is reported
for this connection. | public PreparedStatement | clientPrepareStatement(String sql) | public java.sql.PreparedStatement | clientPrepareStatement(String sql, int autoGenKeyIndex) | public PreparedStatement | clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency) | protected PreparedStatement | clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, boolean processEscapeCodesIfNeeded) | public java.sql.PreparedStatement | clientPrepareStatement(String sql, int[] autoGenKeyIndexes) | public java.sql.PreparedStatement | clientPrepareStatement(String sql, String[] autoGenKeyColNames) | public 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. | public 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. | protected void | createNewIO(boolean isForReconnect) | public java.sql.Statement | createStatement() SQL statements without parameters are normally executed using Statement
objects. | public 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. | public java.sql.Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) | protected void | dumpTestcaseQuery(String query) | protected Connection | duplicate() | ResultSetInternalMethods | execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata) Send a query to the server. | ResultSetInternalMethods | execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata, boolean isBatch) | protected String | extractSqlFromPacket(String possibleSqlQuery, Buffer queryPacket, int endOfQueryPacketPosition) | protected void | finalize() | protected StringBuffer | generateConnectionCommentBlock(StringBuffer buf) | public int | getActiveStatementCount() | public boolean | getAutoCommit() | protected CachedResultSetMetaData | getCachedMetaData(String sql) Returns cached metadata (or null if not cached) for the given query,
which must match _exactly_.
This method is synchronized by the caller on getMutex(), so if
calling this method from internal code in the driver, make sure it's
synchronized on the mutex that guards communication with the server. | protected Calendar | getCalendarInstanceForSessionOrNew() | protected static Timer | getCancelTimer() | public String | getCatalog() Return the connections current catalog name, or null if no catalog name
is set, or we dont support catalogs. | protected String | getCharacterSetMetadata() | SingleByteCharsetConverter | getCharsetConverter(String javaEncodingName) Returns the locally mapped instance of a charset converter (to avoid
overhead of static synchronization). | protected String | getCharsetNameForIndex(int charsetIndex) | protected TimeZone | getDefaultTimeZone() | protected String | getErrorMessageEncoding() | public int | getHoldability() | protected MysqlIO | getIO() | long | getId() | public long | getIdleFor() NOT JDBC-Compliant, but clients can use this method to determine how long
this connection has been idle. | protected static Connection | getInstance(String hostToConnectTo, int portToConnectTo, Properties info, String databaseToConnectTo, 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. | public Log | getLog() Returns the log mechanism that should be used to log information from/for
this Connection. | int | getMaxAllowedPacket() | protected int | getMaxBytesPerChar(String javaCharsetName) | public 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() | Object | getMutex() | int | getNetBufferLength() | public String | getServerCharacterEncoding() | int | getServerMajorVersion() | int | getServerMinorVersion() | int | getServerSubMinorVersion() | public TimeZone | getServerTimezoneTZ() | String | getServerVariable(String variableName) | String | getServerVersion() | protected Calendar | getSessionLockedCalendar() | public String | getStatementComment() Returns the comment that will be prepended to all statements
sent to the server. | public int | getTransactionIsolation() Get this Connection's current transaction isolation mode. | public synchronized java.util.Map | getTypeMap() JDBC 2.0 Get the type-map object associated with this connection. | String | getURL() | String | getUser() | protected Calendar | getUtcCalendar() | public SQLWarning | getWarnings() The first warning reported by calls on this Connection is returned. | public boolean | hasSameProperties(Connection c) | public boolean | hasTriedMaster() | protected void | incrementNumberOfPreparedExecutes() | protected void | incrementNumberOfPrepares() | protected void | incrementNumberOfResultSetsCreated() | protected void | initializeResultsMetadataFromCache(String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet) Caches CachedResultSetMetaData that has been placed in the cache using
the given SQL as a key. | protected boolean | isClientTzUTC() | public boolean | isClosed() | protected boolean | isCursorFetchEnabled() | public boolean | isInGlobalTx() | public synchronized boolean | isMasterConnection() | public boolean | isNoBackslashEscapesSet() | boolean | isReadInfoMsgEnabled() | public boolean | isReadOnly() Tests to see if the connection is in Read Only Mode. | protected boolean | isRunningOnJDK13() | public synchronized boolean | isSameResource(Connection otherConnection) | protected boolean | isServerTzUTC() | public boolean | lowerCaseTableNames() | void | maxRowsChanged(StatementImpl stmt) | public String | nativeSQL(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. | public boolean | parserKnowsUnicode() | public void | ping() | protected void | pingInternal(boolean checkForClosedConnection) | public java.sql.CallableStatement | prepareCall(String sql) | public java.sql.CallableStatement | prepareCall(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. | public java.sql.CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public java.sql.PreparedStatement | prepareStatement(String sql) A SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. | public java.sql.PreparedStatement | prepareStatement(String sql, int autoGenKeyIndex) | public java.sql.PreparedStatement | prepareStatement(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. | public java.sql.PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public java.sql.PreparedStatement | prepareStatement(String sql, int[] autoGenKeyIndexes) | public java.sql.PreparedStatement | prepareStatement(String sql, String[] autoGenKeyColNames) | protected void | realClose(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, Throwable reason) Closes connection and frees resources. | protected void | recachePreparedStatement(ServerPreparedStatement pstmt) | protected void | registerQueryExecutionTime(long queryTimeMs) | void | registerStatement(StatementImpl stmt) Register a Statement instance as open. | public void | releaseSavepoint(Savepoint arg0) | protected void | reportNumberOfTablesAccessed(int numTablesAccessed) | public void | resetServerState() Resets the server-side state of this connection. | public void | rollback() The method rollback() drops all changes made since the previous
commit/rollback and releases any database locks currently held by the
Connection. | public void | rollback(Savepoint savepoint) | public ServerPreparedStatement | serverPrepareStatement(String sql) | public java.sql.PreparedStatement | serverPrepareStatement(String sql, int autoGenKeyIndex) | public java.sql.PreparedStatement | serverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency) | public java.sql.PreparedStatement | serverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public java.sql.PreparedStatement | serverPrepareStatement(String sql, int[] autoGenKeyIndexes) | public java.sql.PreparedStatement | serverPrepareStatement(String sql, String[] autoGenKeyColNames) | protected boolean | serverSupportsConvertFn() | public 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. | public void | setCatalog(String catalog) A sub-space of this Connection's database may be selected by setting a
catalog name. | public synchronized void | setFailedOver(boolean flag) | public void | setHoldability(int arg0) | public void | setInGlobalTx(boolean flag) | public void | setPreferSlaveDuringFailover(boolean flag) | void | setReadInfoMsgEnabled(boolean flag) | public void | setReadOnly(boolean readOnlyFlag) | protected void | setReadOnlyInternal(boolean readOnlyFlag) | public java.sql.Savepoint | setSavepoint() | public synchronized java.sql.Savepoint | setSavepoint(String name) | public void | setStatementComment(String comment) Sets the comment that will be prepended to all statements
sent to the server. | public synchronized void | setTransactionIsolation(int level) | public synchronized void | setTypeMap(java.util.Map map) | public void | shutdownServer() | public boolean | supportsIsolationLevel() | public boolean | supportsQuotedIdentifiers() | public boolean | supportsTransactions() | void | unregisterStatement(StatementImpl stmt) | void | unsetMaxRows(StatementImpl stmt) Called by statements on their .close() to let the connection know when it
is safe to set the connection back to 'default' row limits. | boolean | useAnsiQuotedIdentifiers() | boolean | useMaxRows() | public boolean | versionMeetsMinimum(int major, int minor, int subminor) |
DEFAULT_LOGGER_CLASS | final protected static String DEFAULT_LOGGER_CLASS(Code) | | Default logger class name
|
charsetMap | public static Map charsetMap(Code) | | The mapping between MySQL charset names and Java charset names.
Initialized by loadCharacterSetMapping()
|
props | protected Properties props(Code) | | Properties for this connection specified by user
|
resultSetMetadataCache | protected LRUCache resultSetMetadataCache(Code) | | Cache of ResultSet metadata
|
ConnectionImpl | protected ConnectionImpl()(Code) | | '
For the delegate only
|
ConnectionImpl | protected ConnectionImpl(String hostToConnectTo, int portToConnectTo, Properties info, String databaseToConnectTo, String url) throws SQLException(Code) | | Creates a connection to a MySQL Server.
Parameters: hostToConnectTo - the hostname of the database server Parameters: portToConnectTo - the port number the server is listening on Parameters: info - a Properties[] list holding the user and password Parameters: databaseToConnectTo - the database to connect to Parameters: url - the URL of the connection Parameters: d - the Driver instantation of the connection exception: SQLException - if a database access error occurs |
abortInternal | protected void abortInternal() throws SQLException(Code) | | Clobbers the physical network connection and marks
this connection as closed.
throws: SQLException - |
changeUser | public void changeUser(String userName, String newPassword) throws SQLException(Code) | | 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.
Parameters: userName - the username to authenticate with Parameters: newPassword - the password to authenticate with throws: SQLException - if authentication fails, or some other error occurs whileperforming the command. |
clearHasTriedMaster | public void clearHasTriedMaster()(Code) | | |
clearWarnings | public void clearWarnings() throws SQLException(Code) | | After this call, getWarnings returns null until a new warning is reported
for this connection.
exception: SQLException - if a database access error occurs |
clientPrepareStatement | public PreparedStatement clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | DOCUMENT ME!
Parameters: sql - DOCUMENT ME! Parameters: resultSetType - DOCUMENT ME! Parameters: resultSetConcurrency - DOCUMENT ME! DOCUMENT ME! throws: SQLException - DOCUMENT ME! |
close | public void close() throws SQLException(Code) | | 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.
Certain fatal errors also result in a closed connection.
exception: SQLException - if a database access error occurs |
commit | public void commit() throws SQLException(Code) | | The method commit() makes all changes made since the previous
commit/rollback permanent and releases any database locks currently held
by the Connection. This method should only be used when auto-commit has
been disabled.
Note: MySQL does not support transactions, so this method is a
no-op.
exception: SQLException - if a database access error occurs See Also: setAutoCommit |
createNewIO | protected void createNewIO(boolean isForReconnect) throws SQLException(Code) | | Creates an IO channel to the server
Parameters: isForReconnect - is this request for a re-connect a new MysqlIO instance connected to a server throws: SQLException - if a database access error occurs throws: CommunicationsException - DOCUMENT ME! |
createStatement | public java.sql.Statement createStatement() throws SQLException(Code) | | SQL statements without parameters are normally executed using Statement
objects. If the same SQL statement is executed many times, it is more
efficient to use a PreparedStatement
a new Statement object throws: SQLException - passed through from the constructor |
createStatement | public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0 Same as createStatement() above, but allows the default result
set type and result set concurrency type to be overridden.
Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new Statement object exception: SQLException - if a database-access error occurs. |
dumpTestcaseQuery | protected void dumpTestcaseQuery(String query)(Code) | | |
execSQL | ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata) throws SQLException(Code) | | Send a query to the server. Returns one of the ResultSet objects. This is
synchronized, so Statement's queries will be serialized.
Parameters: callingStatement - DOCUMENT ME! Parameters: sql - the SQL statement to be executed Parameters: maxRows - DOCUMENT ME! Parameters: packet - DOCUMENT ME! Parameters: resultSetType - DOCUMENT ME! Parameters: resultSetConcurrency - DOCUMENT ME! Parameters: streamResults - DOCUMENT ME! Parameters: queryIsSelectOnly - DOCUMENT ME! Parameters: catalog - DOCUMENT ME! Parameters: unpackFields - DOCUMENT ME! a ResultSet holding the results exception: SQLException - if a database error occurs |
getActiveStatementCount | public int getActiveStatementCount()(Code) | | |
getAutoCommit | public boolean getAutoCommit() throws SQLException(Code) | | Gets the current auto-commit state
Current state of auto-commit exception: SQLException - if an error occurs See Also: setAutoCommit |
getCachedMetaData | protected CachedResultSetMetaData getCachedMetaData(String sql)(Code) | | Returns cached metadata (or null if not cached) for the given query,
which must match _exactly_.
This method is synchronized by the caller on getMutex(), so if
calling this method from internal code in the driver, make sure it's
synchronized on the mutex that guards communication with the server.
Parameters: sql - the query that is the key to the cache metadata cached for the given SQL, or none if it doesn'texist. |
getCalendarInstanceForSessionOrNew | protected Calendar getCalendarInstanceForSessionOrNew()(Code) | | Optimization to only use one calendar per-session, or calculate it for
each call, depending on user configuration
|
getCancelTimer | protected static Timer getCancelTimer()(Code) | | |
getCatalog | public String getCatalog() throws SQLException(Code) | | Return the connections current catalog name, or null if no catalog name
is set, or we dont support catalogs.
Note: MySQL's notion of catalogs are individual databases.
the current catalog name or null exception: SQLException - if a database access error occurs |
getCharacterSetMetadata | protected String getCharacterSetMetadata()(Code) | | Returns the characterSetMetadata. |
getCharsetConverter | SingleByteCharsetConverter getCharsetConverter(String javaEncodingName) throws SQLException(Code) | | Returns the locally mapped instance of a charset converter (to avoid
overhead of static synchronization).
Parameters: javaEncodingName - the encoding name to retrieve a character converter, or null if one couldn't be mapped. |
getCharsetNameForIndex | protected String getCharsetNameForIndex(int charsetIndex) throws SQLException(Code) | | Returns the Java character encoding name for the given MySQL server
charset index
Parameters: charsetIndex - the Java character encoding name for the given MySQL servercharset index throws: SQLException - if the character set index isn't known by the driver |
getDefaultTimeZone | protected TimeZone getDefaultTimeZone()(Code) | | DOCUMENT ME!
Returns the defaultTimeZone. |
getErrorMessageEncoding | protected String getErrorMessageEncoding()(Code) | | |
getIdleFor | public long getIdleFor()(Code) | | NOT JDBC-Compliant, but clients can use this method to determine how long
this connection has been idle. This time (reported in milliseconds) is
updated once a query has completed.
number of ms that this connection has been idle, 0 if the driveris busy retrieving results. |
getInstance | protected static Connection getInstance(String hostToConnectTo, int portToConnectTo, Properties info, String databaseToConnectTo, String url) throws SQLException(Code) | | 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.
|
getLog | public Log getLog() throws SQLException(Code) | | Returns the log mechanism that should be used to log information from/for
this Connection.
the Log instance to use for logging messages. throws: SQLException - if an error occurs |
getMaxAllowedPacket | int getMaxAllowedPacket()(Code) | | Returns the maximum packet size the MySQL server will accept
DOCUMENT ME! |
getMetaData | public java.sql.DatabaseMetaData getMetaData() throws SQLException(Code) | | 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 made available
through a DatabaseMetaData object.
a DatabaseMetaData object for this connection exception: SQLException - if a database access error occurs |
getNetBufferLength | int getNetBufferLength()(Code) | | Returns the packet buffer size the MySQL server reported upon connection
DOCUMENT ME! |
getServerCharacterEncoding | public String getServerCharacterEncoding()(Code) | | Returns the server's character set
the server's character set. |
getServerMajorVersion | int getServerMajorVersion()(Code) | | |
getServerMinorVersion | int getServerMinorVersion()(Code) | | |
getServerSubMinorVersion | int getServerSubMinorVersion()(Code) | | |
getServerTimezoneTZ | public TimeZone getServerTimezoneTZ()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
getSessionLockedCalendar | protected Calendar getSessionLockedCalendar()(Code) | | |
getStatementComment | public String getStatementComment()(Code) | | Returns the comment that will be prepended to all statements
sent to the server.
the comment that will be prepended to all statementssent to the server. |
getTransactionIsolation | public int getTransactionIsolation() throws SQLException(Code) | | Get this Connection's current transaction isolation mode.
the current TRANSACTION_ mode value exception: SQLException - if a database access error occurs |
getTypeMap | public synchronized java.util.Map getTypeMap() throws SQLException(Code) | | JDBC 2.0 Get the type-map object associated with this connection. By
default, the map returned is empty.
the type map throws: SQLException - if a database error occurs |
getWarnings | public SQLWarning getWarnings() throws SQLException(Code) | | The first warning reported by calls on this Connection is returned.
Note: Sebsequent warnings will be changed to this
java.sql.SQLWarning
the first java.sql.SQLWarning or null exception: SQLException - if a database access error occurs |
hasTriedMaster | public boolean hasTriedMaster()(Code) | | |
incrementNumberOfPreparedExecutes | protected void incrementNumberOfPreparedExecutes()(Code) | | |
incrementNumberOfPrepares | protected void incrementNumberOfPrepares()(Code) | | |
incrementNumberOfResultSetsCreated | protected void incrementNumberOfResultSetsCreated()(Code) | | |
initializeResultsMetadataFromCache | protected void initializeResultsMetadataFromCache(String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet) throws SQLException(Code) | | Caches CachedResultSetMetaData that has been placed in the cache using
the given SQL as a key.
This method is synchronized by the caller on getMutex(), so if
calling this method from internal code in the driver, make sure it's
synchronized on the mutex that guards communication with the server.
Parameters: sql - the query that the metadata pertains too. Parameters: cachedMetaData - metadata (if it exists) to populate the cache. Parameters: resultSet - the result set to retreive metadata from, or apply to. throws: SQLException - |
isClientTzUTC | protected boolean isClientTzUTC()(Code) | | |
isClosed | public boolean isClosed()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
isInGlobalTx | public boolean isInGlobalTx()(Code) | | |
isMasterConnection | public synchronized boolean isMasterConnection()(Code) | | Is this connection connected to the first host in the list if
there is a list of servers in the URL?
true if this connection is connected to the first in the list. |
isNoBackslashEscapesSet | public boolean isNoBackslashEscapesSet()(Code) | | Is the server in a sql_mode that doesn't allow us to use \\ to escape
things?
Returns the noBackslashEscapes. |
isReadInfoMsgEnabled | boolean isReadInfoMsgEnabled()(Code) | | |
isReadOnly | public boolean isReadOnly() throws SQLException(Code) | | Tests to see if the connection is in Read Only Mode. Note that we cannot
really put the database in read only mode, but we pretend we can by
returning the value of the readOnly flag
true if the connection is read only exception: SQLException - if a database access error occurs |
isRunningOnJDK13 | protected boolean isRunningOnJDK13()(Code) | | |
isSameResource | public synchronized boolean isSameResource(Connection otherConnection)(Code) | | |
isServerTzUTC | protected boolean isServerTzUTC()(Code) | | |
lowerCaseTableNames | public boolean lowerCaseTableNames()(Code) | | Is the server configured to use lower-case table names only?
true if lower_case_table_names is 'on' |
maxRowsChanged | void maxRowsChanged(StatementImpl stmt)(Code) | | Has the maxRows value changed?
Parameters: stmt - DOCUMENT ME! |
nativeSQL | public String nativeSQL(String sql) throws SQLException(Code) | | 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.
Parameters: sql - a SQL statement that may contain one or more '?' parameterplaceholders the native form of this statement exception: SQLException - if a database access error occurs |
parserKnowsUnicode | public boolean parserKnowsUnicode()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
pingInternal | protected void pingInternal(boolean checkForClosedConnection) throws SQLException(Code) | | |
prepareCall | public java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0 Same as prepareCall() above, but allows the default result set
type and result set concurrency type to be overridden.
Parameters: sql - the SQL representing the callable statement Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new CallableStatement object containing the pre-compiled SQLstatement exception: SQLException - if a database-access error occurs. |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException(Code) | | A SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. This object can then be used to
efficiently execute this statement multiple times.
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.
Parameters: sql - a SQL statement that may contain one or more '?' IN parameterplaceholders a new PreparedStatement object containing the pre-compiledstatement. exception: SQLException - if a database access error occurs. |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | JDBC 2.0 Same as prepareStatement() above, but allows the default result
set type and result set concurrency type to be overridden.
Parameters: sql - the SQL query containing place holders Parameters: resultSetType - a result set type, see ResultSet.TYPE_XXX Parameters: resultSetConcurrency - a concurrency type, see ResultSet.CONCUR_XXX a new PreparedStatement object containing the pre-compiled SQLstatement exception: SQLException - if a database-access error occurs. |
realClose | protected void realClose(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, Throwable reason) throws SQLException(Code) | | Closes connection and frees resources.
Parameters: calledExplicitly - is this being called from close() Parameters: issueRollback - should a rollback() be issued? throws: SQLException - if an error occurs |
registerQueryExecutionTime | protected void registerQueryExecutionTime(long queryTimeMs)(Code) | | DOCUMENT ME!
Parameters: queryTimeMs - |
registerStatement | void registerStatement(StatementImpl stmt)(Code) | | Register a Statement instance as open.
Parameters: stmt - the Statement instance to remove |
reportNumberOfTablesAccessed | protected void reportNumberOfTablesAccessed(int numTablesAccessed)(Code) | | |
resetServerState | public void resetServerState() throws SQLException(Code) | | 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.
throws: SQLException - if the operation fails while resetting server state. |
rollback | public void rollback() throws SQLException(Code) | | The method rollback() drops all changes made since the previous
commit/rollback and releases any database locks currently held by the
Connection.
exception: SQLException - if a database access error occurs See Also: commit |
serverSupportsConvertFn | protected boolean serverSupportsConvertFn() throws SQLException(Code) | | |
setAutoCommit | public void setAutoCommit(boolean autoCommitFlag) throws SQLException(Code) | | If a connection is in auto-commit mode, than all its SQL statements will
be executed and committed as individual transactions. Otherwise, its SQL
statements are grouped into transactions that are terminated by either
commit() or rollback(). By default, new connections are in auto- commit
mode. The commit occurs when the statement completes or the next execute
occurs, whichever comes first. In the case of statements returning a
ResultSet, the statement completes when the last row of the ResultSet has
been retrieved or the ResultSet has been closed. In advanced cases, a
single statement may return multiple results as well as output parameter
values. Here the commit occurs when all results and output param values
have been retrieved.
Note: MySQL does not support transactions, so this method is a
no-op.
Parameters: autoCommitFlag - -true enables auto-commit; false disables it exception: SQLException - if a database access error occurs |
setCatalog | public void setCatalog(String catalog) throws SQLException(Code) | | A sub-space of this Connection's database may be selected by setting a
catalog name. If the driver does not support catalogs, it will silently
ignore this request
Note: MySQL's notion of catalogs are individual databases.
Parameters: catalog - the database for this connection to use throws: SQLException - if a database access error occurs |
setFailedOver | public synchronized void setFailedOver(boolean flag)(Code) | | Parameters: failedOver - The failedOver to set. |
setInGlobalTx | public void setInGlobalTx(boolean flag)(Code) | | |
setPreferSlaveDuringFailover | public void setPreferSlaveDuringFailover(boolean flag)(Code) | | Parameters: preferSlaveDuringFailover - The preferSlaveDuringFailover to set. |
setReadInfoMsgEnabled | void setReadInfoMsgEnabled(boolean flag)(Code) | | |
setReadOnly | public void setReadOnly(boolean readOnlyFlag) throws SQLException(Code) | | 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
Parameters: readOnlyFlag - -true enables read-only mode; false disables it exception: SQLException - if a database access error occurs |
setReadOnlyInternal | protected void setReadOnlyInternal(boolean readOnlyFlag) throws SQLException(Code) | | |
setStatementComment | public void setStatementComment(String comment)(Code) | | 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.
Parameters: comment - the comment that will be prepended to all statementssent to the server. |
setTransactionIsolation | public synchronized void setTransactionIsolation(int level) throws SQLException(Code) | | DOCUMENT ME!
Parameters: level - DOCUMENT ME! throws: SQLException - DOCUMENT ME! |
setTypeMap | public synchronized void setTypeMap(java.util.Map map) throws SQLException(Code) | | JDBC 2.0 Install a type-map object as the default type-map for this
connection
Parameters: map - the type mapping throws: SQLException - if a database error occurs. |
shutdownServer | public void shutdownServer() throws SQLException(Code) | | Used by MiniAdmin to shutdown a MySQL server
throws: SQLException - if the command can not be issued. |
supportsIsolationLevel | public boolean supportsIsolationLevel()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
supportsQuotedIdentifiers | public boolean supportsQuotedIdentifiers()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
supportsTransactions | public boolean supportsTransactions()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
unregisterStatement | void unregisterStatement(StatementImpl stmt)(Code) | | Remove the given statement from the list of open statements
Parameters: stmt - the Statement instance to remove |
unsetMaxRows | void unsetMaxRows(StatementImpl stmt) throws SQLException(Code) | | Called by statements on their .close() to let the connection know when it
is safe to set the connection back to 'default' row limits.
Parameters: stmt - the statement releasing it's max-rows requirement throws: SQLException - if a database error occurs issuing the statement that setsthe limit default. |
useAnsiQuotedIdentifiers | boolean useAnsiQuotedIdentifiers()(Code) | | |
useMaxRows | boolean useMaxRows()(Code) | | Has maxRows() been set?
DOCUMENT ME! |
versionMeetsMinimum | public boolean versionMeetsMinimum(int major, int minor, int subminor) throws SQLException(Code) | | |
|
|