Logo Search packages:      
Sourcecode: mysql-connector-java version File versions

com::mysql::jdbc::Connection Class Reference

Inheritance diagram for com::mysql::jdbc::Connection:


List of all members.

Detailed Description

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.

Mark Matthews
Connection.java,v 2005/02/16 15:51:24 mmatthews Exp

See also:

Definition at line 86 of file Connection.java.

Public Member Functions

void changeUser (String userName, String newPassword) throws SQLException
void clearWarnings () throws SQLException
synchronized PreparedStatement clientPrepareStatement (String sql, int resultSetType, int resultSetConcurrency) throws SQLException
PreparedStatement clientPrepareStatement (String sql) throws SQLException
void close () throws SQLException
void commit () throws SQLException
java.sql.Statement createStatement (int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
java.sql.Statement createStatement () throws SQLException
java.sql.Statement createStatement (int resultSetType, int resultSetConcurrency) throws SQLException
String exposeAsXml () throws SQLException
boolean getAllowLoadLocalInfile ()
boolean getAllowMultiQueries ()
boolean getAllowUrlInLocalInfile ()
boolean getAlwaysSendSetIsolation ()
boolean getAutoCommit () throws SQLException
boolean getAutoDeserialize ()
boolean getAutoReconnectForPools ()
boolean getCacheCallableStatements ()
boolean getCachePreparedStatements ()
boolean getCacheResultSetMetadata ()
boolean getCacheServerConfiguration ()
int getCallableStatementCacheSize ()
boolean getCapitalizeTypeNames ()
String getCatalog () throws SQLException
String getCharacterSetResults ()
boolean getClobberStreamingResults ()
String getConnectionCollation ()
int getConnectTimeout ()
boolean getContinueBatchOnError ()
boolean getDontTrackOpenResources ()
boolean getDumpQueriesOnException ()
boolean getDynamicCalendars ()
boolean getElideSetAutoCommits ()
boolean getEmulateLocators ()
boolean getEmulateUnsupportedPstmts ()
boolean getEnablePacketDebug ()
boolean getExplainSlowQueries ()
boolean getFailOverReadOnly ()
boolean getGatherPerformanceMetrics ()
int getHoldability () throws SQLException
boolean getHoldResultsOpenOverStatementClose ()
long getIdleFor ()
boolean getIgnoreNonTxTables ()
int getInitialTimeout ()
boolean getInteractiveClient ()
boolean getIsInteractiveClient ()
boolean getJdbcCompliantTruncation ()
Log getLog () throws SQLException
String getLogger ()
String getLoggerClassName ()
boolean getLogSlowQueries ()
int getMaxQuerySizeToLog ()
int getMaxReconnects ()
int getMaxRows ()
java.sql.DatabaseMetaData getMetaData () throws SQLException
int getMetadataCacheSize ()
boolean getNoDatetimeStringSync ()
int getPacketDebugBufferSize ()
boolean getParanoid ()
boolean getPedantic ()
int getPreparedStatementCacheSize ()
int getPreparedStatementCacheSqlLimit ()
boolean getProfileSql ()
boolean getProfileSQL ()
String getPropertiesTransform ()
int getQueriesBeforeRetryMaster ()
boolean getReconnectAtTxEnd ()
boolean getRelaxAutoCommit ()
int getReportMetricsIntervalMillis ()
boolean getRequireSSL ()
boolean getRollbackOnPooledClose ()
boolean getRoundRobinLoadBalance ()
boolean getRunningCTS13 ()
int getSecondsBeforeRetryMaster ()
String getServerTimezone ()
TimeZone getServerTimezoneTZ ()
int getSlowQueryThresholdMillis ()
String getSocketFactoryClassName ()
int getSocketTimeout ()
boolean getStrictFloatingPoint ()
boolean getStrictUpdates ()
boolean getTinyInt1isBit ()
boolean getTraceProtocol ()
int getTransactionIsolation () throws SQLException
synchronized java.util.Map getTypeMap () throws SQLException
boolean getUseCompression ()
boolean getUseFastIntParsing ()
boolean getUseHostsInPrivileges ()
boolean getUseLocalSessionState ()
boolean getUseNewIo ()
boolean getUseOldUTF8Behavior ()
boolean getUseOnlyServerErrorMessages ()
boolean getUseReadAheadInput ()
boolean getUseServerPreparedStmts ()
boolean getUseSqlStateCodes ()
boolean getUseSSL ()
boolean getUseStreamLengthsInPrepStmts ()
boolean getUseTimezone ()
boolean getUseUltraDevWorkAround ()
boolean getUseUnbufferedInput ()
boolean getUseUnicode ()
boolean getUseUsageAdvisor ()
SQLWarning getWarnings () throws SQLException
String getZeroDateTimeBehavior ()
boolean isClosed ()
boolean isNoBackslashEscapesSet ()
boolean isReadOnly () throws SQLException
boolean lowerCaseTableNames ()
String nativeSQL (String sql) throws SQLException
boolean parserKnowsUnicode ()
java.sql.CallableStatement prepareCall (String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall (String sql, int resultSetType, int resultSetConcurrency) throws SQLException
java.sql.CallableStatement prepareCall (String sql) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql, String[] autoGenKeyColNames) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql, int[] autoGenKeyIndexes) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql, int autoGenKeyIndex) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql, int resultSetType, int resultSetConcurrency) throws SQLException
java.sql.PreparedStatement prepareStatement (String sql) throws SQLException
void releaseSavepoint (Savepoint arg0) throws SQLException
void resetServerState () throws SQLException
void rollback (Savepoint savepoint) throws SQLException
void rollback () throws SQLException
ServerPreparedStatement serverPrepare (String sql) throws SQLException
void setAllowLoadLocalInfile (boolean property)
void setAllowMultiQueries (boolean property)
void setAllowUrlInLocalInfile (boolean flag)
void setAlwaysSendSetIsolation (boolean flag)
void setAutoCommit (boolean autoCommitFlag) throws SQLException
void setAutoDeserialize (boolean flag)
void setAutoReconnect (boolean flag)
void setAutoReconnectForConnectionPools (boolean property)
void setAutoReconnectForPools (boolean flag)
void setCacheCallableStatements (boolean flag)
void setCachePreparedStatements (boolean flag)
void setCacheResultSetMetadata (boolean property)
void setCacheServerConfiguration (boolean flag)
void setCallableStatementCacheSize (int size)
void setCapitalizeDBMDTypes (boolean property)
void setCapitalizeTypeNames (boolean flag)
void setCatalog (String catalog) throws SQLException
void setCharacterEncoding (String encoding)
void setCharacterSetResults (String characterSet)
void setClobberStreamingResults (boolean flag)
void setConnectionCollation (String collation)
void setConnectTimeout (int timeoutMs)
void setContinueBatchOnError (boolean property)
void setDetectServerPreparedStmts (boolean property)
void setDontTrackOpenResources (boolean flag)
void setDumpQueriesOnException (boolean flag)
void setDynamicCalendars (boolean flag)
void setElideSetAutoCommits (boolean flag)
void setEmulateLocators (boolean property)
void setEmulateUnsupportedPstmts (boolean flag)
void setEnablePacketDebug (boolean flag)
void setEncoding (String property)
void setExplainSlowQueries (boolean flag)
void setFailedOver (boolean flag)
void setFailOverReadOnly (boolean flag)
void setGatherPerformanceMetrics (boolean flag)
void setHoldability (int arg0) throws SQLException
void setHoldResultsOpenOverStatementClose (boolean flag)
void setIgnoreNonTxTables (boolean property)
void setInitialTimeout (int property)
void setIsInteractiveClient (boolean property)
void setJdbcCompliantTruncation (boolean flag)
void setLogger (String property)
void setLoggerClassName (String className)
void setLogSlowQueries (boolean flag)
void setMaxQuerySizeToLog (int sizeInBytes)
void setMaxReconnects (int property)
void setMaxRows (int property)
void setMetadataCacheSize (int value)
void setNoDatetimeStringSync (boolean flag)
void setPacketDebugBufferSize (int size)
void setParanoid (boolean property)
void setPedantic (boolean property)
void setPreferSlaveDuringFailover (boolean flag)
void setPreparedStatementCacheSize (int cacheSize)
void setPreparedStatementCacheSqlLimit (int cacheSqlLimit)
void setProfileSql (boolean property)
void setProfileSQL (boolean flag)
void setPropertiesTransform (String value)
void setQueriesBeforeRetryMaster (int property)
void setReadOnly (boolean readOnlyFlag) throws SQLException
void setReconnectAtTxEnd (boolean property)
void setRelaxAutoCommit (boolean property)
void setReportMetricsIntervalMillis (int millis)
void setRequireSSL (boolean property)
void setRollbackOnPooledClose (boolean flag)
void setRoundRobinLoadBalance (boolean flag)
void setRunningCTS13 (boolean flag)
java.sql.Savepoint setSavepoint (String name) throws SQLException
java.sql.Savepoint setSavepoint () throws SQLException
void setSecondsBeforeRetryMaster (int property)
void setServerTimezone (String property)
void setSlowQueryThresholdMillis (int millis)
void setSocketFactoryClassName (String property)
void setSocketTimeout (int property)
void setStrictFloatingPoint (boolean property)
void setStrictUpdates (boolean property)
void setTinyInt1isBit (boolean flag)
void setTraceProtocol (boolean flag)
void setTransactionIsolation (int level) throws SQLException
synchronized void setTypeMap (java.util.Map map) throws SQLException
void setUseCompression (boolean property)
void setUseFastIntParsing (boolean flag)
void setUseHostsInPrivileges (boolean property)
void setUseLocalSessionState (boolean flag)
void setUseNewIo (boolean property)
void setUseOldUTF8Behavior (boolean flag)
void setUseOnlyServerErrorMessages (boolean flag)
void setUseReadAheadInput (boolean flag)
void setUseServerPreparedStmts (boolean flag)
void setUseSqlStateCodes (boolean flag)
void setUseSSL (boolean property)
void setUseStreamLengthsInPrepStmts (boolean property)
void setUseTimezone (boolean property)
void setUseUltraDevWorkAround (boolean property)
void setUseUnbufferedInput (boolean flag)
void setUseUnicode (boolean flag)
void setUseUsageAdvisor (boolean useUsageAdvisorFlag)
void setZeroDateTimeBehavior (String behavior)
void shutdownServer () throws SQLException
boolean supportsIsolationLevel ()
boolean supportsQuotedIdentifiers ()
boolean supportsTransactions ()
boolean versionMeetsMinimum (int major, int minor, int subminor) throws SQLException

