Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mysql.jdbc
Class Connection  view Connection download Connection.java

java.lang.Object
  extended bycom.mysql.jdbc.Connection
All Implemented Interfaces:
java.sql.Connection

public class Connection
extends java.lang.Object
implements java.sql.Connection

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.

Version:
$Id: Connection.java,v 1.31.2.85 2004/11/15 00:23:07 mmatthew Exp $

Nested Class Summary
(package private)  class Connection.UltraDevWorkAround
          Wrapper class for UltraDev CallableStatements that are really PreparedStatments.
 
Field Summary
private  boolean allowLoadLocalInfile
          Allow LOAD LOCAL INFILE (defaults to true)
private  boolean alwaysClearStream
          Should we clear the input stream each query?
private  boolean autoCommit
          Are we in autoCommit mode?
private  java.util.Map cachedPreparedStatementParams
          A map of SQL to parsed prepared statement parameters.
private  boolean cachePreparedStatements
          SHould we cache the parsing of prepared statements?
private  boolean capitalizeDBMDTypes
          Should we capitalize mysql types
private  java.lang.String characterSetMetadata
          For servers > 4.1.0, what character set is the metadata returned in?
private  java.lang.String characterSetResults
          The character set we want results and result metadata returned in (null == results in any charset, metadata in UTF-8).
private  java.lang.String characterSetResultsOnServer
          The character set we want results and result metadata returned in (null == results in any charset, metadata in UTF-8).
private static java.lang.Object CHARSET_CONVERTER_NOT_AVAILABLE_MARKER
          Marker for character set converter not being available (not written, multibyte, etc) Used to prevent multiple instantiation requests.
private  java.util.Map charsetConverterMap
          Holds cached mappings to charset converters to avoid static synchronization and at the same time save memory (each charset converter takes approx 65K of static data).
private static java.util.Map charsetMap
          The mapping between MySQL charset names and Java charset names.
private  boolean clobberStreamingResults
          Should we clobber streaming results on new queries, or issue an error?
private  boolean continueBatchOnError
          Should we continue processing batch commands if one fails.
private  java.lang.String database
          The database we're currently using (called Catalog in JDBC terms).
private  DatabaseMetaData dbmd
          Internal DBMD to use for various database-version specific features
private static java.lang.String DEFAULT_SOCKET_FACTORY
          Default socket factory classname
private  java.util.TimeZone defaultTimeZone
           
private  boolean doUnicode
          Should we do unicode character conversions?
private  java.lang.String encoding
          If we're doing unicode character conversions, what encoding do we use?
private  java.lang.Throwable explicitCloseLocation
          Where was the connection _explicitly_ closed by the application?
private  boolean failedOver
          Are we failed-over to a non-master host
private  boolean failOverReadOnly
          When failed-over, set connection to read-only?
private  java.lang.Throwable forcedCloseReason
          If the connection was forced closed, why was it forced closed?
private  boolean hasIsolationLevels
          Does the server suuport isolation levels?
private  boolean hasQuotedIdentifiers
          Does this version of MySQL support quoted identifiers?
private  boolean highAvailability
           
private  java.lang.String host
          The hostname we're connected to
private  java.util.List hostList
          The list of host(s) to try and connect to
private  int hostListSize
          How many hosts are in the host list?
private  boolean ignoreNonTxTables
          Ignore non-transactional table warning for rollback?
private  java.lang.String[] indexToCharsetMapping
          We need this 'bootstrapped', because 4.1 and newer will send fields back with this even before we fill this dynamically from the server.
private  double initialTimeout
           