Static Public Attributes

static Map charsetMap

Protected Member Functions

com.mysql.jdbc.MysqlIO createNewIO (boolean isForReconnect) throws SQLException
DriverPropertyInfo[] exposeAsDriverPropertyInfoInternal (Properties info, int slotsToReserve) throws SQLException
Properties exposeAsProperties (Properties info) throws SQLException
String extractSqlFromPacket (String possibleSqlQuery, Buffer queryPacket, int endOfQueryPacketPosition) throws SQLException
void finalize () throws Throwable
boolean getAllowNanAndInf ()
String getCharacterSetMetadata ()
String getCharsetNameForIndex (int charsetIndex) throws SQLException
TimeZone getDefaultTimeZone ()
String getEncoding ()
boolean getHighAvailability ()
MysqlIO getIO () throws SQLException
synchronized int getMaxBytesPerChar (String charset) throws SQLException
java.sql.Statement getMetadataSafeStatement () throws SQLException
String getServerCharacterEncoding ()
void incrementNumberOfPreparedExecutes ()
void incrementNumberOfPrepares ()
void incrementNumberOfResultSetsFetched ()
void initializeFromRef (Reference ref) throws SQLException
void initializeProperties (Properties info) throws SQLException
boolean isClientTzUTC ()
boolean isServerTzUTC ()
void postInitialization () throws SQLException
void realClose (boolean calledExplicitly, boolean issueRollback) throws SQLException
void registerQueryExecutionTime (long queryTimeMs)
boolean serverSupportsConvertFn () throws SQLException
void setAllowNanAndInf (boolean flag)
void setHighAvailability (boolean property)
void storeToRef (Reference ref) throws SQLException
boolean useUnbufferedInput ()

Static Protected Member Functions

static SQLException appendMessageToException (SQLException sqlEx, String messageToAppend)
static DriverPropertyInfo[] exposeAsDriverPropertyInfo (Properties info, int slotsToReserve) throws SQLException

Static Protected Attributes

static final String DEFAULT_LOGGER_CLASS = "com.mysql.jdbc.log.StandardLogger"
static final String ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL = "convertToNull"
static final String ZERO_DATETIME_BEHAVIOR_EXCEPTION = "exception"
static final String ZERO_DATETIME_BEHAVIOR_ROUND = "round"

Package Functions

 Connection (String hostToConnectTo, int portToConnectTo, Properties info, String databaseToConnectTo, String url, NonRegisteringDriver d) throws SQLException
ResultSet execSQL (Statement callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, boolean queryIsSelectOnly, String catalog, boolean unpackFields, byte queryUsesVariables) throws SQLException
ResultSet execSQL (Statement callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, boolean queryIsSelectOnly, String catalog, boolean unpackFields) throws SQLException
getCharsetConverter (String javaEncodingName)
int getId ()
int getMaxAllowedPacket ()
Object getMutex () throws SQLException
int getNetBufferLength ()
int getServerMajorVersion ()
int getServerMinorVersion ()
int getServerSubMinorVersion ()
String getServerVariable (String variableName)
String getServerVersion ()
String getURL ()
String getUser ()
boolean isReadInfoMsgEnabled ()
void maxRowsChanged (Statement stmt)
synchronized void registerStatement (Statement stmt)
void setReadInfoMsgEnabled (boolean flag)
synchronized void unregisterStatement (Statement stmt)
void unsetMaxRows (Statement stmt) throws SQLException
boolean useAnsiQuotedIdentifiers ()
boolean useMaxRows ()