private  MysqlIO io
          The I/O abstraction interface (network conn to MySQL server
private  boolean isClosed
          Has this connection been closed?
private  boolean isInteractiveClient
          Should we tell MySQL that we're an interactive client?
private  int isolationLevel
          isolation level
private  long lastQueryFinishedTime
          When did the last query finish?
private  boolean lowerCaseTableNames
          Is the server configured to use lower-case table names only?
private static java.util.Map mapTransIsolationName2Value
          Map mysql transaction isolation level name to java.sql.Connection.TRANSACTION_XXX
private  long masterFailTimeMillis
          When did the master fail?
private  int maxAllowedPacket
          The largest packet we can send (changed once we know what the server supports, we get this at connection init).
private  int maxReconnects
           
private  int maxRows
          The max rows that a result set can contain.
private  boolean maxRowsChanged
          Has the max-rows setting been changed from the default?
private static java.util.Map multibyteCharsetsMap
          Table of multi-byte charsets.
private  java.lang.Object mutex
          Mutex
private  NonRegisteringDriver myDriver
          The driver instance that created us
private  java.lang.String mysqlEncodingName
          What does MySQL call this encoding?
private  java.lang.String myURL
          The JDBC URL we're using
private  boolean needsPing
           
private  java.lang.String negativeInfinityRep
           
private  boolean negativeInfinityRepIsClipped
           
private  int netBufferLength
           
private  java.lang.String notANumberRep
           
private  boolean notANumberRepIsClipped
           
private  boolean paranoid
          Do we expose sensitive information in exception and error messages?
(package private)  boolean parserKnowsUnicode
           
private  java.lang.String password
          The password we used
private  boolean pedantic
          Should we do 'extra' sanity checks?
private static java.lang.String PING_COMMAND
           
private  int port
          The port number we're connected to (defaults to 3306)
private  java.lang.String positiveInfinityRep
           
private  boolean positiveInfinityRepIsClipped
           
private  int preparedStatementCacheMaxSqlSize
          If prepared statement caching is enabled, what should the threshold length of the SQL to prepare should be in order to _not_ cache?
private  int preparedStatementCacheSize
          If prepared statement caching is enabled, how many should we cache?
private  java.util.Properties props
          Properties for this connection specified by user
private  int queriesBeforeRetryMaster
          How many queries should we wait before we try to re-connect to the master, when we are failing over to replicated hosts Defaults to 50
private  long queriesIssuedFailedOver
          Number of queries we've issued since the master failed
private  boolean readInfoMsg
          Should we retrieve 'info' messages from the server?
private  boolean readOnly
          Are we in read-only mode?
private  boolean reconnectAtTxEnd
          If autoReconnect == true, should we attempt to reconnect at transaction boundaries?
private  boolean relaxAutoCommit
          Do we relax the autoCommit semantics? (For enhydra, for example)
private  boolean rollbackOnPooledClose
          Should rollback() be called when pooled connections are closed?
private  long secondsBeforeRetryMaster
          How many seconds should we wait before retrying to connect to the master if failed over? We fall back when either queriesBeforeRetryMaster or secondsBeforeRetryMaster is reached.
private  java.util.TimeZone serverTimezone
          The timezone of the server
private  java.util.Map serverVariables
          The map of server variables that we retrieve at connection init.
private  java.lang.String socketFactoryClassName
          Classname for socket factory
private  int socketTimeout
          What should we set the socket timeout to?
private  java.util.Map statementsUsingMaxRows
          A map of statements that have had setMaxRows() called on them
private  boolean strictFloatingPoint
          Do we need to correct endpoint rounding errors
private  boolean strictUpdates
          Do we check all keys for updatable result sets?
private  boolean tinyint1isBit
           
private  boolean transactionsSupported
          Are transactions supported by the MySQL server we are connected to?
private  java.util.Map typeMap
          The type map for UDTs (not implemented, but used by some third-party vendors, most notably IBM WebSphere)
private  boolean useAnsiQuotes
          Has ANSI_QUOTES been enabled on the server?
private  boolean useCompression
          Should we use compression?
private  boolean useFastPing
          Can we use the "ping" command rather than a query?
private  boolean useHostsInPrivileges
          Should we tack on hostname in DBMD.getTable/ColumnPrivileges()?
private  boolean useOnlyServerErrorMessages
          Should we only use the error message from the server when reporting errors?
private  java.lang.String user
          The user we're connected as
private  boolean useSSL
          Should we use SSL?
private  boolean useStreamLengthsInPrepStmts
          Should we use stream lengths in prepared statements? (true by default == JDBC compliant)
private  boolean useTimezone
          Should we use timezone information?
private  boolean useUltraDevWorkAround
          Should we return PreparedStatements for UltraDev's stupid bug?
private  boolean useUnbufferedInput
           
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
(package private) Connection(java.lang.String host, int port, java.util.Properties info, java.lang.String database, java.lang.String url, NonRegisteringDriver d)
          Creates a connection to a MySQL Server.
 
Method Summary
 boolean allowLoadLocalInfile()
          Allow use of LOAD LOCAL INFILE?
(package private)  boolean alwaysClearStream()
           
private  void buildCollationMapping()
          Builds the map needed for 4.1.0 and newer servers that maps field-level charset/collation info to a java character encoding name.
 boolean capitalizeDBMDTypes()
          DOCUMENT ME!
 void changeUser(java.lang.String userName, java.lang.String newPassword)
          Changes the user on this connection by performing a re-authentication.
private  void checkClosed()
           
private  void checkServerEncoding()
          If useUnicode flag is set and explicit client character encoding isn't specified then assign encoding from server if any.
private  void checkTransactionIsolationLevel()
          Set transaction isolation level to the value received from server if any.
private  void cleanup(java.lang.Throwable cleanupReason)
          Destroys this connection and any underlying resources
 void clearWarnings()
          After this call, getWarnings returns null until a new warning is reported for this connection.
 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.
private  void configureCharsetProperties(java.util.Properties info)
          Configures client-side properties for character set information.
private  boolean configureClientCharacterSet()
          Sets up client character set for MySQL-4.1 and newer.
private  void configureTimezone()
          Configures the client's timezone if required.
(package private)  boolean continueBatchOnError()
           
protected  MysqlIO createNewIO(boolean isForReconnect)
          Creates an IO channel to the server
 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)
          This method creates a new SQL statement with the specified type, concurrency and holdability, instead of using the defaults.
private  void detectFloatingPointStyle()
           
(package private)  ResultSet execSQL(java.lang.String sql, int maxRows, Buffer packet, int resultSetType, boolean streamResults, boolean queryIsSelectOnly, java.lang.String catalog)
           
(package private)  ResultSet execSQL(java.lang.String sql, int maxRows, Buffer packet, int resultSetType, java.lang.String catalog)
           
(package private)  ResultSet execSQL(java.lang.String sql, int maxRows, Buffer packet, java.lang.String catalog)
           
(package private)  ResultSet execSQL(java.lang.String sql, int maxRows, int resultSetType, boolean streamResults, boolean queryIsSelectOnly, java.lang.String catalog)
           
(package private)  ResultSet execSQL(java.lang.String sql, int maxRowsToRetreive, java.lang.String catalog)
          Send a query to the server.
protected  void finalize()
          Cleanup the connection.
 boolean getAutoCommit()
          gets the current auto-commit state
 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()
           
(package private)  SingleByteCharsetConverter getCharsetConverter(java.lang.String javaEncodingName)
          Returns the locally mapped instance of a charset converter (to avoid overhead of static synchronization).
protected  java.lang.String getCharsetNameForIndex(int charsetIndex)
          Returns the Java character encoding name for the given MySQL server charset index
 boolean getClobberStreamingResults()
          Returns whether we clobber streaming results on new queries, or issue an error?
protected  java.util.TimeZone getDefaultTimeZone()
          DOCUMENT ME!
 java.lang.String getEncoding()
          Returns the character encoding for this Connection
 int getHoldability()
          Gets the default holdability of ResultSetS that are created from StatementS using this Connection.
 long getIdleFor()
          NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle.
protected  MysqlIO getIO()
          Returns the IO channel to the server
(package private)  int getMaxAllowedPacket()
          Returns the maximum packet size the MySQL server will accept
(package private)  int getMaxRows()
          DOCUMENT ME!
 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.
(package private)  java.lang.Object getMutex()
          Returns the Mutex all queries are locked against
 java.lang.String getNegativeInfinityRep()
          DOCUMENT ME!
(package private)  int getNetBufferLength()
          Returns the packet buffer size the MySQL server reported upon connection
protected  int getNetWriteTimeout()
           
 java.lang.String getNotANumberRep()
          DOCUMENT ME!
 java.lang.String getPositiveInfinityRep()
          DOCUMENT ME!
 boolean getRollbackOnPooledClose()
           
protected  java.lang.String getServerCharacterEncoding()
          Returns the server's character set
(package private)  int getServerMajorVersion()
           
(package private)  int getServerMinorVersion()
           
(package private)  int getServerSubMinorVersion()
           
 java.util.TimeZone getServerTimezone()
          DOCUMENT ME!
(package private)  java.lang.String getServerVersion()
           
 boolean getTinyint1isBit()
           
 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.
(package private)  java.lang.String getURL()
           
protected  boolean getUseOnlyServerErrorMessages()
           
(package private)  java.lang.String getUser()
           
private  boolean getUseUltraDevWorkAround()
           
 java.sql.SQLWarning getWarnings()
          The first warning reported by calls on this Connection is returned.
private  void initializeDriverProperties(java.util.Properties info)
          Initializes driver properties that come from URL or properties passed to the driver manager.
private  void initializePropsFromServer(java.util.Properties info)
          Sets varying properties that depend on server information.
 boolean isClosed()
          DOCUMENT ME!
 boolean isInteractiveClient()
          Should we tell MySQL that we're an interactive client
 boolean isNegativeInfinityRepIsClipped()
          DOCUMENT ME!
 boolean isNotANumberRepIsClipped()
          DOCUMENT ME!
(package private)  boolean isPedantic()
           
 boolean isPositiveInfinityRepIsClipped()
          DOCUMENT ME!
(package private)  boolean isReadInfoMsgEnabled()
           
 boolean isReadOnly()
          Tests to see if the connection is in Read Only Mode.
protected  boolean isUsingUnbufferedInput()
          Is this connection using unbuffered input?
private static void loadCharacterSetMapping()
          Loads the mapping between MySQL character sets and Java character sets
private  void loadServerVariables()
          Loads the result of 'SHOW VARIABLES' into the serverVariables field so that the driver can configure itself.
 boolean lowerCaseTableNames()
          Is the server configured to use lower-case table names only?
(package private)  void maxRowsChanged(Statement stmt)
          Has the maxRows value changed?
 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!
private  void ping()
          Detect if the connection is still good
private  void pingAndReconnect(boolean ignoreAutoCommitSetting)
           
 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)
          This method creates a new CallableStatement for the specified SQL string.
 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)
          This method creates a new PreparedStatement for the specified SQL string.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] autoGenKeyColNames)
           
protected  void realClose(boolean calledExplicitly, boolean issueRollback)
          Closes connection and frees resources.
 void releaseSavepoint(java.sql.Savepoint arg0)
          Removes the specified savepoint from this Connection.
 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 arg0)
          Undoes all changes made after the specified savepoint was set.
private  void rollbackNoChecks()
           
 void setAutoCommit(boolean autoCommit)
          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.
private  void setFailedOverState()
          Sets state for a failed-over connection
 void setHoldability(int arg0)
          Sets the default holdability of ResultSetS that are created from StatementS using this Connection.
 void setProfileSql(boolean flag)
          Should the driver do profiling?
(package private)  void setReadInfoMsgEnabled(boolean flag)
           
 void setReadOnly(boolean readOnly)
          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
 java.sql.Savepoint setSavepoint()
          Creates a new unnamed savepoint for this Connection
 java.sql.Savepoint setSavepoint(java.lang.String arg0)
          Creates a new savepoint with the specifiend name for this Connection.
 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