Static Package Functions

 [static initializer]

Private Member Functions

void addToHistogram (long value, int numberOfTimes)
void buildCollationMapping () throws SQLException
void checkClosed () throws SQLException
void checkServerEncoding () throws SQLException
void checkTransactionIsolationLevel () throws SQLException
void cleanup (Throwable fromWhere, Throwable whyCleanedUp)
void closeAllOpenStatements () throws SQLException
void configureCharsetProperties () throws SQLException
boolean configureClientCharacterSet () throws SQLException
void configureTimezone () throws SQLException
void createInitialHistogram ()
void initializeDriverProperties (Properties info) throws SQLException
void initializePropsFromServer (Properties info) throws SQLException
void loadServerVariables () throws SQLException
void ping () throws Exception
void repartitionHistogram ()
void reportMetrics ()
void reportMetricsIfNeeded ()
void rollbackNoChecks () throws SQLException
void setFailedOverState () throws SQLException
void setSavepoint (MysqlSavepoint savepoint) throws SQLException
boolean shouldFallBack ()

Static Private Member Functions

static boolean canHandleAsServerPreparedStatement (String sql)
static synchronized int getNextRoundRobinHostIndex (String url, List hostList)
static void loadCharacterSetMapping ()

Private Attributes

boolean autoCommit = true
Map cachedPreparedStatementParams
String characterSetMetadata = null
String characterSetResultsOnServer = null
Map charsetConverterMap
Map charsetToNumBytesMap
long connectionCreationTimeMillis = 0
int connectionId
String database = null
DatabaseMetaData dbmd = null
TimeZone defaultTimeZone
ProfileEventSink eventSink
boolean executingFailoverReconnect = false
boolean failedOver = false
Throwable forceClosedReason
Throwable forcedClosedLocation
boolean hasIsolationLevels = false
boolean hasQuotedIdentifiers = false
String host = null
List hostList = null
int hostListSize = 0
String[] indexToCharsetMapping = CharsetMapping.INDEX_TO_CHARSET
MysqlIO io = null
boolean isClientTzUTC = false
boolean isClosed = true
int isolationLevel = java.sql.Connection.TRANSACTION_READ_COMMITTED
boolean isServerTzUTC = false
long lastQueryFinishedTime = 0
long longestQueryTimeMs = 0
boolean lowerCaseTableNames = false
long masterFailTimeMillis = 0L
int maxAllowedPacket = 65536
boolean maxRowsChanged = false
long metricsLastReportedMs
final Object mutex = new Object()
String myURL = null
boolean needsPing = false
int netBufferLength = 16384
boolean noBackslashEscapes = false
long numberOfPreparedExecutes = 0
long numberOfPrepares = 0
long numberOfQueriesIssued = 0
long numberOfResultSetsFetched = 0
Map openStatements
LRUCache parsedCallableStatementCache
boolean parserKnowsUnicode = false
String password = null
long[] perfMetricsHistBreakpoints
int[] perfMetricsHistCounts
Throwable pointOfOrigin
int port = 3306
boolean preferSlaveDuringFailover = false
Properties props = null
long queriesIssuedFailedOver = 0
boolean readInfoMsg = false
boolean readOnly = false
TimeZone serverTimezoneTZ = null
Map serverVariables = null
long shortestQueryTimeMs = Long.MAX_VALUE
Map statementsUsingMaxRows
double totalQueryTimeMs = 0
boolean transactionsSupported = false
Map typeMap
boolean useAnsiQuotes = false
boolean useFastPing = false
String user = null
boolean useServerPreparedStmts = false

Static Private Attributes

static final Object CHARSET_CONVERTER_NOT_AVAILABLE_MARKER = new Object()
static final int HISTOGRAM_BUCKETS = 20
static final String LOGGER_INSTANCE_NAME = "MySQL"
static Map mapTransIsolationNameToValue = null
static Map multibyteCharsetsMap
static final Log NULL_LOGGER = new NullLogger(LOGGER_INSTANCE_NAME)
static final String PING_COMMAND = "SELECT 1"
static Map roundRobinStatsMap
static final Map serverCollationByUrl = new HashMap()
static final Map serverConfigByUrl = new HashMap()


class  CompoundCacheKey
class  UltraDevWorkAround

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index