(package private)  void setUseSSL(boolean flag)
          Set whether or not this connection should use SSL
private  boolean shouldFallBack()
          Should we try to connect back to the master? We try when we've been failed over >= this.secondsBeforeRetryMaster _or_ we've issued > this.queriesIssuedFailedOver
 void shutdownServer()
          Used by MiniAdmin to shutdown a MySQL server
 boolean supportsIsolationLevel()
          DOCUMENT ME!
 boolean supportsQuotedIdentifiers()
          DOCUMENT ME!
 boolean supportsTransactions()
          DOCUMENT ME!
(package private)  void unsetMaxRows(Statement 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.
(package private)  boolean useAnsiQuotedIdentifiers()
           
 boolean useCompression()
          Should we use compression?
(package private)  boolean useHostsInPrivileges()
           
(package private)  boolean useMaxRows()
          Has maxRows() been set?
 boolean useParanoidErrorMessages()
          Returns the paranoidErrorMessages.
 boolean useSSL()
          Should we use SSL?
(package private)  boolean useStreamLengthsInPrepStmts()
           
 boolean useStrictFloatingPoint()
          Should we enable work-arounds for floating point rounding errors in the server?
 boolean useStrictUpdates()
          Returns the strictUpdates value.
 boolean useTimezone()
          DOCUMENT ME!
 boolean useUnicode()
          Should unicode character mapping be used ?
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PING_COMMAND

private static final java.lang.String PING_COMMAND
See Also:
Constant Field Values

mapTransIsolationName2Value

private static java.util.Map mapTransIsolationName2Value
Map mysql transaction isolation level name to java.sql.Connection.TRANSACTION_XXX


charsetMap

private static java.util.Map charsetMap
The mapping between MySQL charset names and Java charset names. Initialized by loadCharacterSetMapping()


multibyteCharsetsMap

private static java.util.Map multibyteCharsetsMap
Table of multi-byte charsets. Initialized by loadCharacterSetMapping()


DEFAULT_SOCKET_FACTORY

private static final java.lang.String DEFAULT_SOCKET_FACTORY
Default socket factory classname


CHARSET_CONVERTER_NOT_AVAILABLE_MARKER

private static final java.lang.Object CHARSET_CONVERTER_NOT_AVAILABLE_MARKER
Marker for character set converter not being available (not written, multibyte, etc) Used to prevent multiple instantiation requests.


parserKnowsUnicode

boolean parserKnowsUnicode

dbmd

private DatabaseMetaData dbmd
Internal DBMD to use for various database-version specific features


hostList

private java.util.List hostList
The list of host(s) to try and connect to


cachedPreparedStatementParams

private java.util.Map cachedPreparedStatementParams
A map of SQL to parsed prepared statement parameters.


charsetConverterMap

private java.util.Map charsetConverterMap
Holds cached mappings to charset converters to avoid static synchronization and at the same time save memory (each charset converter takes approx 65K of static data).


statementsUsingMaxRows

private java.util.Map statementsUsingMaxRows
A map of statements that have had setMaxRows() called on them


typeMap

private java.util.Map typeMap
The type map for UDTs (not implemented, but used by some third-party vendors, most notably IBM WebSphere)


io

private MysqlIO io
The I/O abstraction interface (network conn to MySQL server


mutex

private final java.lang.Object mutex
Mutex


serverVariables

private java.util.Map serverVariables
The map of server variables that we retrieve at connection init.


myDriver

private NonRegisteringDriver myDriver
The driver instance that created us


props

private java.util.Properties props
Properties for this connection specified by user


database

private java.lang.String database
The database we're currently using (called Catalog in JDBC terms).


encoding

private java.lang.String encoding
If we're doing unicode character conversions, what encoding do we use?


host

private java.lang.String host
The hostname we're connected to


myURL

private java.lang.String myURL
The JDBC URL we're using


mysqlEncodingName

private java.lang.String mysqlEncodingName
What does MySQL call this encoding?


negativeInfinityRep

private java.lang.String negativeInfinityRep

notANumberRep

private java.lang.String notANumberRep

password

private java.lang.String password
The password we used


positiveInfinityRep

private java.lang.String positiveInfinityRep

socketFactoryClassName

private java.lang.String socketFactoryClassName
Classname for socket factory


user

private java.lang.String user
The user we're connected as


explicitCloseLocation

private java.lang.Throwable explicitCloseLocation
Where was the connection _explicitly_ closed by the application?


forcedCloseReason

private java.lang.Throwable forcedCloseReason
If the connection was forced closed, why was it forced closed?


defaultTimeZone

private java.util.TimeZone defaultTimeZone

serverTimezone

private java.util.TimeZone serverTimezone
The timezone of the server


indexToCharsetMapping

private java.lang.String[] indexToCharsetMapping
We need this 'bootstrapped', because 4.1 and newer will send fields back with this even before we fill this dynamically from the server.


allowLoadLocalInfile

private boolean allowLoadLocalInfile
Allow LOAD LOCAL INFILE (defaults to true)


alwaysClearStream

private boolean alwaysClearStream
Should we clear the input stream each query?


autoCommit

private boolean autoCommit
Are we in autoCommit mode?


cachePreparedStatements

private boolean cachePreparedStatements
SHould we cache the parsing of prepared statements?


capitalizeDBMDTypes

private boolean capitalizeDBMDTypes
Should we capitalize mysql types


clobberStreamingResults

private boolean clobberStreamingResults
Should we clobber streaming results on new queries, or issue an error?


continueBatchOnError

private boolean continueBatchOnError
Should we continue processing batch commands if one fails. The JDBC spec allows either way, so we let the user choose


doUnicode

private boolean doUnicode
Should we do unicode character conversions?


failOverReadOnly

private boolean failOverReadOnly
When failed-over, set connection to read-only?


failedOver

private boolean failedOver
Are we failed-over to a non-master host


hasIsolationLevels

private boolean hasIsolationLevels
Does the server suuport isolation levels?


hasQuotedIdentifiers

private boolean hasQuotedIdentifiers
Does this version of MySQL support quoted identifiers?


highAvailability

private boolean highAvailability

ignoreNonTxTables

private boolean ignoreNonTxTables
Ignore non-transactional table warning for rollback?


isClosed

private boolean isClosed
Has this connection been closed?


isInteractiveClient

private boolean isInteractiveClient
Should we tell MySQL that we're an interactive client?


lowerCaseTableNames

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


maxRowsChanged

private boolean maxRowsChanged
Has the max-rows setting been changed from the default?


needsPing

private boolean needsPing

negativeInfinityRepIsClipped

private boolean negativeInfinityRepIsClipped

notANumberRepIsClipped

private boolean notANumberRepIsClipped

paranoid

private boolean paranoid
Do we expose sensitive information in exception and error messages?


pedantic

private boolean pedantic
Should we do 'extra' sanity checks?


positiveInfinityRepIsClipped

private boolean positiveInfinityRepIsClipped

readInfoMsg

private boolean readInfoMsg
Should we retrieve 'info' messages from the server?


readOnly

private boolean readOnly
Are we in read-only mode?


reconnectAtTxEnd

private boolean reconnectAtTxEnd
If autoReconnect == true, should we attempt to reconnect at transaction boundaries?


relaxAutoCommit

private boolean relaxAutoCommit
Do we relax the autoCommit semantics? (For enhydra, for example)


strictFloatingPoint

private boolean strictFloatingPoint
Do we need to correct endpoint rounding errors


strictUpdates

private boolean strictUpdates
Do we check all keys for updatable result sets?


transactionsSupported

private boolean transactionsSupported
Are transactions supported by the MySQL server we are connected to?


useAnsiQuotes

private boolean useAnsiQuotes
Has ANSI_QUOTES been enabled on the server?


useCompression

private boolean useCompression
Should we use compression?


useFastPing

private boolean useFastPing
Can we use the "ping" command rather than a query?


useHostsInPrivileges

private boolean useHostsInPrivileges
Should we tack on hostname in DBMD.getTable/ColumnPrivileges()?


useOnlyServerErrorMessages

private boolean useOnlyServerErrorMessages
Should we only use the error message from the server when reporting errors?


useSSL

private boolean useSSL
Should we use SSL?


useStreamLengthsInPrepStmts

private boolean useStreamLengthsInPrepStmts
Should we use stream lengths in prepared statements? (true by default == JDBC compliant)


useTimezone

private boolean useTimezone
Should we use timezone information?


useUltraDevWorkAround

private boolean useUltraDevWorkAround
Should we return PreparedStatements for UltraDev's stupid bug?


useUnbufferedInput

private boolean useUnbufferedInput

initialTimeout

private double initialTimeout

hostListSize

private int hostListSize
How many hosts are in the host list?


isolationLevel

private int isolationLevel
isolation level


maxAllowedPacket

private int maxAllowedPacket
The largest packet we can send (changed once we know what the server supports, we get this at connection init).


maxReconnects

private int maxReconnects

maxRows

private int maxRows
The max rows that a result set can contain. Defaults to -1, which according to the JDBC spec means "all".


netBufferLength

private int netBufferLength

port

private int port
The port number we're connected to (defaults to 3306)


preparedStatementCacheMaxSqlSize

private int preparedStatementCacheMaxSqlSize
If prepared statement caching is enabled, what should the threshold length of the SQL to prepare should be in order to _not_ cache?


preparedStatementCacheSize

private int preparedStatementCacheSize
If prepared statement caching is enabled, how many should we cache?


queriesBeforeRetryMaster

private int queriesBeforeRetryMaster
How many queries should we wait before we try to re-connect to the master, when we are failing over to replicated hosts Defaults to 50


socketTimeout

private int socketTimeout
What should we set the socket timeout to?


lastQueryFinishedTime

private long lastQueryFinishedTime
When did the last query finish?


masterFailTimeMillis

private long masterFailTimeMillis
When did the master fail?


queriesIssuedFailedOver

private long queriesIssuedFailedOver
Number of queries we've issued since the master failed


secondsBeforeRetryMaster

private long secondsBeforeRetryMaster
How many seconds should we wait before retrying to connect to the master if failed over? We fall back when either queriesBeforeRetryMaster or secondsBeforeRetryMaster is reached.


characterSetResults

private java.lang.String characterSetResults
The character set we want results and result metadata returned in (null == results in any charset, metadata in UTF-8).


characterSetResultsOnServer

private java.lang.String characterSetResultsOnServer
The character set we want results and result metadata returned in (null == results in any charset, metadata in UTF-8).


characterSetMetadata

private java.lang.String characterSetMetadata
For servers > 4.1.0, what character set is the metadata returned in?


rollbackOnPooledClose

private boolean rollbackOnPooledClose
Should rollback() be called when pooled connections are closed?


tinyint1isBit

private boolean tinyint1isBit
Constructor Detail

Connection

Connection(java.lang.String host,
           int port,
           java.util.Properties info,
           java.lang.String database,
           java.lang.String url,
           NonRegisteringDriver d)
     throws java.sql.SQLException
Creates a connection to a MySQL Server.

Method Detail

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException
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.

Specified by:
setAutoCommit in interface java.sql.Connection

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
gets the current auto-commit state

Specified by:
getAutoCommit in interface java.sql.Connection

setCatalog

public void setCatalog(java.lang.String catalog)
                throws java.sql.SQLException
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.

Specified by:
setCatalog in interface java.sql.Connection

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
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.

Specified by:
getCatalog in interface java.sql.Connection

getClobberStreamingResults

public boolean getClobberStreamingResults()
Returns whether we clobber streaming results on new queries, or issue an error?


isClosed

public boolean isClosed()
DOCUMENT ME!

Specified by:
isClosed in interface java.sql.Connection

getEncoding

public java.lang.String getEncoding()
Returns the character encoding for this Connection


setHoldability

public void setHoldability(int arg0)
                    throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Sets the default holdability of ResultSetS that are created from StatementS using this Connection.

Specified by:
setHoldability in interface java.sql.Connection

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Gets the default holdability of ResultSetS that are created from StatementS using this Connection.

Specified by:
getHoldability in interface java.sql.Connection

getIdleFor

public long getIdleFor()
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.


isInteractiveClient

public boolean isInteractiveClient()
Should we tell MySQL that we're an interactive client


getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
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.

Specified by:
getMetaData in interface java.sql.Connection

getNegativeInfinityRep

public java.lang.String getNegativeInfinityRep()
DOCUMENT ME!


isNegativeInfinityRepIsClipped

public boolean isNegativeInfinityRepIsClipped()
DOCUMENT ME!


getNotANumberRep

public java.lang.String getNotANumberRep()
DOCUMENT ME!


isNotANumberRepIsClipped

public boolean isNotANumberRepIsClipped()
DOCUMENT ME!


getPositiveInfinityRep

public java.lang.String getPositiveInfinityRep()
DOCUMENT ME!


isPositiveInfinityRepIsClipped

public boolean isPositiveInfinityRepIsClipped()
DOCUMENT ME!


setProfileSql

public void setProfileSql(boolean flag)
                   throws java.sql.SQLException
Should the driver do profiling?


setReadOnly

public void setReadOnly(boolean readOnly)
                 throws java.sql.SQLException
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

Specified by:
setReadOnly in interface java.sql.Connection

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
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

Specified by:
isReadOnly in interface java.sql.Connection

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Creates a new unnamed savepoint for this Connection

Specified by:
setSavepoint in interface java.sql.Connection

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String arg0)
                                throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Creates a new savepoint with the specifiend name for this Connection.

Specified by:
setSavepoint in interface java.sql.Connection

getServerTimezone

public java.util.TimeZone getServerTimezone()
DOCUMENT ME!


setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException
DOCUMENT ME!

Specified by:
setTransactionIsolation in interface java.sql.Connection

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
Get this Connection's current transaction isolation mode.

Specified by:
getTransactionIsolation in interface java.sql.Connection

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.SQLException
JDBC 2.0 Install a type-map object as the default type-map for this connection

Specified by:
setTypeMap in interface java.sql.Connection

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.SQLException
JDBC 2.0 Get the type-map object associated with this connection. By default, the map returned is empty.

Specified by:
getTypeMap in interface java.sql.Connection

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
The first warning reported by calls on this Connection is returned. Note: Sebsequent warnings will be changed to this java.sql.SQLWarning

Specified by:
getWarnings in interface java.sql.Connection

allowLoadLocalInfile

public boolean allowLoadLocalInfile()
Allow use of LOAD LOCAL INFILE?


capitalizeDBMDTypes

public boolean capitalizeDBMDTypes()
DOCUMENT ME!


changeUser

public void changeUser(java.lang.String userName,
                       java.lang.String newPassword)
                throws java.sql.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.


clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
After this call, getWarnings returns null until a new warning is reported for this connection.

Specified by:
clearWarnings in interface java.sql.Connection

close

public void close()
           throws java.sql.SQLException
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.

Specified by:
close in interface java.sql.Connection

commit

public void commit()
            throws java.sql.SQLException
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.

Specified by:
commit in interface java.sql.Connection

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.SQLException
JDBC 2.0 Same as createStatement() above, but allows the default result set type and result set concurrency type to be overridden.

Specified by:
createStatement in interface java.sql.Connection

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
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

Specified by:
createStatement in interface java.sql.Connection

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.SQLException
Description copied from interface: java.sql.Connection
This method creates a new SQL statement with the specified type, concurrency and holdability, instead of using the defaults. Valid values for these parameters are specified in the ResultSet class.

Specified by:
createStatement in interface java.sql.Connection

finalize

protected void finalize()
                 throws java.lang.Throwable
Cleanup the connection.


lowerCaseTableNames

public boolean lowerCaseTableNames()
Is the server configured to use lower-case table names only?


nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException
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.

Specified by:
nativeSQL in interface java.sql.Connection

parserKnowsUnicode

public boolean parserKnowsUnicode()
DOCUMENT ME!


prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
DOCUMENT ME!

Specified by:
prepareCall in interface java.sql.Connection

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.SQLException
JDBC 2.0 Same as prepareCall() above, but allows the default result set type and result set concurrency type to be overridden.

Specified by:
prepareCall in interface java.sql.Connection

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.SQLException
Description copied from interface: java.sql.Connection
This method creates a new CallableStatement for the specified SQL string. Thie method is designed to be used with stored procedures. The specified result set type, concurrency and holdability will be used. Valid values for these parameters are specified in the ResultSet class.

Specified by:
prepareCall in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
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.

Specified by:
prepareStatement in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException
JDBC 2.0 Same as prepareStatement() above, but allows the default result set type and result set concurrency type to be overridden.

Specified by:
prepareStatement in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.SQLException
Description copied from interface: java.sql.Connection
This method creates a new PreparedStatement for the specified SQL string. This method is designed for use with parameterized statements. The specified result set type, concurrency and holdability will be used. Valid values for these parameters are specified in the ResultSet class.

Specified by:
prepareStatement in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGenKeyIndex)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] autoGenKeyIndexes)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] autoGenKeyColNames)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint arg0)
                      throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Removes the specified savepoint from this Connection. Refering to a savepoint after it was removed is an error and will throw an SQLException.

Specified by:
releaseSavepoint in interface java.sql.Connection

resetServerState

public void resetServerState()
                      throws java.sql.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.


rollback

public void rollback()
              throws java.sql.SQLException
The method rollback() drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection.

Specified by:
rollback in interface java.sql.Connection

rollback

public void rollback(java.sql.Savepoint arg0)
              throws java.sql.SQLException
Description copied from interface: java.sql.Connection
Undoes all changes made after the specified savepoint was set.

Specified by:
rollback in interface java.sql.Connection

shutdownServer

public void shutdownServer()
                    throws java.sql.SQLException
Used by MiniAdmin to shutdown a MySQL server


supportsIsolationLevel

public boolean supportsIsolationLevel()
DOCUMENT ME!


supportsQuotedIdentifiers

public boolean supportsQuotedIdentifiers()
DOCUMENT ME!


supportsTransactions

public boolean supportsTransactions()
DOCUMENT ME!


useCompression

public boolean useCompression()
Should we use compression?


useParanoidErrorMessages

public boolean useParanoidErrorMessages()
Returns the paranoidErrorMessages.


useSSL

public boolean useSSL()
Should we use SSL?


useStrictFloatingPoint

public boolean useStrictFloatingPoint()
Should we enable work-arounds for floating point rounding errors in the server?


useStrictUpdates

public boolean useStrictUpdates()
Returns the strictUpdates value.


useTimezone

public boolean useTimezone()
DOCUMENT ME!


useUnicode

public boolean useUnicode()
Should unicode character mapping be used ?


getCharsetNameForIndex

protected java.lang.String getCharsetNameForIndex(int charsetIndex)
                                           throws java.sql.SQLException
Returns the Java character encoding name for the given MySQL server charset index


getDefaultTimeZone

protected java.util.TimeZone getDefaultTimeZone()
DOCUMENT ME!


getIO

protected MysqlIO getIO()
                 throws java.sql.SQLException
Returns the IO channel to the server


getNetWriteTimeout

protected int getNetWriteTimeout()

isUsingUnbufferedInput

protected boolean isUsingUnbufferedInput()
Is this connection using unbuffered input?


createNewIO

protected MysqlIO createNewIO(boolean isForReconnect)
                       throws java.sql.SQLException
Creates an IO channel to the server


realClose

protected void realClose(boolean calledExplicitly,
                         boolean issueRollback)
                  throws java.sql.SQLException
Closes connection and frees resources.


getCharsetConverter

SingleByteCharsetConverter getCharsetConverter(java.lang.String javaEncodingName)
Returns the locally mapped instance of a charset converter (to avoid overhead of static synchronization).


getMaxAllowedPacket

int getMaxAllowedPacket()
Returns the maximum packet size the MySQL server will accept


getMaxRows

int getMaxRows()
DOCUMENT ME!


getMutex

java.lang.Object getMutex()
                    throws java.sql.SQLException
Returns the Mutex all queries are locked against


getNetBufferLength

int getNetBufferLength()
Returns the packet buffer size the MySQL server reported upon connection


isPedantic

boolean isPedantic()

setReadInfoMsgEnabled

void setReadInfoMsgEnabled(boolean flag)

isReadInfoMsgEnabled

boolean isReadInfoMsgEnabled()

getServerMajorVersion

int getServerMajorVersion()

getServerMinorVersion

int getServerMinorVersion()

getServerSubMinorVersion

int getServerSubMinorVersion()

getServerVersion

java.lang.String getServerVersion()

getURL

java.lang.String getURL()

setUseSSL

void setUseSSL(boolean flag)
Set whether or not this connection should use SSL


getUser

java.lang.String getUser()

alwaysClearStream

boolean alwaysClearStream()

continueBatchOnError

boolean continueBatchOnError()

execSQL

ResultSet execSQL(java.lang.String sql,
                  int maxRowsToRetreive,
                  java.lang.String catalog)
            throws java.sql.SQLException
Send a query to the server. Returns one of the ResultSet objects. This is synchronized, so Statement's queries will be serialized.


execSQL

ResultSet execSQL(java.lang.String sql,
                  int maxRows,
                  int resultSetType,
                  boolean streamResults,
                  boolean queryIsSelectOnly,
                  java.lang.String catalog)
            throws java.sql.SQLException

execSQL

ResultSet execSQL(java.lang.String sql,
                  int maxRows,
                  Buffer packet,
                  java.lang.String catalog)
            throws java.sql.SQLException

execSQL

ResultSet execSQL(java.lang.String sql,
                  int maxRows,
                  Buffer packet,
                  int resultSetType,
                  java.lang.String catalog)
            throws java.sql.SQLException

execSQL

ResultSet execSQL(java.lang.String sql,
                  int maxRows,
                  Buffer packet,
                  int resultSetType,
                  boolean streamResults,
                  boolean queryIsSelectOnly,
                  java.lang.String catalog)
            throws java.sql.SQLException

maxRowsChanged

void maxRowsChanged(Statement stmt)
Has the maxRows value changed?


unsetMaxRows

void unsetMaxRows(Statement stmt)
            throws java.sql.SQLException
Called by statements on their .close() to let the connection know when it is safe to set the connection back to 'default' row limits.


useAnsiQuotedIdentifiers

boolean useAnsiQuotedIdentifiers()

useHostsInPrivileges

boolean useHostsInPrivileges()

useMaxRows

boolean useMaxRows()
Has maxRows() been set?


useStreamLengthsInPrepStmts

boolean useStreamLengthsInPrepStmts()

setFailedOverState

private void setFailedOverState()
                         throws java.sql.SQLException
Sets state for a failed-over connection


buildCollationMapping

private void buildCollationMapping()
                            throws java.sql.SQLException
Builds the map needed for 4.1.0 and newer servers that maps field-level charset/collation info to a java character encoding name.


checkClosed

private void checkClosed()
                  throws java.sql.SQLException

checkServerEncoding

private void checkServerEncoding()
                          throws java.sql.SQLException
If useUnicode flag is set and explicit client character encoding isn't specified then assign encoding from server if any.


checkTransactionIsolationLevel

private void checkTransactionIsolationLevel()
                                     throws java.sql.SQLException
Set transaction isolation level to the value received from server if any. Is called by connectionInit(...)


cleanup

private void cleanup(java.lang.Throwable cleanupReason)
Destroys this connection and any underlying resources


configureClientCharacterSet

private boolean configureClientCharacterSet()
                                     throws java.sql.SQLException
Sets up client character set for MySQL-4.1 and newer. This must be done before any further communication with the server!


configureTimezone

private void configureTimezone()
                        throws java.sql.SQLException
Configures the client's timezone if required.


detectFloatingPointStyle

private void detectFloatingPointStyle()
                               throws java.sql.SQLException

initializeDriverProperties

private void initializeDriverProperties(java.util.Properties info)
                                 throws java.sql.SQLException
Initializes driver properties that come from URL or properties passed to the driver manager.


configureCharsetProperties

private void configureCharsetProperties(java.util.Properties info)
                                 throws java.sql.SQLException
Configures client-side properties for character set information.


initializePropsFromServer

private void initializePropsFromServer(java.util.Properties info)
                                throws java.sql.SQLException
Sets varying properties that depend on server information. Called once we have connected to the server.


loadCharacterSetMapping

private static void loadCharacterSetMapping()
Loads the mapping between MySQL character sets and Java character sets


getUseUltraDevWorkAround

private boolean getUseUltraDevWorkAround()

loadServerVariables

private void loadServerVariables()
                          throws java.sql.SQLException
Loads the result of 'SHOW VARIABLES' into the serverVariables field so that the driver can configure itself.


ping

private void ping()
           throws java.lang.Exception
Detect if the connection is still good


pingAndReconnect

private void pingAndReconnect(boolean ignoreAutoCommitSetting)
                       throws java.sql.SQLException

rollbackNoChecks

private void rollbackNoChecks()
                       throws java.sql.SQLException

shouldFallBack

private boolean shouldFallBack()
Should we try to connect back to the master? We try when we've been failed over >= this.secondsBeforeRetryMaster _or_ we've issued > this.queriesIssuedFailedOver


getCharacterSetMetadata

protected java.lang.String getCharacterSetMetadata()

getServerCharacterEncoding

protected java.lang.String getServerCharacterEncoding()
Returns the server's character set


getRollbackOnPooledClose

public boolean getRollbackOnPooledClose()

getUseOnlyServerErrorMessages

protected boolean getUseOnlyServerErrorMessages()

getTinyint1isBit

public boolean getTinyint1isBit()