EMMA Coverage Report (generated Wed Jul 26 14:28:59 CDT 2006)
[all classes][com.mysql.jdbc]

COVERAGE SUMMARY FOR SOURCE FILE [ConnectionProperties.java]

nameclass, %method, %block, %line, %
ConnectionProperties.java100% (7/7)50%  (151/301)68%  (2793/4133)53%  (442.9/840)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ConnectionProperties$ConnectionProperty100% (1/1)56%  (10/18)55%  (156/282)58%  (43/74)
ConnectionProperties$ConnectionProperty (ConnectionProperties): void 0%   (0/1)0%   (0/6)0%   (0/1)
getCategoryName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getDefaultValue (): Object 0%   (0/1)0%   (0/3)0%   (0/1)
getLowerBound (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getOrder (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getUpperBound (): int 0%   (0/1)0%   (0/3)0%   (0/1)
setCategoryName (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setOrder (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
validateStringValues (String): void 100% (1/1)24%  (30/127)25%  (7/28)
ConnectionProperties$ConnectionProperty (ConnectionProperties, String, Object... 100% (1/1)100% (39/39)100% (13/13)
getAllowableValues (): String [] 100% (1/1)100% (3/3)100% (1/1)
getAsDriverPropertyInfo (): DriverPropertyInfo 100% (1/1)100% (31/31)100% (6/6)
getPropertyName (): String 100% (1/1)100% (3/3)100% (1/1)
getValueAsObject (): Object 100% (1/1)100% (3/3)100% (1/1)
initializeFrom (Properties): void 100% (1/1)100% (14/14)100% (4/4)
initializeFrom (Reference): void 100% (1/1)100% (15/15)100% (5/5)
setValueAsObject (Object): void 100% (1/1)100% (4/4)100% (2/2)
storeTo (Reference): void 100% (1/1)100% (14/14)100% (3/3)
     
class ConnectionProperties$IntegerConnectionProperty100% (1/1)50%  (5/10)59%  (62/105)64%  (14/22)
getLowerBound (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getUpperBound (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hasValueConstraints (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
isRangeBased (): boolean 0%   (0/1)0%   (0/9)0%   (0/1)
setValue (int): void 0%   (0/1)0%   (0/7)0%   (0/2)
initializeFrom (String): void 100% (1/1)52%  (21/40)75%  (6/8)
ConnectionProperties$IntegerConnectionProperty (ConnectionProperties, String,... 100% (1/1)100% (12/12)100% (2/2)
ConnectionProperties$IntegerConnectionProperty (ConnectionProperties, String,... 100% (1/1)100% (22/22)100% (4/4)
getAllowableValues (): String [] 100% (1/1)100% (2/2)100% (1/1)
getValueAsInt (): int 100% (1/1)100% (5/5)100% (1/1)
     
class ConnectionProperties100% (1/1)48%  (122/255)68%  (2357/3473)50%  (349.9/695)
exposeAsXml (): String 0%   (0/1)0%   (0/344)0%   (0/65)
getCacheCallableStmts (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
getCachePrepStmts (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
getCallableStmtCacheSize (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getConnectTimeout (): int 0%   (0/1)0%   (0/4)0%   (0/1)
getDumpMetadataOnColumnNotFound (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getIsInteractiveClient (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getLocatorFetchBufferSize (): int 0%   (0/1)0%   (0/4)0%   (0/1)
getLoggerClassName (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getMetadataCacheSize (): int 0%   (0/1)0%   (0/4)0%   (0/1)
getPacketDebugBufferSize (): int 0%   (0/1)0%   (0/4)0%   (0/1)
getPrepStmtCacheSize (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getPrepStmtCacheSqlLimit (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getProfileSQL (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getPropertiesTransform (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getRelaxAutoCommit (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getRequireSSL (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getResourceId (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getRunningCTS13 (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
getUseServerPrepStmts (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
getUseUnbufferedInput (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
setAllowMultiQueries (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAllowNanAndInf (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAllowUrlInLocalInfile (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAlwaysSendSetIsolation (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAutoClosePStmtStreams (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAutoDeserialize (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAutoGenerateTestcaseScript (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setAutoReconnect (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setAutoReconnectForConnectionPools (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setAutoReconnectForPools (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCacheCallableStatements (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCacheCallableStmts (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
setCachePrepStmts (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
setCachePreparedStatements (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCacheResultSetMetadata (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setCacheServerConfiguration (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCallableStatementCacheSize (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCallableStmtCacheSize (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
setCapitalizeDBMDTypes (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCapitalizeTypeNames (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCharacterSetResults (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setClobCharacterEncoding (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setClobberStreamingResults (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setConnectTimeout (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setConnectionCollation (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setContinueBatchOnError (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setCreateDatabaseIfNotExist (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDefaultFetchSize (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDetectServerPreparedStmts (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDontTrackOpenResources (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDumpMetadataOnColumnNotFound (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDumpQueriesOnException (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setDynamicCalendars (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setElideSetAutoCommits (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setEmptyStringsConvertToZero (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setEmulateLocators (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setEmulateUnsupportedPstmts (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setEnablePacketDebug (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setExplainSlowQueries (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setFailOverReadOnly (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setGatherPerformanceMetrics (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setHighAvailability (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setHoldResultsOpenOverStatementClose (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setIgnoreNonTxTables (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setInitialTimeout (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setIsInteractiveClient (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setJdbcCompliantTruncationForReads (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
setLocatorFetchBufferSize (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setLogSlowQueries (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setLoggerClassName (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setMaintainTimeStats (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setMaxQuerySizeToLog (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setMaxReconnects (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setMaxRows (int): void 0%   (0/1)0%   (0/10)0%   (0/3)
setMetadataCacheSize (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setNoDatetimeStringSync (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setNoTimezoneConversionForTimeType (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setNullCatalogMeansCurrent (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setNullNamePatternMatchesAll (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setOverrideSupportsIntegrityEnhancementFacility (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPacketDebugBufferSize (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setParanoid (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPedantic (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPrepStmtCacheSize (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPrepStmtCacheSqlLimit (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPreparedStatementCacheSize (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPreparedStatementCacheSqlLimit (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setProcessEscapeCodesForPrepStmts (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setProfileSQL (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setPropertiesTransform (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setQueriesBeforeRetryMaster (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setReconnectAtTxEnd (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setRelaxAutoCommit (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setReportMetricsIntervalMillis (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setRequireSSL (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setResourceId (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setRetainStatementAfterResultSetClose (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setRewriteBatchedStatements (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setRoundRobinLoadBalance (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setRunningCTS13 (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setSecondsBeforeRetryMaster (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setServerTimezone (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setSessionVariables (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setSlowQueryThresholdMillis (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setSocketFactoryClassName (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setSocketTimeout (int): void 0%   (0/1)0%   (0/5)0%   (0/2)
setStrictFloatingPoint (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setStrictUpdates (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setTinyInt1isBit (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseCompression (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseCursorFetch (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseFastIntParsing (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseGmtMillisForDatetimes (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseHostsInPrivileges (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseInformationSchema (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseJDBCCompliantTimezoneShift (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseJvmCharsetConverters (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseLocalSessionState (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseOldUTF8Behavior (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setUseOnlyServerErrorMessages (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseReadAheadInput (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseSSL (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseServerPrepStmts (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
setUseServerPreparedStmts (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseSqlStateCodes (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseStreamLengthsInPrepStmts (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseTimezone (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseUltraDevWorkAround (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseUnbufferedInput (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
setUseUsageAdvisor (boolean): void 0%   (0/1)0%   (0/10)0%   (0/3)
setYearIsDateType (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
useUnbufferedInput (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
postInitialization (): void 100% (1/1)69%  (115/166)67%  (28/42)
initializeProperties (Properties): void 100% (1/1)78%  (63/81)86%  (18/21)
exposeAsProperties (Properties): Properties 100% (1/1)80%  (37/46)77%  (10/13)
initializeFromRef (Reference): void 100% (1/1)85%  (29/34)82%  (9/11)
storeToRef (Reference): void 100% (1/1)87%  (27/31)80%  (8/10)
exposeAsDriverPropertyInfoInternal (Properties, int): DriverPropertyInfo [] 100% (1/1)90%  (45/50)86%  (12/14)
<static initializer> 100% (1/1)90%  (83/92)81%  (8.9/11)
ConnectionProperties (): void 100% (1/1)100% (1478/1478)100% (126/126)
exposeAsDriverPropertyInfo (Properties, int): DriverPropertyInfo [] 100% (1/1)100% (7/7)100% (1/1)
getAllowLoadLocalInfile (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAllowMultiQueries (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAllowNanAndInf (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAllowUrlInLocalInfile (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAlwaysSendSetIsolation (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAutoClosePStmtStreams (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAutoDeserialize (): boolean 100% (1/1)100% (4/4)100% (1/1)
getAutoGenerateTestcaseScript (): boolean 100% (1/1)100% (3/3)100% (1/1)
getAutoReconnectForPools (): boolean 100% (1/1)100% (3/3)100% (1/1)
getBlobSendChunkSize (): int 100% (1/1)100% (4/4)100% (1/1)
getCacheCallableStatements (): boolean 100% (1/1)100% (4/4)100% (1/1)
getCachePreparedStatements (): boolean 100% (1/1)100% (6/6)100% (1/1)
getCacheResultSetMetadata (): boolean 100% (1/1)100% (3/3)100% (1/1)
getCacheServerConfiguration (): boolean 100% (1/1)100% (4/4)100% (1/1)
getCallableStatementCacheSize (): int 100% (1/1)100% (4/4)100% (1/1)
getCapitalizeTypeNames (): boolean 100% (1/1)100% (4/4)100% (1/1)
getCharacterSetResults (): String 100% (1/1)100% (4/4)100% (1/1)
getClobCharacterEncoding (): String 100% (1/1)100% (4/4)100% (1/1)
getClobberStreamingResults (): boolean 100% (1/1)100% (4/4)100% (1/1)
getConnectionCollation (): String 100% (1/1)100% (4/4)100% (1/1)
getContinueBatchOnError (): boolean 100% (1/1)100% (4/4)100% (1/1)
getCreateDatabaseIfNotExist (): boolean 100% (1/1)100% (4/4)100% (1/1)
getDefaultFetchSize (): int 100% (1/1)100% (4/4)100% (1/1)
getDontTrackOpenResources (): boolean 100% (1/1)100% (4/4)100% (1/1)
getDumpQueriesOnException (): boolean 100% (1/1)100% (4/4)100% (1/1)
getDynamicCalendars (): boolean 100% (1/1)100% (4/4)100% (1/1)
getElideSetAutoCommits (): boolean 100% (1/1)100% (4/4)100% (1/1)
getEmptyStringsConvertToZero (): boolean 100% (1/1)100% (4/4)100% (1/1)
getEmulateLocators (): boolean 100% (1/1)100% (4/4)100% (1/1)
getEmulateUnsupportedPstmts (): boolean 100% (1/1)100% (4/4)100% (1/1)
getEnablePacketDebug (): boolean 100% (1/1)100% (4/4)100% (1/1)
getEncoding (): String 100% (1/1)100% (3/3)100% (1/1)
getExplainSlowQueries (): boolean 100% (1/1)100% (4/4)100% (1/1)
getFailOverReadOnly (): boolean 100% (1/1)100% (4/4)100% (1/1)
getGatherPerformanceMetrics (): boolean 100% (1/1)100% (4/4)100% (1/1)
getHighAvailability (): boolean 100% (1/1)100% (3/3)100% (1/1)
getHoldResultsOpenOverStatementClose (): boolean 100% (1/1)100% (4/4)100% (1/1)
getIgnoreNonTxTables (): boolean 100% (1/1)100% (4/4)100% (1/1)
getInitialTimeout (): int 100% (1/1)100% (4/4)100% (1/1)
getInteractiveClient (): boolean 100% (1/1)100% (4/4)100% (1/1)
getJdbcCompliantTruncation (): boolean 100% (1/1)100% (4/4)100% (1/1)
getJdbcCompliantTruncationForReads (): boolean 100% (1/1)100% (3/3)100% (1/1)
getLogSlowQueries (): boolean 100% (1/1)100% (4/4)100% (1/1)
getLogger (): String 100% (1/1)100% (4/4)100% (1/1)
getMaintainTimeStats (): boolean 100% (1/1)100% (3/3)100% (1/1)
getMaxQuerySizeToLog (): int 100% (1/1)100% (4/4)100% (1/1)
getMaxReconnects (): int 100% (1/1)100% (4/4)100% (1/1)
getMaxRows (): int 100% (1/1)100% (3/3)100% (1/1)
getNoDatetimeStringSync (): boolean 100% (1/1)100% (4/4)100% (1/1)
getNoTimezoneConversionForTimeType (): boolean 100% (1/1)100% (4/4)100% (1/1)
getNullCatalogMeansCurrent (): boolean 100% (1/1)100% (4/4)100% (1/1)
getNullNamePatternMatchesAll (): boolean 100% (1/1)100% (4/4)100% (1/1)
getOverrideSupportsIntegrityEnhancementFacility (): boolean 100% (1/1)100% (4/4)100% (1/1)
getParanoid (): boolean 100% (1/1)100% (4/4)100% (1/1)
getPedantic (): boolean 100% (1/1)100% (4/4)100% (1/1)
getPinGlobalTxToPhysicalConnection (): boolean 100% (1/1)100% (4/4)100% (1/1)
getPreparedStatementCacheSize (): int 100% (1/1)100% (6/6)100% (1/1)
getPreparedStatementCacheSqlLimit (): int 100% (1/1)100% (6/6)100% (1/1)
getProcessEscapeCodesForPrepStmts (): boolean 100% (1/1)100% (4/4)100% (1/1)
getProfileSql (): boolean 100% (1/1)100% (3/3)100% (1/1)
getQueriesBeforeRetryMaster (): int 100% (1/1)100% (4/4)100% (1/1)
getReconnectAtTxEnd (): boolean 100% (1/1)100% (3/3)100% (1/1)
getReportMetricsIntervalMillis (): int 100% (1/1)100% (4/4)100% (1/1)
getRetainStatementAfterResultSetClose (): boolean 100% (1/1)100% (4/4)100% (1/1)
getRewriteBatchedStatements (): boolean 100% (1/1)100% (4/4)100% (1/1)
getRollbackOnPooledClose (): boolean 100% (1/1)100% (4/4)100% (1/1)
getRoundRobinLoadBalance (): boolean 100% (1/1)100% (4/4)100% (1/1)
getSecondsBeforeRetryMaster (): int 100% (1/1)100% (4/4)100% (1/1)
getServerTimezone (): String 100% (1/1)100% (4/4)100% (1/1)
getSessionVariables (): String 100% (1/1)100% (4/4)100% (1/1)
getSlowQueryThresholdMillis (): int 100% (1/1)100% (4/4)100% (1/1)
getSocketFactoryClassName (): String 100% (1/1)100% (4/4)100% (1/1)
getSocketTimeout (): int 100% (1/1)100% (4/4)100% (1/1)
getStrictFloatingPoint (): boolean 100% (1/1)100% (4/4)100% (1/1)
getStrictUpdates (): boolean 100% (1/1)100% (4/4)100% (1/1)
getTinyInt1isBit (): boolean 100% (1/1)100% (4/4)100% (1/1)
getTraceProtocol (): boolean 100% (1/1)100% (4/4)100% (1/1)
getTransformedBitIsBoolean (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseCompression (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseCursorFetch (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseFastIntParsing (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseGmtMillisForDatetimes (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseHostsInPrivileges (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseInformationSchema (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseJDBCCompliantTimezoneShift (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseJvmCharsetConverters (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseLocalSessionState (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseOldUTF8Behavior (): boolean 100% (1/1)100% (3/3)100% (1/1)
getUseOnlyServerErrorMessages (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseReadAheadInput (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseSSL (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseServerPreparedStmts (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseSqlStateCodes (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseStreamLengthsInPrepStmts (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseTimezone (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseUltraDevWorkAround (): boolean 100% (1/1)100% (4/4)100% (1/1)
getUseUnicode (): boolean 100% (1/1)100% (3/3)100% (1/1)
getUseUsageAdvisor (): boolean 100% (1/1)100% (3/3)100% (1/1)
getYearIsDateType (): boolean 100% (1/1)100% (4/4)100% (1/1)
getZeroDateTimeBehavior (): String 100% (1/1)100% (4/4)100% (1/1)
setAllowLoadLocalInfile (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setBlobSendChunkSize (String): void 100% (1/1)100% (5/5)100% (2/2)
setCharacterEncoding (String): void 100% (1/1)100% (5/5)100% (2/2)
setEncoding (String): void 100% (1/1)100% (10/10)100% (3/3)
setJdbcCompliantTruncation (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setLogger (String): void 100% (1/1)100% (5/5)100% (2/2)
setPinGlobalTxToPhysicalConnection (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setProfileSql (boolean): void 100% (1/1)100% (10/10)100% (3/3)
setRollbackOnPooledClose (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setTraceProtocol (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setTransformedBitIsBoolean (boolean): void 100% (1/1)100% (5/5)100% (2/2)
setUseUnicode (boolean): void 100% (1/1)100% (10/10)100% (3/3)
setZeroDateTimeBehavior (String): void 100% (1/1)100% (5/5)100% (2/2)
     
class ConnectionProperties$MemorySizeConnectionProperty100% (1/1)100% (3/3)70%  (89/127)55%  (11/20)
initializeFrom (String): void 100% (1/1)65%  (70/108)40%  (6/15)
ConnectionProperties$MemorySizeConnectionProperty (ConnectionProperties, Stri... 100% (1/1)100% (15/15)100% (3/3)
setValue (String): void 100% (1/1)100% (4/4)100% (2/2)
     
class ConnectionProperties$StringConnectionProperty100% (1/1)71%  (5/7)79%  (49/62)87%  (13/15)
hasValueConstraints (): boolean 0%   (0/1)0%   (0/11)0%   (0/1)
isRangeBased (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
ConnectionProperties$StringConnectionProperty (ConnectionProperties, String, ... 100% (1/1)100% (16/16)100% (3/3)
ConnectionProperties$StringConnectionProperty (ConnectionProperties, String, ... 100% (1/1)100% (11/11)100% (2/2)
getValueAsString (): String 100% (1/1)100% (4/4)100% (1/1)
initializeFrom (String): void 100% (1/1)100% (14/14)100% (5/5)
setValue (String): void 100% (1/1)100% (4/4)100% (2/2)
     
class ConnectionProperties$BooleanConnectionProperty100% (1/1)71%  (5/7)95%  (77/81)86%  (12/14)
hasValueConstraints (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
isRangeBased (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
ConnectionProperties$BooleanConnectionProperty (ConnectionProperties, String,... 100% (1/1)100% (19/19)100% (3/3)
getAllowableValues (): String [] 100% (1/1)100% (19/19)100% (1/1)
getValueAsBoolean (): boolean 100% (1/1)100% (5/5)100% (1/1)
initializeFrom (String): void 100% (1/1)100% (27/27)100% (5/5)
setValue (boolean): void 100% (1/1)100% (7/7)100% (2/2)
     
class ConnectionProperties$1100% (1/1)100% (1/1)100% (3/3)100% (1/1)
ConnectionProperties$1 (): void 100% (1/1)100% (3/3)100% (1/1)

1/*
2 Copyright (C) 2002-2004 MySQL AB
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of version 2 of the GNU General Public License as 
6 published by the Free Software Foundation.
7 
8 There are special exceptions to the terms and conditions of the GPL 
9 as it is applied to this software. View the full text of the 
10 exception in file EXCEPTIONS-CONNECTOR-J in the directory of this 
11 software distribution.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 
22 
23 
24 */
25package com.mysql.jdbc;
26 
27import com.mysql.jdbc.log.Jdk14Logger;
28import com.mysql.jdbc.log.Log;
29import com.mysql.jdbc.log.StandardLogger;
30 
31import java.io.Serializable;
32import java.io.UnsupportedEncodingException;
33 
34import java.sql.DriverPropertyInfo;
35import java.sql.SQLException;
36 
37import java.util.ArrayList;
38import java.util.HashMap;
39import java.util.Iterator;
40import java.util.Map;
41import java.util.Properties;
42import java.util.TreeMap;
43 
44import javax.naming.RefAddr;
45import javax.naming.Reference;
46import javax.naming.StringRefAddr;
47 
48/**
49 * Represents configurable properties for Connections and DataSources. Can also
50 * expose properties as JDBC DriverPropertyInfo if required as well.
51 * 
52 * @author Mark Matthews
53 * @version $Id: ConnectionProperties.java,v 1.1.2.2 2005/05/17 14:58:56
54 *          mmatthews Exp $
55 */
56public class ConnectionProperties implements Serializable {
57        
58        private static final long serialVersionUID = 4257801713007640580L;
59 
60        class BooleanConnectionProperty extends ConnectionProperty implements Serializable {
61        
62                private static final long serialVersionUID = 2540132501709159404L;
63 
64                /**
65                 * DOCUMENT ME!
66                 * 
67                 * @param propertyNameToSet
68                 * @param defaultValueToSet
69                 * @param descriptionToSet
70                 *            DOCUMENT ME!
71                 * @param sinceVersionToSet
72                 *            DOCUMENT ME!
73                 */
74                BooleanConnectionProperty(String propertyNameToSet,
75                                boolean defaultValueToSet, String descriptionToSet,
76                                String sinceVersionToSet, String category, int orderInCategory) {
77                        super(propertyNameToSet, new Boolean(defaultValueToSet), null, 0,
78                                        0, descriptionToSet, sinceVersionToSet, category,
79                                        orderInCategory);
80                }
81 
82                /**
83                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getAllowableValues()
84                 */
85                String[] getAllowableValues() {
86                        return new String[] { "true", "false", "yes", "no" };
87                }
88 
89                boolean getValueAsBoolean() {
90                        return ((Boolean) this.valueAsObject).booleanValue();
91                }
92 
93                /**
94                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
95                 */
96                boolean hasValueConstraints() {
97                        return true;
98                }
99 
100                /**
101                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.util.Properties)
102                 */
103                void initializeFrom(String extractedValue) throws SQLException {
104                        if (extractedValue != null) {
105                                validateStringValues(extractedValue);
106 
107                                this.valueAsObject = new Boolean(extractedValue
108                                                .equalsIgnoreCase("TRUE")
109                                                || extractedValue.equalsIgnoreCase("YES"));
110                        } else {
111                                this.valueAsObject = this.defaultValue;
112                        }
113                }
114 
115                /**
116                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
117                 */
118                boolean isRangeBased() {
119                        return false;
120                }
121 
122                void setValue(boolean valueFlag) {
123                        this.valueAsObject = new Boolean(valueFlag);
124                }
125        }
126 
127        abstract class ConnectionProperty implements Serializable {
128                String[] allowableValues;
129 
130                String categoryName;
131 
132                Object defaultValue;
133 
134                int lowerBound;
135 
136                int order;
137 
138                String propertyName;
139 
140                String sinceVersion;
141 
142                int upperBound;
143 
144                Object valueAsObject;
145 
146                boolean required;
147                
148                String description;
149                
150                public ConnectionProperty() {}
151                
152                ConnectionProperty(String propertyNameToSet, Object defaultValueToSet,
153                                String[] allowableValuesToSet, int lowerBoundToSet,
154                                int upperBoundToSet, String descriptionToSet,
155                                String sinceVersionToSet, String category, int orderInCategory) {
156                        
157                        this.description = descriptionToSet;
158                        this.propertyName = propertyNameToSet;
159                        this.defaultValue = defaultValueToSet;
160                        this.valueAsObject = defaultValueToSet;
161                        this.allowableValues = allowableValuesToSet;
162                        this.lowerBound = lowerBoundToSet;
163                        this.upperBound = upperBoundToSet;
164                        this.required = false;
165                        this.sinceVersion = sinceVersionToSet;
166                        this.categoryName = category;
167                        this.order = orderInCategory;
168                }
169 
170                String[] getAllowableValues() {
171                        return this.allowableValues;
172                }
173 
174                /**
175                 * @return Returns the categoryName.
176                 */
177                String getCategoryName() {
178                        return this.categoryName;
179                }
180 
181                Object getDefaultValue() {
182                        return this.defaultValue;
183                }
184 
185                int getLowerBound() {
186                        return this.lowerBound;
187                }
188 
189                /**
190                 * @return Returns the order.
191                 */
192                int getOrder() {
193                        return this.order;
194                }
195 
196                String getPropertyName() {
197                        return this.propertyName;
198                }
199 
200                int getUpperBound() {
201                        return this.upperBound;
202                }
203 
204                Object getValueAsObject() {
205                        return this.valueAsObject;
206                }
207 
208                abstract boolean hasValueConstraints();
209 
210                void initializeFrom(Properties extractFrom) throws SQLException {
211                        String extractedValue = extractFrom.getProperty(getPropertyName());
212                        extractFrom.remove(getPropertyName());
213                        initializeFrom(extractedValue);
214                }
215 
216                void initializeFrom(Reference ref) throws SQLException {
217                        RefAddr refAddr = ref.get(getPropertyName());
218 
219                        if (refAddr != null) {
220                                String refContentAsString = (String) refAddr.getContent();
221 
222                                initializeFrom(refContentAsString);
223                        }
224                }
225 
226                abstract void initializeFrom(String extractedValue) throws SQLException;
227 
228                abstract boolean isRangeBased();
229 
230                /**
231                 * @param categoryName
232                 *            The categoryName to set.
233                 */
234                void setCategoryName(String categoryName) {
235                        this.categoryName = categoryName;
236                }
237 
238                /**
239                 * @param order
240                 *            The order to set.
241                 */
242                void setOrder(int order) {
243                        this.order = order;
244                }
245 
246                void setValueAsObject(Object obj) {
247                        this.valueAsObject = obj;
248                }
249 
250                void storeTo(Reference ref) {
251                        if (getValueAsObject() != null) {
252                                ref.add(new StringRefAddr(getPropertyName(), getValueAsObject()
253                                                .toString()));
254                        }
255                }
256 
257                DriverPropertyInfo getAsDriverPropertyInfo() {
258                        DriverPropertyInfo dpi = new DriverPropertyInfo(this.propertyName, null);
259                        dpi.choices = getAllowableValues();
260                        dpi.value = (this.valueAsObject != null) ? this.valueAsObject.toString() : null;
261                        dpi.required = this.required;
262                        dpi.description = this.description;
263                        
264                        return dpi;
265                }
266                
267 
268                void validateStringValues(String valueToValidate) throws SQLException {
269                        String[] validateAgainst = getAllowableValues();
270 
271                        if (valueToValidate == null) {
272                                return;
273                        }
274 
275                        if ((validateAgainst == null) || (validateAgainst.length == 0)) {
276                                return;
277                        }
278 
279                        for (int i = 0; i < validateAgainst.length; i++) {
280                                if ((validateAgainst[i] != null)
281                                                && validateAgainst[i].equalsIgnoreCase(valueToValidate)) {
282                                        return;
283                                }
284                        }
285 
286                        StringBuffer errorMessageBuf = new StringBuffer();
287 
288                        errorMessageBuf.append("The connection property '");
289                        errorMessageBuf.append(getPropertyName());
290                        errorMessageBuf.append("' only accepts values of the form: ");
291 
292                        if (validateAgainst.length != 0) {
293                                errorMessageBuf.append("'");
294                                errorMessageBuf.append(validateAgainst[0]);
295                                errorMessageBuf.append("'");
296 
297                                for (int i = 1; i < (validateAgainst.length - 1); i++) {
298                                        errorMessageBuf.append(", ");
299                                        errorMessageBuf.append("'");
300                                        errorMessageBuf.append(validateAgainst[i]);
301                                        errorMessageBuf.append("'");
302                                }
303 
304                                errorMessageBuf.append(" or '");
305                                errorMessageBuf
306                                                .append(validateAgainst[validateAgainst.length - 1]);
307                                errorMessageBuf.append("'");
308                        }
309 
310                        errorMessageBuf.append(". The value '");
311                        errorMessageBuf.append(valueToValidate);
312                        errorMessageBuf.append("' is not in this set.");
313 
314                        throw SQLError.createSQLException(errorMessageBuf.toString(),
315                                        SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
316                }
317        }
318 
319        class IntegerConnectionProperty extends ConnectionProperty implements Serializable {
320        
321                private static final long serialVersionUID = -8147538210820248187L;
322                
323                int multiplier = 1;
324 
325                IntegerConnectionProperty(String propertyNameToSet,
326                                int defaultValueToSet, int lowerBoundToSet,
327                                int upperBoundToSet, String descriptionToSet,
328                                String sinceVersionToSet, String category, int orderInCategory) {
329                        super(propertyNameToSet, new Integer(defaultValueToSet), null,
330                                        lowerBoundToSet, upperBoundToSet, descriptionToSet,
331                                        sinceVersionToSet, category, orderInCategory);
332                }
333 
334                /**
335                 * DOCUMENT ME!
336                 * 
337                 * @param propertyNameToSet
338                 * @param defaultValueToSet
339                 * @param descriptionToSet
340                 * @param sinceVersionToSet
341                 *            DOCUMENT ME!
342                 */
343 
344                IntegerConnectionProperty(String propertyNameToSet,
345                                int defaultValueToSet, String descriptionToSet,
346                                String sinceVersionToSet, String category, int orderInCategory) {
347                        this(propertyNameToSet, defaultValueToSet, 0, 0, descriptionToSet,
348                                        sinceVersionToSet, category, orderInCategory);
349                }
350 
351                /**
352                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getAllowableValues()
353                 */
354                String[] getAllowableValues() {
355                        return null;
356                }
357 
358                /**
359                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getLowerBound()
360                 */
361                int getLowerBound() {
362                        return this.lowerBound;
363                }
364 
365                /**
366                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getUpperBound()
367                 */
368                int getUpperBound() {
369                        return this.upperBound;
370                }
371 
372                int getValueAsInt() {
373                        return ((Integer) this.valueAsObject).intValue();
374                }
375 
376                /**
377                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
378                 */
379                boolean hasValueConstraints() {
380                        return false;
381                }
382 
383                /**
384                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.lang.String)
385                 */
386                void initializeFrom(String extractedValue) throws SQLException {
387                        if (extractedValue != null) {
388                                try {
389                                        // Parse decimals, too
390                                        int intValue = Double.valueOf(extractedValue).intValue();
391 
392                                        /*
393                                         * if (isRangeBased()) { if ((intValue < getLowerBound()) ||
394                                         * (intValue > getUpperBound())) { throw new
395                                         * SQLException("The connection property '" +
396                                         * getPropertyName() + "' only accepts integer values in the
397                                         * range of " + getLowerBound() + " - " + getUpperBound() + ",
398                                         * the value '" + extractedValue + "' exceeds this range.",
399                                         * SQLError.SQL_STATE_ILLEGAL_ARGUMENT); } }
400                                         */
401                                        this.valueAsObject = new Integer(intValue * multiplier);
402                                } catch (NumberFormatException nfe) {
403                                        throw SQLError.createSQLException("The connection property '"
404                                                        + getPropertyName()
405                                                        + "' only accepts integer values. The value '"
406                                                        + extractedValue
407                                                        + "' can not be converted to an integer.",
408                                                        SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
409                                }
410                        } else {
411                                this.valueAsObject = this.defaultValue;
412                        }
413                }
414 
415                /**
416                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
417                 */
418                boolean isRangeBased() {
419                        return getUpperBound() != getLowerBound();
420                }
421 
422                void setValue(int valueFlag) {
423                        this.valueAsObject = new Integer(valueFlag);
424                }
425        }
426 
427        class MemorySizeConnectionProperty extends IntegerConnectionProperty implements Serializable {
428 
429                private static final long serialVersionUID = 7351065128998572656L;
430 
431                MemorySizeConnectionProperty(String propertyNameToSet,
432                                int defaultValueToSet, int lowerBoundToSet,
433                                int upperBoundToSet, String descriptionToSet,
434                                String sinceVersionToSet, String category, int orderInCategory) {
435                        super(propertyNameToSet, defaultValueToSet, lowerBoundToSet,
436                                        upperBoundToSet, descriptionToSet, sinceVersionToSet,
437                                        category, orderInCategory);
438                        // TODO Auto-generated constructor stub
439                }
440 
441                void initializeFrom(String extractedValue) throws SQLException {
442                        if (extractedValue != null) {
443                                if (extractedValue.endsWith("k")
444                                                || extractedValue.endsWith("K")
445                                                || extractedValue.endsWith("kb")
446                                                || extractedValue.endsWith("Kb")
447                                                || extractedValue.endsWith("kB")) {
448                                        multiplier = 1024;
449                                        int indexOfK = StringUtils.indexOfIgnoreCase(
450                                                        extractedValue, "k");
451                                        extractedValue = extractedValue.substring(0, indexOfK);
452                                } else if (extractedValue.endsWith("m")
453                                                || extractedValue.endsWith("M")
454                                                || extractedValue.endsWith("G")
455                                                || extractedValue.endsWith("mb")
456                                                || extractedValue.endsWith("Mb")
457                                                || extractedValue.endsWith("mB")) {
458                                        multiplier = 1024 * 1024;
459                                        int indexOfM = StringUtils.indexOfIgnoreCase(
460                                                        extractedValue, "m");
461                                        extractedValue = extractedValue.substring(0, indexOfM);
462                                } else if (extractedValue.endsWith("g")
463                                                || extractedValue.endsWith("G")
464                                                || extractedValue.endsWith("gb")
465                                                || extractedValue.endsWith("Gb")
466                                                || extractedValue.endsWith("gB")) {
467                                        multiplier = 1024 * 1024 * 1024;
468                                        int indexOfG = StringUtils.indexOfIgnoreCase(
469                                                        extractedValue, "g");
470                                        extractedValue = extractedValue.substring(0, indexOfG);
471                                }
472                        }
473 
474                        super.initializeFrom(extractedValue);
475                }
476 
477                void setValue(String value) throws SQLException {
478                        initializeFrom(value);
479                }
480        }
481 
482        class StringConnectionProperty extends ConnectionProperty implements Serializable {
483        
484                private static final long serialVersionUID = 5432127962785948272L;
485 
486                StringConnectionProperty(String propertyNameToSet,
487                                String defaultValueToSet, String descriptionToSet,
488                                String sinceVersionToSet, String category, int orderInCategory) {
489                        this(propertyNameToSet, defaultValueToSet, null, descriptionToSet,
490                                        sinceVersionToSet, category, orderInCategory);
491                }
492 
493                /**
494                 * DOCUMENT ME!
495                 * 
496                 * @param propertyNameToSet
497                 * @param defaultValueToSet
498                 * @param allowableValuesToSet
499                 * @param descriptionToSet
500                 * @param sinceVersionToSet
501                 *            DOCUMENT ME!
502                 */
503                StringConnectionProperty(String propertyNameToSet,
504                                String defaultValueToSet, String[] allowableValuesToSet,
505                                String descriptionToSet, String sinceVersionToSet,
506                                String category, int orderInCategory) {
507                        super(propertyNameToSet, defaultValueToSet, allowableValuesToSet,
508                                        0, 0, descriptionToSet, sinceVersionToSet, category,
509                                        orderInCategory);
510                }
511 
512                String getValueAsString() {
513                        return (String) this.valueAsObject;
514                }
515 
516                /**
517                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
518                 */
519                boolean hasValueConstraints() {
520                        return (this.allowableValues != null)
521                                        && (this.allowableValues.length > 0);
522                }
523 
524                /**
525                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.util.Properties)
526                 */
527                void initializeFrom(String extractedValue) throws SQLException {
528                        if (extractedValue != null) {
529                                validateStringValues(extractedValue);
530 
531                                this.valueAsObject = extractedValue;
532                        } else {
533                                this.valueAsObject = this.defaultValue;
534                        }
535                }
536 
537                /**
538                 * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
539                 */
540                boolean isRangeBased() {
541                        return false;
542                }
543 
544                void setValue(String valueFlag) {
545                        this.valueAsObject = valueFlag;
546                }
547        }
548 
549        private static final String CONNECTION_AND_AUTH_CATEGORY = "Connection/Authentication";
550 
551        private static final String DEBUGING_PROFILING_CATEGORY = "Debuging/Profiling";
552 
553        private static final String HA_CATEGORY = "High Availability and Clustering";
554 
555        private static final String MISC_CATEGORY = "Miscellaneous";
556 
557        private static final String PERFORMANCE_CATEGORY = "Performance Extensions";
558        
559        private static final String SECURITY_CATEGORY = "Security";
560        
561        private static final String[] PROPERTY_CATEGORIES = new String[] {
562                CONNECTION_AND_AUTH_CATEGORY, HA_CATEGORY, SECURITY_CATEGORY,
563                PERFORMANCE_CATEGORY, DEBUGING_PROFILING_CATEGORY, MISC_CATEGORY };
564 
565        private static final ArrayList PROPERTY_LIST = new ArrayList();
566 
567        //
568        // Yes, this looks goofy, but we're trying to avoid intern()ing here
569        //
570        private static final String STANDARD_LOGGER_NAME = new String(StandardLogger.class
571                        .getName().getBytes());
572 
573        protected static final String ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL = "convertToNull";
574 
575        protected static final String ZERO_DATETIME_BEHAVIOR_EXCEPTION = "exception";
576 
577        protected static final String ZERO_DATETIME_BEHAVIOR_ROUND = "round";
578 
579        static {
580                try {
581                        java.lang.reflect.Field[] declaredFields = ConnectionProperties.class
582                                        .getDeclaredFields();
583 
584                        for (int i = 0; i < declaredFields.length; i++) {
585                                if (ConnectionProperties.ConnectionProperty.class
586                                                .isAssignableFrom(declaredFields[i].getType())) {
587                                        PROPERTY_LIST.add(declaredFields[i]);
588                                }
589                        }
590                } catch (Exception ex) {
591                        throw new RuntimeException(ex.toString());
592                }
593        }
594 
595        /**
596         * Exposes all ConnectionPropertyInfo instances as DriverPropertyInfo
597         * 
598         * @param info
599         *            the properties to load into these ConnectionPropertyInfo
600         *            instances
601         * @param slotsToReserve
602         *            the number of DPI slots to reserve for 'standard' DPI
603         *            properties (user, host, password, etc)
604         * @return a list of all ConnectionPropertyInfo instances, as
605         *         DriverPropertyInfo
606         * @throws SQLException
607         *             if an error occurs
608         */
609        protected static DriverPropertyInfo[] exposeAsDriverPropertyInfo(
610                        Properties info, int slotsToReserve) throws SQLException {
611                return (new ConnectionProperties() {
612                }).exposeAsDriverPropertyInfoInternal(info, slotsToReserve);
613        }
614 
615        private BooleanConnectionProperty allowLoadLocalInfile = new BooleanConnectionProperty(
616                        "allowLoadLocalInfile",
617                        true,
618                        "Should the driver allow use of 'LOAD DATA LOCAL INFILE...' (defaults to 'true').",
619                        "3.0.3", SECURITY_CATEGORY, Integer.MAX_VALUE);
620 
621        private BooleanConnectionProperty allowMultiQueries = new BooleanConnectionProperty(
622                        "allowMultiQueries",
623                        false,
624                        "Allow the use of ';' to delimit multiple queries during one statement (true/false, defaults to 'false'",
625                        "3.1.1", SECURITY_CATEGORY, 1);
626 
627        private BooleanConnectionProperty allowNanAndInf = new BooleanConnectionProperty(
628                        "allowNanAndInf",
629                        false,
630                        "Should the driver allow NaN or +/- INF values in PreparedStatement.setDouble()?",
631                        "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE);
632 
633        private BooleanConnectionProperty allowUrlInLocalInfile = new BooleanConnectionProperty(
634                        "allowUrlInLocalInfile",
635                        false,
636                        "Should the driver allow URLs in 'LOAD DATA LOCAL INFILE' statements?",
637                        "3.1.4", SECURITY_CATEGORY, Integer.MAX_VALUE);
638 
639        private BooleanConnectionProperty alwaysSendSetIsolation = new BooleanConnectionProperty(
640                        "alwaysSendSetIsolation",
641                        true,
642                        "Should the driver always communicate with the database when "
643                                        + " Connection.setTransactionIsolation() is called? "
644                                        + "If set to false, the driver will only communicate with the "
645                                        + "database when the requested transaction isolation is different "
646                                        + "than the whichever is newer, the last value that was set via "
647                                        + "Connection.setTransactionIsolation(), or the value that was read from "
648                                        + "the server when the connection was established.",
649                        "3.1.7", PERFORMANCE_CATEGORY, Integer.MAX_VALUE);
650 
651        private BooleanConnectionProperty autoClosePStmtStreams = new BooleanConnectionProperty(
652                        "autoClosePStmtStreams", 
653                        false,
654                        "Should the driver automatically call .close() on streams/readers passed as "
655                        + "arguments via set*() methods?",
656                        "3.1.12",
657                        MISC_CATEGORY,
658                        Integer.MIN_VALUE);
659        
660        private BooleanConnectionProperty autoDeserialize = new BooleanConnectionProperty(
661                        "autoDeserialize",
662                        false,
663                        "Should the driver automatically detect and de-serialize objects stored in BLOB fields?",
664                        "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE);
665 
666        private BooleanConnectionProperty autoGenerateTestcaseScript = new BooleanConnectionProperty(
667                        "autoGenerateTestcaseScript", false,
668                        "Should the driver dump the SQL it is executing, including server-side "
669                                        + "prepared statements to STDERR?", "3.1.9",
670                        DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
671 
672        private boolean autoGenerateTestcaseScriptAsBoolean = false;
673 
674        private BooleanConnectionProperty autoReconnect = new BooleanConnectionProperty(
675                        "autoReconnect",
676                        false,
677                        "Should the driver try to re-establish stale and/or dead connections? "
678                                        + "  If enabled the driver will throw an exception for a queries issued on a stale or dead connection, "
679                                        + " which belong to the current transaction, but will attempt reconnect before the next query issued on the "
680                                        + "connection in a new transaction. The use of this feature "
681                                        + "is not recommended, because it has side effects related to session state and data consistency when applications don't"
682                                        + "handle SQLExceptions properly, and is only designed to be used "
683                                        + "when you are unable to configure your application to handle SQLExceptions resulting from dead and"
684                                        + "stale connections properly. Alternatively, investigate setting the MySQL server variable \"wait_timeout\""
685                                        + "to some high value rather than the default of 8 hours.",
686                        "1.1", HA_CATEGORY, 0);
687 
688        private BooleanConnectionProperty autoReconnectForPools = new BooleanConnectionProperty(
689                        "autoReconnectForPools",
690                        false,
691                        "Use a reconnection strategy appropriate for connection pools (defaults to 'false')",
692                        "3.1.3", HA_CATEGORY, 1);
693 
694        private boolean autoReconnectForPoolsAsBoolean = false;
695 
696        private MemorySizeConnectionProperty blobSendChunkSize = new MemorySizeConnectionProperty(
697                        "blobSendChunkSize",
698                        1024 * 1024,
699                        1,
700                        Integer.MAX_VALUE,
701                        "Chunk to use when sending BLOB/CLOBs via ServerPreparedStatements",
702                        "3.1.9", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
703 
704        private BooleanConnectionProperty cacheCallableStatements = new BooleanConnectionProperty(
705                        "cacheCallableStmts", false,
706                        "Should the driver cache the parsing stage of CallableStatements",
707                        "3.1.2", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
708 
709        private BooleanConnectionProperty cachePreparedStatements = new BooleanConnectionProperty(
710                        "cachePrepStmts",
711                        false,
712                        "Should the driver cache the parsing stage of PreparedStatements of client-side "
713                                        + "prepared statements, the \"check\" for suitability of server-side prepared "
714                                        + " and server-side prepared statements themselves?",
715                        "3.0.10", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
716 
717        private BooleanConnectionProperty cacheResultSetMetadata = new BooleanConnectionProperty(
718                        "cacheResultSetMetadata",
719                        false,
720                        "Should the driver cache ResultSetMetaData for Statements and PreparedStatements? (Req. JDK-1.4+, true/false, default 'false')",
721                        "3.1.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
722 
723        private boolean cacheResultSetMetaDataAsBoolean;
724 
725        private BooleanConnectionProperty cacheServerConfiguration = new BooleanConnectionProperty(
726                        "cacheServerConfiguration",
727                        false,
728                        "Should the driver cache the results of "
729                                        + "'SHOW VARIABLES' and 'SHOW COLLATION' on a per-URL basis?",
730                        "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
731 
732        private IntegerConnectionProperty callableStatementCacheSize = new IntegerConnectionProperty(
733                        "callableStmtCacheSize",
734                        100,
735                        0,
736                        Integer.MAX_VALUE,
737                        "If 'cacheCallableStmts' is enabled, how many callable statements should be cached?",
738                        "3.1.2", PERFORMANCE_CATEGORY, 5);
739 
740        private BooleanConnectionProperty capitalizeTypeNames = new BooleanConnectionProperty(
741                        "capitalizeTypeNames",
742                        false,
743                        "Capitalize type names in DatabaseMetaData? (usually only useful when using WebObjects, true/false, defaults to 'false')",
744                        "2.0.7", MISC_CATEGORY, Integer.MIN_VALUE);
745 
746        private StringConnectionProperty characterEncoding = new StringConnectionProperty(
747                        "characterEncoding",
748                        null,
749                        "If 'useUnicode' is set to true, what character encoding should the driver use when dealing with strings? (defaults is to 'autodetect')",
750                        "1.1g", MISC_CATEGORY, 5);
751 
752        private String characterEncodingAsString = null;
753 
754        private StringConnectionProperty characterSetResults = new StringConnectionProperty(
755                        "characterSetResults", null,
756                        "Character set to tell the server to return results as.", "3.0.13",
757                        MISC_CATEGORY, 6);
758 
759        private BooleanConnectionProperty clobberStreamingResults = new BooleanConnectionProperty(
760                        "clobberStreamingResults",
761                        false,
762                        "This will cause a 'streaming' ResultSet to be automatically closed, "
763                                        + "and any outstanding data still streaming from the server to be discarded if another query is executed "
764                                        + "before all the data has been read from the server.",
765                        "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE);
766        
767        private StringConnectionProperty clobCharacterEncoding = new StringConnectionProperty(
768                        "clobCharacterEncoding",
769                        null,
770                        "The character encoding to use for sending and retrieving TEXT, MEDIUMTEXT " +
771                        "and LONGTEXT values instead of the configured connection characterEncoding",
772                        "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE);
773 
774        private StringConnectionProperty connectionCollation = new StringConnectionProperty(
775                        "connectionCollation",
776                        null,
777                        "If set, tells the server to use this collation via 'set collation_connection'",
778                        "3.0.13", MISC_CATEGORY, 7);
779 
780        private IntegerConnectionProperty connectTimeout = new IntegerConnectionProperty(
781                        "connectTimeout", 0, 0, Integer.MAX_VALUE,
782                        "Timeout for socket connect (in milliseconds), with 0 being no timeout. "
783                                        + "Only works on JDK-1.4 or newer. Defaults to '0'.",
784                        "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 9);
785 
786        private BooleanConnectionProperty continueBatchOnError = new BooleanConnectionProperty(
787                        "continueBatchOnError",
788                        true,
789                        "Should the driver continue processing batch commands if "
790                                        + "one statement fails. The JDBC spec allows either way (defaults to 'true').",
791                        "3.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
792 
793        private BooleanConnectionProperty createDatabaseIfNotExist = new BooleanConnectionProperty(
794                        "createDatabaseIfNotExist",
795                        false,
796                        "Creates the database given in the URL if it doesn't yet exist. Assumes "
797                                        + " the configured user has permissions to create databases.",
798                        "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
799 
800        private IntegerConnectionProperty defaultFetchSize = new IntegerConnectionProperty("defaultFetchSize", 0, "The driver will call setFetchSize(n) with this value on all newly-created Statements", "3.1.9", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
801 
802        private BooleanConnectionProperty detectServerPreparedStmts = new BooleanConnectionProperty(
803                        "useServerPrepStmts",
804                        true,
805                        "Use server-side prepared statements if the server supports them? (defaults to 'true').",
806                        "3.1.0", MISC_CATEGORY, Integer.MIN_VALUE);
807 
808        private BooleanConnectionProperty dontTrackOpenResources = new BooleanConnectionProperty(
809                        "dontTrackOpenResources",
810                        false,
811                        "The JDBC specification requires the driver to automatically track and close resources, "
812                                        + "however if your application doesn't do a good job of "
813                                        + "explicitly calling close() on statements or result sets, "
814                                        + "this can cause memory leakage. Setting this property to true "
815                                        + "relaxes this constraint, and can be more memory efficient for "
816                                        + "some applications.", "3.1.7", PERFORMANCE_CATEGORY,
817                        Integer.MIN_VALUE);
818 
819        private BooleanConnectionProperty dumpQueriesOnException = new BooleanConnectionProperty(
820                        "dumpQueriesOnException",
821                        false,
822                        "Should the driver dump the contents of the query sent to the server in the message for SQLExceptions?",
823                        "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
824 
825        private BooleanConnectionProperty dynamicCalendars = new BooleanConnectionProperty(
826                        "dynamicCalendars",
827                        false,
828                        "Should the driver retrieve the default"
829                                        + " calendar when required, or cache it per connection/session?",
830                        "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
831 
832        private BooleanConnectionProperty elideSetAutoCommits = new BooleanConnectionProperty(
833                        "elideSetAutoCommits",
834                        false,
835                        "If using MySQL-4.1 or newer, should the driver only issue 'set autocommit=n' queries when the server's state doesn't match the requested state by Connection.setAutoCommit(boolean)?",
836                        "3.1.3", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
837 
838        private BooleanConnectionProperty emptyStringsConvertToZero = new BooleanConnectionProperty(
839                        "emptyStringsConvertToZero", true,
840                        "Should the driver allow conversions from empty string "
841                                        + "fields to numeric values of '0'?", "3.1.8",
842                        MISC_CATEGORY, Integer.MIN_VALUE);
843 
844        private BooleanConnectionProperty emulateLocators = new BooleanConnectionProperty(
845                        "emulateLocators", false, "N/A", "3.1.0", MISC_CATEGORY,
846                        Integer.MIN_VALUE);
847 
848        private BooleanConnectionProperty emulateUnsupportedPstmts = new BooleanConnectionProperty(
849                        "emulateUnsupportedPstmts",
850                        true,
851                        "Should the driver detect prepared statements that are not supported by the server, and "
852                                        + "replace them with client-side emulated versions?",
853                        "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
854 
855        private BooleanConnectionProperty enableDeprecatedAutoreconnect = new BooleanConnectionProperty(
856                        "enableDeprecatedAutoreconnect",
857                        false,
858                        "Auto-reconnect functionality is deprecated starting with version 3.2, and will be removed in version 3.3. Set this "
859                                        + "property to 'true' to disable the check for the feature being configured.",
860                        "3.2.1", HA_CATEGORY, Integer.MIN_VALUE);
861 
862        private BooleanConnectionProperty enablePacketDebug = new BooleanConnectionProperty(
863                        "enablePacketDebug",
864                        false,
865                        "When enabled, a ring-buffer of 'packetDebugBufferSize' packets will be kept, and dumped when exceptions are thrown in key areas in the driver's code",
866                        "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
867 
868        private BooleanConnectionProperty explainSlowQueries = new BooleanConnectionProperty(
869                        "explainSlowQueries",
870                        false,
871                        "If 'logSlowQueries' is enabled, should the driver automatically issue an 'EXPLAIN' on the"
872                                        + " server and send the results to the configured log at a WARN level?",
873                        "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
874 
875        /** When failed-over, set connection to read-only? */
876        private BooleanConnectionProperty failOverReadOnly = new BooleanConnectionProperty(
877                        "failOverReadOnly",
878                        true,
879                        "When failing over in autoReconnect mode, should the connection be set to 'read-only'?",
880                        "3.0.12", HA_CATEGORY, 2);
881 
882        private BooleanConnectionProperty gatherPerformanceMetrics = new BooleanConnectionProperty(
883                        "gatherPerfMetrics",
884                        false,
885                        "Should the driver gather performance metrics, and report them via the configured logger every 'reportMetricsIntervalMillis' milliseconds?",
886                        "3.1.2", DEBUGING_PROFILING_CATEGORY, 1);
887 
888        private boolean highAvailabilityAsBoolean = false;
889 
890        private BooleanConnectionProperty holdResultsOpenOverStatementClose = new BooleanConnectionProperty(
891                        "holdResultsOpenOverStatementClose",
892                        false,
893                        "Should the driver close result sets on Statement.close() as required by the JDBC specification?",
894                        "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
895 
896        private BooleanConnectionProperty ignoreNonTxTables = new BooleanConnectionProperty(
897                        "ignoreNonTxTables",
898                        false,
899                        "Ignore non-transactional table warning for rollback? (defaults to 'false').",
900                        "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE);
901 
902        private IntegerConnectionProperty initialTimeout = new IntegerConnectionProperty(
903                        "initialTimeout", 2, 1, Integer.MAX_VALUE,
904                        "If autoReconnect is enabled, the"
905                                        + " initial time to wait between"
906                                        + " re-connect attempts (in seconds, defaults to '2').",
907                        "1.1", HA_CATEGORY, 5);
908 
909        private BooleanConnectionProperty isInteractiveClient = new BooleanConnectionProperty(
910                        "interactiveClient",
911                        false,
912                        "Set the CLIENT_INTERACTIVE flag, which tells MySQL "
913                                        + "to timeout connections based on INTERACTIVE_TIMEOUT instead of WAIT_TIMEOUT",
914                        "3.1.0", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
915 
916        private BooleanConnectionProperty jdbcCompliantTruncation = new BooleanConnectionProperty(
917                        "jdbcCompliantTruncation",
918                        true,
919                        "Should the driver throw java.sql.DataTruncation"
920                                        + " exceptions when data is truncated as is required by the JDBC specification when connected to a server that supports warnings"
921                                        + "(MySQL 4.1.0 and newer)?", "3.1.2", MISC_CATEGORY,
922                        Integer.MIN_VALUE);
923 
924        private boolean jdbcCompliantTruncationForReads = 
925                this.jdbcCompliantTruncation.getValueAsBoolean();
926        
927        private MemorySizeConnectionProperty locatorFetchBufferSize = new MemorySizeConnectionProperty(
928                        "locatorFetchBufferSize",
929                        1024 * 1024,
930                        0,
931                        Integer.MAX_VALUE,
932                        "If 'emulateLocators' is configured to 'true', what size "
933                                        + " buffer should be used when fetching BLOB data for getBinaryInputStream?",
934                        "3.2.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
935 
936        private StringConnectionProperty loggerClassName = new StringConnectionProperty(
937                        "logger", STANDARD_LOGGER_NAME,
938                        "The name of a class that implements '" + Log.class.getName()
939                                        + "' that will be used to log messages to."
940                                        + "(default is '" + STANDARD_LOGGER_NAME + "', which "
941                                        + "logs to STDERR)", "3.1.1", DEBUGING_PROFILING_CATEGORY,
942                        0);
943 
944        private BooleanConnectionProperty logSlowQueries = new BooleanConnectionProperty(
945                        "logSlowQueries",
946                        false,
947                        "Should queries that take longer than 'slowQueryThresholdMillis' be logged?",
948                        "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
949 
950        private BooleanConnectionProperty maintainTimeStats = new BooleanConnectionProperty(
951                        "maintainTimeStats",
952                        true,
953                        "Should the driver maintain various internal timers to enable "
954                                        + "idle time calculations as well as more verbose error messages when "
955                                        + "the connection to the server fails? Setting this property to "
956                                        + "false removes at least two calls to System.getCurrentTimeMillis() "
957                                        + "per query.", "3.1.9", PERFORMANCE_CATEGORY,
958                        Integer.MAX_VALUE);
959 
960        private boolean maintainTimeStatsAsBoolean = true;
961 
962        private IntegerConnectionProperty maxQuerySizeToLog = new IntegerConnectionProperty(
963                        "maxQuerySizeToLog",
964                        2048,
965                        0,
966                        Integer.MAX_VALUE,
967                        "Controls the maximum length/size of a query that will get logged when profiling or tracing",
968                        "3.1.3", DEBUGING_PROFILING_CATEGORY, 4);
969 
970        private IntegerConnectionProperty maxReconnects = new IntegerConnectionProperty(
971                        "maxReconnects",
972                        3,
973                        1,
974                        Integer.MAX_VALUE,
975                        "Maximum number of reconnects to attempt if autoReconnect is true, default is '3'.",
976                        "1.1", HA_CATEGORY, 4);
977 
978        private IntegerConnectionProperty maxRows = new IntegerConnectionProperty(
979                        "maxRows", -1, -1, Integer.MAX_VALUE,
980                        "The maximum number of rows to return "
981                                        + " (0, the default means return all rows).",
982                        "all versions", MISC_CATEGORY, Integer.MIN_VALUE);
983 
984        private int maxRowsAsInt = -1;
985 
986        private IntegerConnectionProperty metadataCacheSize = new IntegerConnectionProperty(
987                        "metadataCacheSize",
988                        50,
989                        1,
990                        Integer.MAX_VALUE,
991                        "The number of queries to cache"
992                                        + "ResultSetMetadata for if cacheResultSetMetaData is set to 'true' (default 50)",
993                        "3.1.1", PERFORMANCE_CATEGORY, 5);
994 
995        private BooleanConnectionProperty noAccessToProcedureBodies = new BooleanConnectionProperty(
996                        "noAccessToProcedureBodies",
997                        false,
998                        "When determining procedure parameter types for CallableStatements, and the connected user "
999                        + " can't access procedure bodies through \"SHOW CREATE PROCEDURE\" or select on mysql.proc "
1000                        + " should the driver instead create basic metadata (all parameters reported as INOUT VARCHARs) instead "
1001                        + " of throwing an exception?",
1002                        "5.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
1003                        
1004        private BooleanConnectionProperty noDatetimeStringSync = new BooleanConnectionProperty(
1005                        "noDatetimeStringSync",
1006                        false,
1007                        "Don't ensure that ResultSet.getDatetimeType().toString().equals(ResultSet.getString())",
1008                        "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
1009        
1010        private BooleanConnectionProperty noTimezoneConversionForTimeType = new BooleanConnectionProperty(
1011                        "noTimezoneConversionForTimeType",
1012                        false,
1013                        "Don't convert TIME values using the server timezone if 'useTimezone'='true'",
1014                        "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE);
1015 
1016        private BooleanConnectionProperty nullCatalogMeansCurrent = new BooleanConnectionProperty(
1017                        "nullCatalogMeansCurrent",
1018                        true,
1019                        "When DatabaseMetadataMethods ask for a 'catalog' parameter, does the value null mean use the current catalog? "
1020                                        + "(this is not JDBC-compliant, but follows legacy behavior from earlier versions of the driver)",
1021                        "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
1022 
1023        private BooleanConnectionProperty nullNamePatternMatchesAll = new BooleanConnectionProperty(
1024                        "nullNamePatternMatchesAll",
1025                        true,
1026                        "Should DatabaseMetaData methods that accept *pattern parameters treat null the same as '%' "
1027                                        + " (this is not JDBC-compliant, however older versions of the driver accepted this departure from the specification)",
1028                        "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
1029 
1030        private IntegerConnectionProperty packetDebugBufferSize = new IntegerConnectionProperty(
1031                        "packetDebugBufferSize",
1032                        20,
1033                        0,
1034                        Integer.MAX_VALUE,
1035                        "The maximum number of packets to retain when 'enablePacketDebug' is true",
1036                        "3.1.3", DEBUGING_PROFILING_CATEGORY, 7);
1037 
1038        private BooleanConnectionProperty paranoid = new BooleanConnectionProperty(
1039                        "paranoid",
1040                        false,
1041                        "Take measures to prevent exposure sensitive information in error messages and clear "
1042                                        + "data structures holding sensitive data when possible? (defaults to 'false')",
1043                        "3.0.1", SECURITY_CATEGORY, Integer.MIN_VALUE);
1044 
1045        private BooleanConnectionProperty pedantic = new BooleanConnectionProperty(
1046                        "pedantic", false, "Follow the JDBC spec to the letter.", "3.0.0",
1047                        MISC_CATEGORY, Integer.MIN_VALUE);
1048 
1049        private BooleanConnectionProperty pinGlobalTxToPhysicalConnection = new BooleanConnectionProperty(
1050                        "pinGlobalTxToPhysicalConnection", false, "When using XAConnections, should the driver ensure that "
1051                        + " operations on a given XID are always routed to the same physical connection? This allows the XAConnection"
1052                        + " to support \"XA START ... JOIN\" after \"XA END\" has been called",
1053                        "5.0.1", MISC_CATEGORY, Integer.MIN_VALUE);
1054        
1055        private IntegerConnectionProperty preparedStatementCacheSize = new IntegerConnectionProperty(
1056                        "prepStmtCacheSize", 25, 0, Integer.MAX_VALUE,
1057                        "If prepared statement caching is enabled, "
1058                                        + "how many prepared statements should be cached?",
1059                        "3.0.10", PERFORMANCE_CATEGORY, 10);
1060 
1061        private IntegerConnectionProperty preparedStatementCacheSqlLimit = new IntegerConnectionProperty(
1062                        "prepStmtCacheSqlLimit",
1063                        256,
1064                        1,
1065                        Integer.MAX_VALUE,
1066                        "If prepared statement caching is enabled, "
1067                                        + "what's the largest SQL the driver will cache the parsing for?",
1068                        "3.0.10", PERFORMANCE_CATEGORY, 11);
1069 
1070        private BooleanConnectionProperty processEscapeCodesForPrepStmts = 
1071                new BooleanConnectionProperty("processEscapeCodesForPrepStmts",
1072                                true,
1073                                "Should the driver process escape codes in queries that are prepared?",
1074                                "3.1.12",
1075                                MISC_CATEGORY, Integer.MIN_VALUE);
1076        
1077        private StringConnectionProperty profileSql = new StringConnectionProperty(
1078                        "profileSql",
1079                        null,
1080                        "Deprecated, use 'profileSQL' instead. Trace queries and their execution/fetch times on STDERR (true/false) defaults to 'false'",
1081                        "2.0.14", DEBUGING_PROFILING_CATEGORY, 3);
1082 
1083        private BooleanConnectionProperty profileSQL = new BooleanConnectionProperty(
1084                        "profileSQL",
1085                        false,
1086                        "Trace queries and their execution/fetch times to the configured logger (true/false) defaults to 'false'",
1087                        "3.1.0", DEBUGING_PROFILING_CATEGORY, 1);
1088 
1089        private boolean profileSQLAsBoolean = false;
1090 
1091        private StringConnectionProperty propertiesTransform = new StringConnectionProperty(
1092                        NonRegisteringDriver.PROPERTIES_TRANSFORM_KEY,
1093                        null,
1094                        "An implementation of com.mysql.jdbc.ConnectionPropertiesTransform that the driver will use to modify URL properties passed to the driver before attempting a connection",
1095                        "3.1.4", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1096 
1097        private IntegerConnectionProperty queriesBeforeRetryMaster = new IntegerConnectionProperty(
1098                        "queriesBeforeRetryMaster",
1099                        50,
1100                        1,
1101                        Integer.MAX_VALUE,
1102                        "Number of queries to issue before falling back to master when failed over "
1103                                        + "(when using multi-host failover). Whichever condition is met first, "
1104                                        + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1105                                        + "attempt to be made to reconnect to the master. Defaults to 50.",
1106                        "3.0.2", HA_CATEGORY, 7);
1107 
1108        private BooleanConnectionProperty reconnectAtTxEnd = new BooleanConnectionProperty(
1109                        "reconnectAtTxEnd", false,
1110                        "If autoReconnect is set to true, should the driver attempt reconnections"
1111                                        + "at the end of every transaction?", "3.0.10",
1112                        HA_CATEGORY, 4);
1113 
1114        private boolean reconnectTxAtEndAsBoolean = false;
1115 
1116        private BooleanConnectionProperty relaxAutoCommit = new BooleanConnectionProperty(
1117                        "relaxAutoCommit",
1118                        false,
1119                        "If the version of MySQL the driver connects to does not support transactions, still allow calls to commit(), rollback() and setAutoCommit() (true/false, defaults to 'false')?",
1120                        "2.0.13", MISC_CATEGORY, Integer.MIN_VALUE);
1121 
1122        private IntegerConnectionProperty reportMetricsIntervalMillis = new IntegerConnectionProperty(
1123                        "reportMetricsIntervalMillis",
1124                        30000,
1125                        0,
1126                        Integer.MAX_VALUE,
1127                        "If 'gatherPerfMetrics' is enabled, how often should they be logged (in ms)?",
1128                        "3.1.2", DEBUGING_PROFILING_CATEGORY, 3);
1129 
1130        private BooleanConnectionProperty requireSSL = new BooleanConnectionProperty(
1131                        "requireSSL", false,
1132                        "Require SSL connection if useSSL=true? (defaults to 'false').",
1133                        "3.1.0", SECURITY_CATEGORY, 3);
1134 
1135        private StringConnectionProperty resourceId = new StringConnectionProperty(
1136                        "resourceId",
1137                        null, "A globally unique name that identifies the resource that this datasource or connection is " +
1138                        "connected to, used for XAResource.isSameRM() when the driver can't determine this value based on " +
1139                        "hostnames used in the URL",
1140                        "5.0.1",
1141                        HA_CATEGORY,
1142                        Integer.MIN_VALUE);
1143                        
1144        private BooleanConnectionProperty retainStatementAfterResultSetClose = new BooleanConnectionProperty(
1145                        "retainStatementAfterResultSetClose",
1146                        false,
1147                        "Should the driver retain the Statement reference in a ResultSet after ResultSet.close()"
1148                                        + " has been called. This is not JDBC-compliant after JDBC-4.0.",
1149                        "3.1.11", MISC_CATEGORY, Integer.MIN_VALUE);
1150        
1151        private BooleanConnectionProperty rewriteBatchedStatements = new BooleanConnectionProperty(
1152                        "rewriteBatchedStatements",
1153                        false, 
1154                        "Should the driver use multiqueries (irregardless of the setting of \"allowMultiQueries\") as well as "
1155                        + "rewriting of prepared statements for INSERT into multi-value inserts when executeBatch() is called? Notice that this has the potential "
1156                        + "for SQL injection if using plain java.sql.Statements and your code doesn't sanitize input correctly.\n\n"
1157                        + "Notice that for prepared statements, server-side prepared statements can not currently take advantage of "
1158                        + "this rewrite option, and that if you don't specify stream lengths when using PreparedStatement.set*Stream()," 
1159                        + "the driver won't be able to determine the optimium number of parameters per batch and you might receive an" 
1160                        + "an error from the driver that the resultant packet is too large.\n\n"
1161                        + "Statement.getGeneratedKeys() for these rewritten statements only works when the entire " 
1162                        + "batch includes INSERT statements.",
1163                        "3.1.13", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1164 
1165        private BooleanConnectionProperty rollbackOnPooledClose = new BooleanConnectionProperty(
1166                        "rollbackOnPooledClose",
1167                        true,
1168                        "Should the driver issue a rollback() when the logical connection in a pool is closed?",
1169                        "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1170 
1171        private BooleanConnectionProperty roundRobinLoadBalance = new BooleanConnectionProperty(
1172                        "roundRobinLoadBalance",
1173                        false,
1174                        "When autoReconnect is enabled, and failoverReadonly is false, should we pick hosts to connect to on a round-robin basis?",
1175                        "3.1.2", HA_CATEGORY, 5);
1176 
1177        private BooleanConnectionProperty runningCTS13 = new BooleanConnectionProperty(
1178                        "runningCTS13",
1179                        false,
1180                        "Enables workarounds for bugs in Sun's JDBC compliance testsuite version 1.3",
1181                        "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
1182 
1183        private IntegerConnectionProperty secondsBeforeRetryMaster = new IntegerConnectionProperty(
1184                        "secondsBeforeRetryMaster",
1185                        30,
1186                        1,
1187                        Integer.MAX_VALUE,
1188                        "How long should the driver wait, when failed over, before attempting "
1189                                        + "to reconnect to the master server? Whichever condition is met first, "
1190                                        + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1191                                        + "attempt to be made to reconnect to the master. Time in seconds, defaults to 30",
1192                        "3.0.2", HA_CATEGORY, 8);
1193 
1194        private StringConnectionProperty serverTimezone = new StringConnectionProperty(
1195                        "serverTimezone",
1196                        null,
1197                        "Override detection/mapping of timezone. Used when timezone from server doesn't map to Java timezone",
1198                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1199 
1200        private StringConnectionProperty sessionVariables = new StringConnectionProperty(
1201                        "sessionVariables", null,
1202                        "A comma-separated list of name/value pairs to be sent as SET SESSION ... to "
1203                                        + " the server when the driver connects.", "3.1.8",
1204                        MISC_CATEGORY, Integer.MAX_VALUE);
1205 
1206        private IntegerConnectionProperty slowQueryThresholdMillis = new IntegerConnectionProperty(
1207                        "slowQueryThresholdMillis",
1208                        2000,
1209                        0,
1210                        Integer.MAX_VALUE,
1211                        "If 'logSlowQueries' is enabled, how long should a query (in ms) before it is logged as 'slow'?",
1212                        "3.1.2", DEBUGING_PROFILING_CATEGORY, 9);
1213 
1214        private StringConnectionProperty socketFactoryClassName = new StringConnectionProperty(
1215                        "socketFactory",
1216                        StandardSocketFactory.class.getName(),
1217                        "The name of the class that the driver should use for creating socket connections to the server. This class must implement the interface 'com.mysql.jdbc.SocketFactory' and have public no-args constructor.",
1218                        "3.0.3", CONNECTION_AND_AUTH_CATEGORY, 4);
1219 
1220        private IntegerConnectionProperty socketTimeout = new IntegerConnectionProperty(
1221                        "socketTimeout",
1222                        0,
1223                        0,
1224                        Integer.MAX_VALUE,
1225                        "Timeout on network socket operations (0, the default means no timeout).",
1226                        "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 10);
1227 
1228        private BooleanConnectionProperty strictFloatingPoint = new BooleanConnectionProperty(
1229                        "strictFloatingPoint", false,
1230                        "Used only in older versions of compliance test", "3.0.0",
1231                        MISC_CATEGORY, Integer.MIN_VALUE);
1232 
1233        private BooleanConnectionProperty strictUpdates = new BooleanConnectionProperty(
1234                        "strictUpdates",
1235                        true,
1236                        "Should the driver do strict checking (all primary keys selected) of updatable result sets (true, false, defaults to 'true')?",
1237                        "3.0.4", MISC_CATEGORY, Integer.MIN_VALUE);
1238 
1239        private BooleanConnectionProperty overrideSupportsIntegrityEnhancementFacility =
1240                new BooleanConnectionProperty("overrideSupportsIntegrityEnhancementFacility",
1241                                false,
1242                                "Should the driver return \"true\" for DatabaseMetaData.supportsIntegrityEnhancementFacility() "
1243                                + "even if the database doesn't support it to workaround applications that require this method to return "
1244                                + "\"true\" to signal support of foreign keys, even though the SQL specification states that this facility "
1245                                + "contains much more than just foreign key support (one such application being OpenOffice)?",
1246                                "3.1.12", MISC_CATEGORY, Integer.MIN_VALUE);
1247        
1248        private BooleanConnectionProperty tinyInt1isBit = new BooleanConnectionProperty(
1249                        "tinyInt1isBit",
1250                        true,
1251                        "Should the driver treat the datatype TINYINT(1) as the BIT type "
1252                                        + "(because the server silently converts BIT -> TINYINT(1) when creating tables)?",
1253                        "3.0.16", MISC_CATEGORY, Integer.MIN_VALUE);
1254 
1255        private BooleanConnectionProperty traceProtocol = new BooleanConnectionProperty(
1256                        "traceProtocol", false,
1257                        "Should trace-level network protocol be logged?", "3.1.2",
1258                        DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
1259 
1260        private BooleanConnectionProperty transformedBitIsBoolean = new BooleanConnectionProperty(
1261                        "transformedBitIsBoolean",
1262                        false,
1263                        "If the driver converts TINYINT(1) to a different type, should it use BOOLEAN instead of BIT "
1264                                        + " for future compatibility with MySQL-5.0, as MySQL-5.0 has a BIT type?",
1265                        "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1266 
1267        private BooleanConnectionProperty useCompression = new BooleanConnectionProperty(
1268                        "useCompression",
1269                        false,
1270                        "Use zlib compression when communicating with the server (true/false)? Defaults to 'false'.",
1271                        "3.0.17", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1272 
1273        private StringConnectionProperty useConfig = new StringConnectionProperty(
1274                        "useConfigs",
1275                        null,
1276                        "Load the comma-delimited list of configuration properties before parsing the "
1277                                        + "URL or applying user-specified properties. These configurations are explained in the 'Configurations' of the documentation.",
1278                        "3.1.5", CONNECTION_AND_AUTH_CATEGORY, Integer.MAX_VALUE);
1279 
1280        private BooleanConnectionProperty useCursorFetch = new BooleanConnectionProperty(
1281                        "useCursorFetch",
1282                        false,
1283                        "If connected to MySQL > 5.0.2, and setFetchSize() > 0 on a statement, should "
1284                        + " that statement use cursor-based fetching to retrieve rows?",
1285                        "5.0.0", PERFORMANCE_CATEGORY, Integer.MAX_VALUE);
1286        
1287        private BooleanConnectionProperty useFastIntParsing = new BooleanConnectionProperty(
1288                        "useFastIntParsing",
1289                        true,
1290                        "Use internal String->Integer conversion routines to avoid excessive object creation?",
1291                        "3.1.4", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1292 
1293        private BooleanConnectionProperty useHostsInPrivileges = new BooleanConnectionProperty(
1294                        "useHostsInPrivileges",
1295                        true,
1296                        "Add '@hostname' to users in DatabaseMetaData.getColumn/TablePrivileges() (true/false), defaults to 'true'.",
1297                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1298        private BooleanConnectionProperty useInformationSchema = new BooleanConnectionProperty(
1299                        "useInformationSchema",
1300                        false,
1301                        "When connected to MySQL-5.0.7 or newer, should the driver use the INFORMATION_SCHEMA to " 
1302                        + " derive information used by DatabaseMetaData?",
1303                        "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE);
1304        private BooleanConnectionProperty useJDBCCompliantTimezoneShift = new BooleanConnectionProperty(
1305                        "useJDBCCompliantTimezoneShift",
1306                        false,
1307                        "Should the driver use JDBC-compliant rules when converting TIME/TIMESTAMP/DATETIME values' timezone information " +
1308                        "for those JDBC arguments which take a java.util.Calendar argument? (Notice that this " +
1309                        "option is exclusive of the \"useTimezone=true\" configuration option.)",
1310                        "5.0.0",
1311                        MISC_CATEGORY, Integer.MIN_VALUE);
1312        private BooleanConnectionProperty useLocalSessionState = new BooleanConnectionProperty(
1313                        "useLocalSessionState",
1314                        false,
1315                        "Should the driver refer to the internal values of autocommit and transaction isolation that are set "
1316                                        + " by Connection.setAutoCommit() and Connection.setTransactionIsolation(), rather than querying the database?",
1317                        "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1318 
1319        private BooleanConnectionProperty useOldUTF8Behavior = new BooleanConnectionProperty(
1320                        "useOldUTF8Behavior",
1321                        false,
1322                        "Use the UTF-8 behavior the driver did when communicating with 4.0 and older servers",
1323                        "3.1.6", MISC_CATEGORY, Integer.MIN_VALUE);
1324 
1325        private boolean useOldUTF8BehaviorAsBoolean = false;
1326 
1327        private BooleanConnectionProperty useOnlyServerErrorMessages = new BooleanConnectionProperty(
1328                        "useOnlyServerErrorMessages",
1329                        true,
1330                        "Don't prepend 'standard' SQLState error messages to error messages returned by the server.",
1331                        "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1332 
1333        private BooleanConnectionProperty useReadAheadInput = new BooleanConnectionProperty(
1334                        "useReadAheadInput",
1335                        true,
1336                        "Use newer, optimized non-blocking, buffered input stream when reading from the server?",
1337                        "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1338 
1339        private BooleanConnectionProperty useSqlStateCodes = new BooleanConnectionProperty(
1340                        "useSqlStateCodes",
1341                        true,
1342                        "Use SQL Standard state codes instead of 'legacy' X/Open/SQL state codes (true/false), default is 'true'",
1343                        "3.1.3", MISC_CATEGORY, Integer.MIN_VALUE);
1344 
1345        private BooleanConnectionProperty useSSL = new BooleanConnectionProperty(
1346                        "useSSL",
1347                        false,
1348                        "Use SSL when communicating with the server (true/false), defaults to 'false'",
1349                        "3.0.2", SECURITY_CATEGORY, 2);
1350 
1351        private BooleanConnectionProperty useStreamLengthsInPrepStmts = new BooleanConnectionProperty(
1352                        "useStreamLengthsInPrepStmts",
1353                        true,
1354                        "Honor stream length parameter in "
1355                                        + "PreparedStatement/ResultSet.setXXXStream() method calls (true/false, defaults to 'true')?",
1356                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1357 
1358        private BooleanConnectionProperty useTimezone = new BooleanConnectionProperty(
1359                        "useTimezone",
1360                        false,
1361                        "Convert time/date types between client and server timezones (true/false, defaults to 'false')?",
1362                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1363 
1364        private BooleanConnectionProperty useUltraDevWorkAround = new BooleanConnectionProperty(
1365                        "ultraDevHack",
1366                        false,
1367                        "Create PreparedStatements for prepareCall() when required, because UltraDev "
1368                                        + " is broken and issues a prepareCall() for _all_ statements? (true/false, defaults to 'false')",
1369                        "2.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
1370 
1371        private BooleanConnectionProperty useUnbufferedInput = new BooleanConnectionProperty(
1372                        "useUnbufferedInput", true,
1373                        "Don't use BufferedInputStream for reading data from the server",
1374                        "3.0.11", MISC_CATEGORY, Integer.MIN_VALUE);
1375 
1376        private BooleanConnectionProperty useUnicode = new BooleanConnectionProperty(
1377                        "useUnicode",
1378                        true,
1379                        "Should the driver use Unicode character encodings when handling strings? Should only be used when the driver can't determine the character set mapping, or you are trying to 'force' the driver to use a character set that MySQL either doesn't natively support (such as UTF-8), true/false, defaults to 'true'",
1380                        "1.1g", MISC_CATEGORY, 0);
1381 
1382        // Cache these values, they are 'hot'
1383        private boolean useUnicodeAsBoolean = true;
1384 
1385        private BooleanConnectionProperty useUsageAdvisor = new BooleanConnectionProperty(
1386                        "useUsageAdvisor",
1387                        false,
1388                        "Should the driver issue 'usage' warnings advising proper and efficient usage of JDBC and MySQL Connector/J to the log (true/false, defaults to 'false')?",
1389                        "3.1.1", DEBUGING_PROFILING_CATEGORY, 10);
1390 
1391        private boolean useUsageAdvisorAsBoolean = false;
1392 
1393        private BooleanConnectionProperty yearIsDateType = new BooleanConnectionProperty(
1394                        "yearIsDateType",
1395                        true,
1396                        "Should the JDBC driver treat the MySQL type \"YEAR\" as a java.sql.Date, or as a SHORT?",
1397                        "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1398 
1399        private StringConnectionProperty zeroDateTimeBehavior = new StringConnectionProperty(
1400                        "zeroDateTimeBehavior",
1401                        ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1402                        new String[] { ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1403                                        ZERO_DATETIME_BEHAVIOR_ROUND,
1404                                        ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL },
1405                        "What should happen when the driver encounters DATETIME values that are composed "
1406                                        + "entirely of zeroes (used by MySQL to represent invalid dates)? "
1407                                        + "Valid values are '"
1408                                        + ZERO_DATETIME_BEHAVIOR_EXCEPTION
1409                                        + "', '"
1410                                        + ZERO_DATETIME_BEHAVIOR_ROUND
1411                                        + "' and '"
1412                                        + ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL + "'.", "3.1.4",
1413                        MISC_CATEGORY, Integer.MIN_VALUE);
1414 
1415        private BooleanConnectionProperty useJvmCharsetConverters = new BooleanConnectionProperty("useJvmCharsetConverters",
1416                        true, "Always use the character encoding routines built into the JVM, rather than using "
1417                        + "lookup tables for single-byte character sets? (The default of \"true\" for this is appropriate for " 
1418                        + "newer JVMs", "5.0.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1419        
1420        private BooleanConnectionProperty useGmtMillisForDatetimes = new BooleanConnectionProperty("useGmtMillisForDatetimes", false, "Convert between session timezone and GMT before creating Date and Timestamp instances (value of \"false\" is legacy behavior, \"true\" leads to more JDBC-compliant behavior.", "3.1.12", MISC_CATEGORY, Integer.MIN_VALUE);
1421 
1422        private BooleanConnectionProperty dumpMetadataOnColumnNotFound = new BooleanConnectionProperty("dumpMetadataOnColumnNotFound", false, "Should the driver dump the field-level metadata of a result set into " + "the exception message when ResultSet.findColumn() fails?", "3.1.13", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
1423 
1424        protected DriverPropertyInfo[] exposeAsDriverPropertyInfoInternal(
1425                        Properties info, int slotsToReserve) throws SQLException {
1426                initializeProperties(info);
1427 
1428                int numProperties = PROPERTY_LIST.size();
1429 
1430                int listSize = numProperties + slotsToReserve;
1431 
1432                DriverPropertyInfo[] driverProperties = new DriverPropertyInfo[listSize];
1433 
1434                for (int i = slotsToReserve; i < listSize; i++) {
1435                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1436                                        .get(i - slotsToReserve);
1437 
1438                        try {
1439                                ConnectionProperty propToExpose = (ConnectionProperty) propertyField
1440                                                .get(this);
1441 
1442                                if (info != null) {
1443                                        propToExpose.initializeFrom(info);
1444                                }
1445 
1446                                
1447                                driverProperties[i] = propToExpose.getAsDriverPropertyInfo();
1448                        } catch (IllegalAccessException iae) {
1449                                throw SQLError.createSQLException("Internal properties failure",
1450                                                SQLError.SQL_STATE_GENERAL_ERROR);
1451                        }
1452                }
1453 
1454                return driverProperties;
1455        }
1456 
1457        protected Properties exposeAsProperties(Properties info)
1458                        throws SQLException {
1459                if (info == null) {
1460                        info = new Properties();
1461                }
1462 
1463                int numPropertiesToSet = PROPERTY_LIST.size();
1464 
1465                for (int i = 0; i < numPropertiesToSet; i++) {
1466                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1467                                        .get(i);
1468 
1469                        try {
1470                                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1471                                                .get(this);
1472 
1473                                Object propValue = propToGet.getValueAsObject();
1474 
1475                                if (propValue != null) {
1476                                        info.setProperty(propToGet.getPropertyName(), propValue
1477                                                        .toString());
1478                                }
1479                        } catch (IllegalAccessException iae) {
1480                                throw SQLError.createSQLException("Internal properties failure",
1481                                                SQLError.SQL_STATE_GENERAL_ERROR);
1482                        }
1483                }
1484 
1485                return info;
1486        }
1487 
1488        /**
1489         * Returns a description of the connection properties as an XML document.
1490         * 
1491         * @return the connection properties as an XML document.
1492         * @throws SQLException
1493         *             if an error occurs.
1494         */
1495        public String exposeAsXml() throws SQLException {
1496                StringBuffer xmlBuf = new StringBuffer();
1497                xmlBuf.append("<ConnectionProperties>");
1498 
1499                int numPropertiesToSet = PROPERTY_LIST.size();
1500 
1501                int numCategories = PROPERTY_CATEGORIES.length;
1502 
1503                Map propertyListByCategory = new HashMap();
1504 
1505                for (int i = 0; i < numCategories; i++) {
1506                        propertyListByCategory.put(PROPERTY_CATEGORIES[i], new Map[] {
1507                                        new TreeMap(), new TreeMap() });
1508                }
1509 
1510                //
1511                // The following properties are not exposed as 'normal' properties, but
1512                // they are
1513                // settable nonetheless, so we need to have them documented, make sure
1514                // that they sort 'first' as #1 and #2 in the category
1515                //
1516                StringConnectionProperty userProp = new StringConnectionProperty(
1517                                NonRegisteringDriver.USER_PROPERTY_KEY, null,
1518                                "The user to connect as", "all", CONNECTION_AND_AUTH_CATEGORY,
1519                                Integer.MIN_VALUE + 1);
1520                StringConnectionProperty passwordProp = new StringConnectionProperty(
1521                                NonRegisteringDriver.PASSWORD_PROPERTY_KEY, null,
1522                                "The password to use when connecting", "all",
1523                                CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE + 2);
1524 
1525                Map[] connectionSortMaps = (Map[]) propertyListByCategory
1526                                .get(CONNECTION_AND_AUTH_CATEGORY);
1527                connectionSortMaps[0].put(new Integer(userProp.getOrder()), userProp);
1528                connectionSortMaps[0].put(new Integer(passwordProp.getOrder()),
1529                                passwordProp);
1530 
1531                try {
1532                        for (int i = 0; i < numPropertiesToSet; i++) {
1533                                java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1534                                                .get(i);
1535                                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1536                                                .get(this);
1537                                Map[] sortMaps = (Map[]) propertyListByCategory.get(propToGet
1538                                                .getCategoryName());
1539                                int orderInCategory = propToGet.getOrder();
1540 
1541                                if (orderInCategory == Integer.MIN_VALUE) {
1542                                        sortMaps[1].put(propToGet.getPropertyName(), propToGet);
1543                                } else {
1544                                        sortMaps[0].put(new Integer(orderInCategory), propToGet);
1545                                }
1546                        }
1547 
1548                        for (int j = 0; j < numCategories; j++) {
1549                                Map[] sortMaps = (Map[]) propertyListByCategory
1550                                                .get(PROPERTY_CATEGORIES[j]);
1551                                Iterator orderedIter = sortMaps[0].values().iterator();
1552                                Iterator alphaIter = sortMaps[1].values().iterator();
1553 
1554                                xmlBuf.append("\n <PropertyCategory name=\"");
1555                                xmlBuf.append(PROPERTY_CATEGORIES[j]);
1556                                xmlBuf.append("\">");
1557 
1558                                while (orderedIter.hasNext()) {
1559                                        ConnectionProperty propToGet = (ConnectionProperty) orderedIter
1560                                                        .next();
1561                                        
1562                                        xmlBuf.append("\n  <Property name=\"");
1563                                        xmlBuf.append(propToGet.getPropertyName());
1564                                        xmlBuf.append("\" required=\"");
1565                                        xmlBuf.append(propToGet.required ? "Yes" : "No");
1566 
1567                                        xmlBuf.append("\" default=\"");
1568 
1569                                        if (propToGet.getDefaultValue() != null) {
1570                                                xmlBuf.append(propToGet.getDefaultValue());
1571                                        }
1572 
1573                                        xmlBuf.append("\" sortOrder=\"");
1574                                        xmlBuf.append(propToGet.getOrder());
1575                                        xmlBuf.append("\" since=\"");
1576                                        xmlBuf.append(propToGet.sinceVersion);
1577                                        xmlBuf.append("\">\n");
1578                                        xmlBuf.append("    ");
1579                                        xmlBuf.append(propToGet.description);
1580                                        xmlBuf.append("\n  </Property>");
1581                                }
1582 
1583                                while (alphaIter.hasNext()) {
1584                                        ConnectionProperty propToGet = (ConnectionProperty) alphaIter
1585                                                        .next();
1586                                        
1587                                        xmlBuf.append("\n  <Property name=\"");
1588                                        xmlBuf.append(propToGet.getPropertyName());
1589                                        xmlBuf.append("\" required=\"");
1590                                        xmlBuf.append(propToGet.required ? "Yes" : "No");
1591 
1592                                        xmlBuf.append("\" default=\"");
1593 
1594                                        if (propToGet.getDefaultValue() != null) {
1595                                                xmlBuf.append(propToGet.getDefaultValue());
1596                                        }
1597 
1598                                        xmlBuf.append("\" sortOrder=\"alpha\" since=\"");
1599                                        xmlBuf.append(propToGet.sinceVersion);
1600                                        xmlBuf.append("\">\n");
1601                                        xmlBuf.append("    ");
1602                                        xmlBuf.append(propToGet.description);
1603                                        xmlBuf.append("\n  </Property>");
1604                                }
1605 
1606                                xmlBuf.append("\n </PropertyCategory>");
1607                        }
1608                } catch (IllegalAccessException iae) {
1609                        throw SQLError.createSQLException("Internal properties failure",
1610                                        SQLError.SQL_STATE_GENERAL_ERROR);
1611                }
1612 
1613                xmlBuf.append("\n</ConnectionProperties>");
1614 
1615                return xmlBuf.toString();
1616        }
1617 
1618        /**
1619         * DOCUMENT ME!
1620         * 
1621         * @return
1622         */
1623        public boolean getAllowLoadLocalInfile() {
1624                return this.allowLoadLocalInfile.getValueAsBoolean();
1625        }
1626 
1627        /**
1628         * DOCUMENT ME!
1629         * 
1630         * @return
1631         */
1632        public boolean getAllowMultiQueries() {
1633                return this.allowMultiQueries.getValueAsBoolean();
1634        }
1635 
1636        /**
1637         * @return Returns the allowNanAndInf.
1638         */
1639        public boolean getAllowNanAndInf() {
1640                return allowNanAndInf.getValueAsBoolean();
1641        }
1642 
1643        /**
1644         * @return Returns the allowUrlInLocalInfile.
1645         */
1646        public boolean getAllowUrlInLocalInfile() {
1647                return this.allowUrlInLocalInfile.getValueAsBoolean();
1648        }
1649 
1650        /**
1651         * @return Returns the alwaysSendSetIsolation.
1652         */
1653        public boolean getAlwaysSendSetIsolation() {
1654                return this.alwaysSendSetIsolation.getValueAsBoolean();
1655        }
1656 
1657        /**
1658         * @return Returns the autoDeserialize.
1659         */
1660        public boolean getAutoDeserialize() {
1661                return autoDeserialize.getValueAsBoolean();
1662        }
1663 
1664        public boolean getAutoGenerateTestcaseScript() {
1665                return this.autoGenerateTestcaseScriptAsBoolean;
1666        }
1667 
1668        /**
1669         * DOCUMENT ME!
1670         * 
1671         * @return
1672         */
1673        public boolean getAutoReconnectForPools() {
1674                return this.autoReconnectForPoolsAsBoolean;
1675        }
1676 
1677        /**
1678         * @return Returns the blobSendChunkSize.
1679         */
1680        public int getBlobSendChunkSize() {
1681                return blobSendChunkSize.getValueAsInt();
1682        }
1683 
1684        /**
1685         * DOCUMENT ME!
1686         * 
1687         * @return Returns if cacheCallableStatements is enabled
1688         */
1689        public boolean getCacheCallableStatements() {
1690                return this.cacheCallableStatements.getValueAsBoolean();
1691        }
1692 
1693        /**
1694         * DOCUMENT ME!
1695         * 
1696         * @return Returns the cachePreparedStatements.
1697         */
1698        public boolean getCachePreparedStatements() {
1699                return ((Boolean) this.cachePreparedStatements.getValueAsObject())
1700                                .booleanValue();
1701        }
1702 
1703        /**
1704         * DOCUMENT ME!
1705         * 
1706         * @return DOCUMENT ME!
1707         */
1708        public boolean getCacheResultSetMetadata() {
1709                return this.cacheResultSetMetaDataAsBoolean;
1710        }
1711 
1712        /**
1713         * @return Returns the cacheServerConfiguration.
1714         */
1715        public boolean getCacheServerConfiguration() {
1716                return cacheServerConfiguration.getValueAsBoolean();
1717        }
1718 
1719        /**
1720         * DOCUMENT ME!
1721         * 
1722         * @return Returns the callableStatementCacheSize.
1723         */
1724        public int getCallableStatementCacheSize() {
1725                return this.callableStatementCacheSize.getValueAsInt();
1726        }
1727 
1728        /**
1729         * DOCUMENT ME!
1730         * 
1731         * @return
1732         */
1733        public boolean getCapitalizeTypeNames() {
1734                return this.capitalizeTypeNames.getValueAsBoolean();
1735        }
1736 
1737        /**
1738         * DOCUMENT ME!
1739         * 
1740         * @return Returns the characterSetResults.
1741         */
1742        public String getCharacterSetResults() {
1743                return this.characterSetResults.getValueAsString();
1744        }
1745 
1746        /**
1747         * DOCUMENT ME!
1748         * 
1749         * @return Returns the clobberStreamingResults.
1750         */
1751        public boolean getClobberStreamingResults() {
1752                return this.clobberStreamingResults.getValueAsBoolean();
1753        }
1754 
1755        public String getClobCharacterEncoding() {
1756                return this.clobCharacterEncoding.getValueAsString();
1757        }
1758 
1759        /**
1760         * DOCUMENT ME!
1761         * 
1762         * @return Returns the connectionCollation.
1763         */
1764        public String getConnectionCollation() {
1765                return this.connectionCollation.getValueAsString();
1766        }
1767 
1768        /**
1769         * DOCUMENT ME!
1770         * 
1771         * @return
1772         */
1773        public int getConnectTimeout() {
1774                return this.connectTimeout.getValueAsInt();
1775        }
1776 
1777        /**
1778         * DOCUMENT ME!
1779         * 
1780         * @return
1781         */
1782        public boolean getContinueBatchOnError() {
1783                return this.continueBatchOnError.getValueAsBoolean();
1784        }
1785 
1786        public boolean getCreateDatabaseIfNotExist() {
1787                return this.createDatabaseIfNotExist.getValueAsBoolean();
1788        }
1789 
1790        public int getDefaultFetchSize() {
1791                return this.defaultFetchSize.getValueAsInt();
1792        }
1793 
1794        /**
1795         * @return Returns the dontTrackOpenResources.
1796         */
1797        public boolean getDontTrackOpenResources() {
1798                return this.dontTrackOpenResources.getValueAsBoolean();
1799        }
1800 
1801        /**
1802         * DOCUMENT ME!
1803         * 
1804         * @return Returns the dumpQueriesOnException.
1805         */
1806        public boolean getDumpQueriesOnException() {
1807                return this.dumpQueriesOnException.getValueAsBoolean();
1808        }
1809 
1810        /**
1811         * @return Returns the dynamicCalendars.
1812         */
1813        public boolean getDynamicCalendars() {
1814                return this.dynamicCalendars.getValueAsBoolean();
1815        }
1816 
1817        /**
1818         * DOCUMENT ME!
1819         * 
1820         * @return Returns the elideSetAutoCommits.
1821         */
1822        public boolean getElideSetAutoCommits() {
1823                return this.elideSetAutoCommits.getValueAsBoolean();
1824        }
1825 
1826        public boolean getEmptyStringsConvertToZero() {
1827                return this.emptyStringsConvertToZero.getValueAsBoolean();
1828        }
1829 
1830        /**
1831         * DOCUMENT ME!
1832         * 
1833         * @return
1834         */
1835        public boolean getEmulateLocators() {
1836                return this.emulateLocators.getValueAsBoolean();
1837        }
1838 
1839        /**
1840         * @return Returns the emulateUnsupportedPstmts.
1841         */
1842        public boolean getEmulateUnsupportedPstmts() {
1843                return this.emulateUnsupportedPstmts.getValueAsBoolean();
1844        }
1845 
1846        /**
1847         * DOCUMENT ME!
1848         * 
1849         * @return Returns the enablePacketDebug.
1850         */
1851        public boolean getEnablePacketDebug() {
1852                return this.enablePacketDebug.getValueAsBoolean();
1853        }
1854 
1855        /**
1856         * DOCUMENT ME!
1857         * 
1858         * @return
1859         */
1860        public String getEncoding() {
1861                return this.characterEncodingAsString;
1862        }
1863 
1864        /**
1865         * DOCUMENT ME!
1866         * 
1867         * @return Returns the explainSlowQueries.
1868         */
1869        public boolean getExplainSlowQueries() {
1870                return this.explainSlowQueries.getValueAsBoolean();
1871        }
1872 
1873        /**
1874         * DOCUMENT ME!
1875         * 
1876         * @return Returns the failOverReadOnly.
1877         */
1878        public boolean getFailOverReadOnly() {
1879                return this.failOverReadOnly.getValueAsBoolean();
1880        }
1881 
1882        /**
1883         * DOCUMENT ME!
1884         * 
1885         * @return Returns the gatherPerformanceMetrics.
1886         */
1887        public boolean getGatherPerformanceMetrics() {
1888                return this.gatherPerformanceMetrics.getValueAsBoolean();
1889        }
1890 
1891        /**
1892         * DOCUMENT ME!
1893         * 
1894         * @return
1895         */
1896        protected boolean getHighAvailability() {
1897                return this.highAvailabilityAsBoolean;
1898        }
1899 
1900        /**
1901         * @return Returns the holdResultsOpenOverStatementClose.
1902         */
1903        public boolean getHoldResultsOpenOverStatementClose() {
1904                return holdResultsOpenOverStatementClose.getValueAsBoolean();
1905        }
1906 
1907        /**
1908         * DOCUMENT ME!
1909         * 
1910         * @return
1911         */
1912        public boolean getIgnoreNonTxTables() {
1913                return this.ignoreNonTxTables.getValueAsBoolean();
1914        }
1915 
1916        /**
1917         * DOCUMENT ME!
1918         * 
1919         * @return
1920         */
1921        public int getInitialTimeout() {
1922                return this.initialTimeout.getValueAsInt();
1923        }
1924 
1925        /**
1926         * DOCUMENT ME!
1927         * 
1928         * @return
1929         */
1930        public boolean getInteractiveClient() {
1931                return this.isInteractiveClient.getValueAsBoolean();
1932        }
1933 
1934        /**
1935         * DOCUMENT ME!
1936         * 
1937         * @return Returns the isInteractiveClient.
1938         */
1939        public boolean getIsInteractiveClient() {
1940                return this.isInteractiveClient.getValueAsBoolean();
1941        }
1942 
1943        /**
1944         * DOCUMENT ME!
1945         * 
1946         * @return Returns the jdbcCompliantTruncation.
1947         */
1948        public boolean getJdbcCompliantTruncation() {
1949                return this.jdbcCompliantTruncation.getValueAsBoolean();
1950        }
1951 
1952        /**
1953         * @return Returns the dontTrackOpenResources.
1954         */
1955        public int getLocatorFetchBufferSize() {
1956                return this.locatorFetchBufferSize.getValueAsInt();
1957        }
1958 
1959        /**
1960         * DOCUMENT ME!
1961         * 
1962         * @return
1963         */
1964        public String getLogger() {
1965                return this.loggerClassName.getValueAsString();
1966        }
1967 
1968        /**
1969         * DOCUMENT ME!
1970         * 
1971         * @return Returns the loggerClassName.
1972         */
1973        public String getLoggerClassName() {
1974                return this.loggerClassName.getValueAsString();
1975        }
1976 
1977        /**
1978         * DOCUMENT ME!
1979         * 
1980         * @return Returns the logSlowQueries.
1981         */
1982        public boolean getLogSlowQueries() {
1983                return this.logSlowQueries.getValueAsBoolean();
1984        }
1985 
1986        public boolean getMaintainTimeStats() {
1987                return maintainTimeStatsAsBoolean;
1988        }
1989 
1990        /**
1991         * DOCUMENT ME!
1992         * 
1993         * @return Returns the maxQuerySizeToLog.
1994         */
1995        public int getMaxQuerySizeToLog() {
1996                return this.maxQuerySizeToLog.getValueAsInt();
1997        }
1998 
1999        /**
2000         * DOCUMENT ME!
2001         * 
2002         * @return
2003         */
2004        public int getMaxReconnects() {
2005                return this.maxReconnects.getValueAsInt();
2006        }
2007 
2008        /**
2009         * DOCUMENT ME!
2010         * 
2011         * @return
2012         */
2013        public int getMaxRows() {
2014                return this.maxRowsAsInt;
2015        }
2016 
2017        /**
2018         * Returns the number of queries that metadata can be cached if caching is
2019         * enabled.
2020         * 
2021         * @return the number of queries to cache metadata for.
2022         */
2023        public int getMetadataCacheSize() {
2024                return this.metadataCacheSize.getValueAsInt();
2025        }
2026 
2027        /**
2028         * @return Returns the noDatetimeStringSync.
2029         */
2030        public boolean getNoDatetimeStringSync() {
2031                return this.noDatetimeStringSync.getValueAsBoolean();
2032        }
2033 
2034        public boolean getNullCatalogMeansCurrent() {
2035                return this.nullCatalogMeansCurrent.getValueAsBoolean();
2036        }
2037 
2038        public boolean getNullNamePatternMatchesAll() {
2039                return this.nullNamePatternMatchesAll.getValueAsBoolean();
2040        }
2041 
2042        /**
2043         * DOCUMENT ME!
2044         * 
2045         * @return Returns the packetDebugBufferSize.
2046         */
2047        public int getPacketDebugBufferSize() {
2048                return this.packetDebugBufferSize.getValueAsInt();
2049        }
2050 
2051        /**
2052         * DOCUMENT ME!
2053         * 
2054         * @return
2055         */
2056        public boolean getParanoid() {
2057                return this.paranoid.getValueAsBoolean();
2058        }
2059 
2060        /**
2061         * DOCUMENT ME!
2062         * 
2063         * @return
2064         */
2065        public boolean getPedantic() {
2066                return this.pedantic.getValueAsBoolean();
2067        }
2068 
2069        /**
2070         * DOCUMENT ME!
2071         * 
2072         * @return Returns the preparedStatementCacheSize.
2073         */
2074        public int getPreparedStatementCacheSize() {
2075                return ((Integer) this.preparedStatementCacheSize.getValueAsObject())
2076                                .intValue();
2077        }
2078 
2079        /**
2080         * DOCUMENT ME!
2081         * 
2082         * @return Returns the preparedStatementCacheSqlLimit.
2083         */
2084        public int getPreparedStatementCacheSqlLimit() {
2085                return ((Integer) this.preparedStatementCacheSqlLimit
2086                                .getValueAsObject()).intValue();
2087        }
2088 
2089        /**
2090         * DOCUMENT ME!
2091         * 
2092         * @return
2093         */
2094        public boolean getProfileSql() {
2095                return this.profileSQLAsBoolean;
2096        }
2097 
2098        /**
2099         * DOCUMENT ME!
2100         * 
2101         * @return Returns the profileSQL flag
2102         */
2103        public boolean getProfileSQL() {
2104                return this.profileSQL.getValueAsBoolean();
2105        }
2106 
2107        /**
2108         * @return Returns the propertiesTransform.
2109         */
2110        public String getPropertiesTransform() {
2111                return this.propertiesTransform.getValueAsString();
2112        }
2113 
2114        /**
2115         * DOCUMENT ME!
2116         * 
2117         * @return
2118         */
2119        public int getQueriesBeforeRetryMaster() {
2120                return this.queriesBeforeRetryMaster.getValueAsInt();
2121        }
2122 
2123        /**
2124         * DOCUMENT ME!
2125         * 
2126         * @return
2127         */
2128        public boolean getReconnectAtTxEnd() {
2129                return this.reconnectTxAtEndAsBoolean;
2130        }
2131 
2132        /**
2133         * DOCUMENT ME!
2134         * 
2135         * @return
2136         */
2137        public boolean getRelaxAutoCommit() {
2138                return this.relaxAutoCommit.getValueAsBoolean();
2139        }
2140 
2141        /**
2142         * DOCUMENT ME!
2143         * 
2144         * @return Returns the reportMetricsIntervalMillis.
2145         */
2146        public int getReportMetricsIntervalMillis() {
2147                return this.reportMetricsIntervalMillis.getValueAsInt();
2148        }
2149 
2150        /**
2151         * DOCUMENT ME!
2152         * 
2153         * @return
2154         */
2155        public boolean getRequireSSL() {
2156                return this.requireSSL.getValueAsBoolean();
2157        }
2158 
2159        protected boolean getRetainStatementAfterResultSetClose() {
2160                return this.retainStatementAfterResultSetClose.getValueAsBoolean();
2161        }
2162 
2163        /**
2164         * @return Returns the rollbackOnPooledClose.
2165         */
2166        public boolean getRollbackOnPooledClose() {
2167                return this.rollbackOnPooledClose.getValueAsBoolean();
2168        }
2169 
2170        /**
2171         * Returns whether or not hosts will be picked in a round-robin fashion.
2172         * 
2173         * @return Returns the roundRobinLoadBalance property.
2174         */
2175        public boolean getRoundRobinLoadBalance() {
2176                return this.roundRobinLoadBalance.getValueAsBoolean();
2177        }
2178 
2179        /**
2180         * @return Returns the runningCTS13.
2181         */
2182        public boolean getRunningCTS13() {
2183                return this.runningCTS13.getValueAsBoolean();
2184        }
2185 
2186        /**
2187         * DOCUMENT ME!
2188         * 
2189         * @return
2190         */
2191        public int getSecondsBeforeRetryMaster() {
2192                return this.secondsBeforeRetryMaster.getValueAsInt();
2193        }
2194 
2195        /**
2196         * Returns the 'serverTimezone' property.
2197         * 
2198         * @return the configured server timezone property.
2199         */
2200        public String getServerTimezone() {
2201                return this.serverTimezone.getValueAsString();
2202        }
2203 
2204        /**
2205         * @return Returns the sessionVariables.
2206         */
2207        public String getSessionVariables() {
2208                return sessionVariables.getValueAsString();
2209        }
2210 
2211        /**
2212         * DOCUMENT ME!
2213         * 
2214         * @return Returns the slowQueryThresholdMillis.
2215         */
2216        public int getSlowQueryThresholdMillis() {
2217                return this.slowQueryThresholdMillis.getValueAsInt();
2218        }
2219 
2220        /**
2221         * DOCUMENT ME!
2222         * 
2223         * @return
2224         */
2225        public String getSocketFactoryClassName() {
2226                return this.socketFactoryClassName.getValueAsString();
2227        }
2228 
2229        /**
2230         * DOCUMENT ME!
2231         * 
2232         * @return
2233         */
2234        public int getSocketTimeout() {
2235                return this.socketTimeout.getValueAsInt();
2236        }
2237 
2238        /**
2239         * DOCUMENT ME!
2240         * 
2241         * @return
2242         */
2243        public boolean getStrictFloatingPoint() {
2244                return this.strictFloatingPoint.getValueAsBoolean();
2245        }
2246 
2247        /**
2248         * DOCUMENT ME!
2249         * 
2250         * @return
2251         */
2252        public boolean getStrictUpdates() {
2253                return this.strictUpdates.getValueAsBoolean();
2254        }
2255 
2256        /**
2257         * @return Returns the tinyInt1isBit.
2258         */
2259        public boolean getTinyInt1isBit() {
2260                return this.tinyInt1isBit.getValueAsBoolean();
2261        }
2262 
2263        /**
2264         * DOCUMENT ME!
2265         * 
2266         * @return Returns the logProtocol.
2267         */
2268        public boolean getTraceProtocol() {
2269                return this.traceProtocol.getValueAsBoolean();
2270        }
2271 
2272        public boolean getTransformedBitIsBoolean() {
2273                return this.transformedBitIsBoolean.getValueAsBoolean();
2274        }
2275 
2276        /**
2277         * DOCUMENT ME!
2278         * 
2279         * @return
2280         */
2281        public boolean getUseCompression() {
2282                return this.useCompression.getValueAsBoolean();
2283        }
2284 
2285        /**
2286         * @return Returns the useFastIntParsing.
2287         */
2288        public boolean getUseFastIntParsing() {
2289                return this.useFastIntParsing.getValueAsBoolean();
2290        }
2291 
2292        /**
2293         * DOCUMENT ME!
2294         * 
2295         * @return
2296         */
2297        public boolean getUseHostsInPrivileges() {
2298                return this.useHostsInPrivileges.getValueAsBoolean();
2299        }
2300 
2301        public boolean getUseInformationSchema() {
2302                return this.useInformationSchema.getValueAsBoolean();
2303        }
2304 
2305        /**
2306         * @return Returns the useLocalSessionState.
2307         */
2308        public boolean getUseLocalSessionState() {
2309                return this.useLocalSessionState.getValueAsBoolean();
2310        }
2311 
2312        /**
2313         * @return Returns the useOldUTF8Behavior.
2314         */
2315        public boolean getUseOldUTF8Behavior() {
2316                return this.useOldUTF8BehaviorAsBoolean;
2317        }
2318 
2319        /**
2320         * @return Returns the useOnlyServerErrorMessages.
2321         */
2322        public boolean getUseOnlyServerErrorMessages() {
2323                return this.useOnlyServerErrorMessages.getValueAsBoolean();
2324        }
2325 
2326        /**
2327         * @return Returns the useReadAheadInput.
2328         */
2329        public boolean getUseReadAheadInput() {
2330                return this.useReadAheadInput.getValueAsBoolean();
2331        }
2332 
2333        /**
2334         * DOCUMENT ME!
2335         * 
2336         * @return
2337         */
2338        public boolean getUseServerPreparedStmts() {
2339                return this.detectServerPreparedStmts.getValueAsBoolean();
2340        }
2341 
2342        /**
2343         * DOCUMENT ME!
2344         * 
2345         * @return Returns the useSqlStateCodes state.
2346         */
2347        public boolean getUseSqlStateCodes() {
2348                return this.useSqlStateCodes.getValueAsBoolean();
2349        }
2350 
2351        /**
2352         * DOCUMENT ME!
2353         * 
2354         * @return
2355         */
2356        public boolean getUseSSL() {
2357                return this.useSSL.getValueAsBoolean();
2358        }
2359 
2360        /**
2361         * DOCUMENT ME!
2362         * 
2363         * @return
2364         */
2365        public boolean getUseStreamLengthsInPrepStmts() {
2366                return this.useStreamLengthsInPrepStmts.getValueAsBoolean();
2367        }
2368 
2369        /**
2370         * DOCUMENT ME!
2371         * 
2372         * @return
2373         */
2374        public boolean getUseTimezone() {
2375                return this.useTimezone.getValueAsBoolean();
2376        }
2377 
2378        /**
2379         * DOCUMENT ME!
2380         * 
2381         * @return
2382         */
2383        public boolean getUseUltraDevWorkAround() {
2384                return this.useUltraDevWorkAround.getValueAsBoolean();
2385        }
2386 
2387        /**
2388         * DOCUMENT ME!
2389         * 
2390         * @return Returns the useUnbufferedInput.
2391         */
2392        public boolean getUseUnbufferedInput() {
2393                return this.useUnbufferedInput.getValueAsBoolean();
2394        }
2395 
2396        /**
2397         * DOCUMENT ME!
2398         * 
2399         * @return
2400         */
2401        public boolean getUseUnicode() {
2402                return this.useUnicodeAsBoolean;
2403        }
2404 
2405        /**
2406         * Returns whether or not the driver advises of proper usage.
2407         * 
2408         * @return the value of useUsageAdvisor
2409         */
2410        public boolean getUseUsageAdvisor() {
2411                return this.useUsageAdvisorAsBoolean;
2412        }
2413 
2414        public boolean getYearIsDateType() {
2415                return this.yearIsDateType.getValueAsBoolean();
2416        }
2417 
2418        /**
2419         * @return Returns the zeroDateTimeBehavior.
2420         */
2421        public String getZeroDateTimeBehavior() {
2422                return this.zeroDateTimeBehavior.getValueAsString();
2423        }
2424 
2425        /**
2426         * Initializes driver properties that come from a JNDI reference (in the
2427         * case of a javax.sql.DataSource bound into some name service that doesn't
2428         * handle Java objects directly).
2429         * 
2430         * @param ref
2431         *            The JNDI Reference that holds RefAddrs for all properties
2432         * @throws SQLException
2433         *             DOCUMENT ME!
2434         */
2435        protected void initializeFromRef(Reference ref) throws SQLException {
2436                int numPropertiesToSet = PROPERTY_LIST.size();
2437 
2438                for (int i = 0; i < numPropertiesToSet; i++) {
2439                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
2440                                        .get(i);
2441 
2442                        try {
2443                                ConnectionProperty propToSet = (ConnectionProperty) propertyField
2444                                                .get(this);
2445 
2446                                if (ref != null) {
2447                                        propToSet.initializeFrom(ref);
2448                                }
2449                        } catch (IllegalAccessException iae) {
2450                                throw SQLError.createSQLException("Internal properties failure",
2451                                                SQLError.SQL_STATE_GENERAL_ERROR);
2452                        }
2453                }
2454 
2455                postInitialization();
2456        }
2457 
2458        /**
2459         * Initializes driver properties that come from URL or properties passed to
2460         * the driver manager.
2461         * 
2462         * @param info
2463         *            DOCUMENT ME!
2464         * @throws SQLException
2465         *             DOCUMENT ME!
2466         */
2467        protected void initializeProperties(Properties info) throws SQLException {
2468                if (info != null) {
2469                        // For backwards-compatibility
2470                        String profileSqlLc = info.getProperty("profileSql");
2471 
2472                        if (profileSqlLc != null) {
2473                                info.put("profileSQL", profileSqlLc);
2474                        }
2475 
2476                        Properties infoCopy = (Properties) info.clone();
2477 
2478                        infoCopy.remove(NonRegisteringDriver.HOST_PROPERTY_KEY);
2479                        infoCopy.remove(NonRegisteringDriver.USER_PROPERTY_KEY);
2480                        infoCopy.remove(NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
2481                        infoCopy.remove(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
2482                        infoCopy.remove(NonRegisteringDriver.PORT_PROPERTY_KEY);
2483                        infoCopy.remove("profileSql");
2484 
2485                        int numPropertiesToSet = PROPERTY_LIST.size();
2486 
2487                        for (int i = 0; i < numPropertiesToSet; i++) {
2488                                java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
2489                                                .get(i);
2490 
2491                                try {
2492                                        ConnectionProperty propToSet = (ConnectionProperty) propertyField
2493                                                        .get(this);
2494 
2495                                        propToSet.initializeFrom(infoCopy);
2496                                } catch (IllegalAccessException iae) {
2497                                        throw SQLError.createSQLException(
2498                                                        "Unable to initialize driver properties due to "
2499                                                                        + iae.toString(),
2500                                                        SQLError.SQL_STATE_GENERAL_ERROR);
2501                                }
2502                        }
2503 
2504                        // TODO -- Not yet
2505                        /*
2506                         * int numUnknownProperties = infoCopy.size(); if
2507                         * (numUnknownProperties > 0) { StringBuffer errorMessageBuf = new
2508                         * StringBuffer( "Unknown connection ");
2509                         * errorMessageBuf.append((numUnknownProperties == 1) ? "property " :
2510                         * "properties "); Iterator propNamesItor =
2511                         * infoCopy.keySet().iterator(); errorMessageBuf.append("'");
2512                         * errorMessageBuf.append(propNamesItor.next().toString());
2513                         * errorMessageBuf.append("'"); while (propNamesItor.hasNext()) {
2514                         * errorMessageBuf.append(", '");
2515                         * errorMessageBuf.append(propNamesItor.next().toString());
2516                         * errorMessageBuf.append("'"); } throw new
2517                         * SQLException(errorMessageBuf.toString(),
2518                         * SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE); }
2519                         */
2520                        postInitialization();
2521                }
2522        }
2523 
2524        protected void postInitialization() throws SQLException {
2525                //
2526                // Configure logger If the value has been set by the user, then use
2527                // that, otherwise, autodetect it : JDK1.4 logging, 
2528                // Then fallback to our STDERR logging.
2529                //
2530 
2531                //
2532                // Yes, this looks goofy (String == instead of .equals),
2533                // but it's how we tell whether we're using defaults
2534                // or not, and it survives JNDI/Properties initialization, etc.
2535                //
2536                
2537                if (getLogger() == STANDARD_LOGGER_NAME) {
2538                        String environmentLoggerName = null;
2539 
2540                        try {
2541                                environmentLoggerName = System
2542                                                .getProperty("com.mysql.jdbc.logger");
2543                        } catch (Throwable noAccessToSystemProperties) {
2544                                environmentLoggerName = null;
2545                        }
2546 
2547                        if (environmentLoggerName != null) {
2548                                setLogger(environmentLoggerName);
2549                        } else {        
2550                                try {
2551                                        // Are we running on JDK-1.4?
2552                                        Class.forName("java.util.logging.Level");
2553                                        setLogger(Jdk14Logger.class.getName());
2554                                } catch (Throwable t2) {
2555                                        // guess not
2556                                        setLogger(STANDARD_LOGGER_NAME);
2557                                }
2558                        }
2559                }
2560 
2561                // Support 'old' profileSql capitalization
2562                if (this.profileSql.getValueAsObject() != null) {
2563                        this.profileSQL.initializeFrom(this.profileSql.getValueAsObject()
2564                                        .toString());
2565                }
2566 
2567                this.reconnectTxAtEndAsBoolean = ((Boolean) this.reconnectAtTxEnd
2568                                .getValueAsObject()).booleanValue();
2569 
2570                // Adjust max rows
2571                if (this.getMaxRows() == 0) {
2572                        // adjust so that it will become MysqlDefs.MAX_ROWS
2573                        // in execSQL()
2574                        this.maxRows.setValueAsObject(new Integer(-1));
2575                }
2576 
2577                //
2578                // Check character encoding
2579                //
2580                String testEncoding = this.getEncoding();
2581 
2582                if (testEncoding != null) {
2583                        // Attempt to use the encoding, and bail out if it
2584                        // can't be used
2585                        try {
2586                                String testString = "abc";
2587                                testString.getBytes(testEncoding);
2588                        } catch (UnsupportedEncodingException UE) {
2589                                throw SQLError.createSQLException("Unsupported character " + "encoding '"
2590                                                + testEncoding + "'.", "0S100");
2591                        }
2592                }
2593 
2594                // Metadata caching is only supported on JDK-1.4 and newer
2595                // because it relies on LinkedHashMap being present.
2596                // Check (and disable) if not supported
2597                if (((Boolean) this.cacheResultSetMetadata.getValueAsObject())
2598                                .booleanValue()) {
2599                        try {
2600                                Class.forName("java.util.LinkedHashMap");
2601                        } catch (ClassNotFoundException cnfe) {
2602                                this.cacheResultSetMetadata.setValue(false);
2603                        }
2604                }
2605 
2606                this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2607                                .getValueAsBoolean();
2608                this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
2609                this.characterEncodingAsString = ((String) this.characterEncoding
2610                                .getValueAsObject());
2611                this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2612                this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2613                                .getValueAsBoolean();
2614                this.maxRowsAsInt = ((Integer) this.maxRows.getValueAsObject())
2615                                .intValue();
2616                this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
2617                this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
2618                                .getValueAsBoolean();
2619                this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
2620                                .getValueAsBoolean();
2621                this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2622                                .getValueAsBoolean();
2623                this.maintainTimeStatsAsBoolean = this.maintainTimeStats
2624                                .getValueAsBoolean();
2625        }
2626 
2627        /**
2628         * DOCUMENT ME!
2629         * 
2630         * @param property
2631         */
2632        public void setAllowLoadLocalInfile(boolean property) {
2633                this.allowLoadLocalInfile.setValue(property);
2634        }
2635 
2636        /**
2637         * DOCUMENT ME!
2638         * 
2639         * @param property
2640         */
2641        public void setAllowMultiQueries(boolean property) {
2642                this.allowMultiQueries.setValue(property);
2643        }
2644 
2645        /**
2646         * @param allowNanAndInf
2647         *            The allowNanAndInf to set.
2648         */
2649        public void setAllowNanAndInf(boolean flag) {
2650                this.allowNanAndInf.setValue(flag);
2651        }
2652 
2653        /**
2654         * @param allowUrlInLocalInfile
2655         *            The allowUrlInLocalInfile to set.
2656         */
2657        public void setAllowUrlInLocalInfile(boolean flag) {
2658                this.allowUrlInLocalInfile.setValue(flag);
2659        }
2660 
2661        /**
2662         * @param alwaysSendSetIsolation
2663         *            The alwaysSendSetIsolation to set.
2664         */
2665        public void setAlwaysSendSetIsolation(boolean flag) {
2666                this.alwaysSendSetIsolation.setValue(flag);
2667        }
2668 
2669        /**
2670         * @param autoDeserialize
2671         *            The autoDeserialize to set.
2672         */
2673        public void setAutoDeserialize(boolean flag) {
2674                this.autoDeserialize.setValue(flag);
2675        }
2676 
2677        public void setAutoGenerateTestcaseScript(boolean flag) {
2678                this.autoGenerateTestcaseScript.setValue(flag);
2679                this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2680                                .getValueAsBoolean();
2681        }
2682 
2683        /**
2684         * DOCUMENT ME!
2685         * 
2686         * @param flag
2687         *            The autoReconnect to set.
2688         */
2689        public void setAutoReconnect(boolean flag) {
2690                this.autoReconnect.setValue(flag);
2691        }
2692 
2693        /**
2694         * DOCUMENT ME!
2695         * 
2696         * @param property
2697         */
2698        public void setAutoReconnectForConnectionPools(boolean property) {
2699                this.autoReconnectForPools.setValue(property);
2700                this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2701                                .getValueAsBoolean();
2702        }
2703 
2704        /**
2705         * DOCUMENT ME!
2706         * 
2707         * @param flag
2708         *            The autoReconnectForPools to set.
2709         */
2710        public void setAutoReconnectForPools(boolean flag) {
2711                this.autoReconnectForPools.setValue(flag);
2712        }
2713 
2714        /**
2715         * @param blobSendChunkSize
2716         *            The blobSendChunkSize to set.
2717         */
2718        public void setBlobSendChunkSize(String value) throws SQLException {
2719                this.blobSendChunkSize.setValue(value);
2720        }
2721 
2722        /**
2723         * DOCUMENT ME!
2724         * 
2725         * @param flag
2726         *            The cacheCallableStatements to set.
2727         */
2728        public void setCacheCallableStatements(boolean flag) {
2729                this.cacheCallableStatements.setValue(flag);
2730        }
2731 
2732        /**
2733         * DOCUMENT ME!
2734         * 
2735         * @param flag
2736         *            The cachePreparedStatements to set.
2737         */
2738        public void setCachePreparedStatements(boolean flag) {
2739                this.cachePreparedStatements.setValue(flag);
2740        }
2741 
2742        /**
2743         * Sets whether or not we should cache result set metadata.
2744         * 
2745         * @param property
2746         */
2747        public void setCacheResultSetMetadata(boolean property) {
2748                this.cacheResultSetMetadata.setValue(property);
2749                this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2750                                .getValueAsBoolean();
2751        }
2752 
2753        /**
2754         * @param cacheServerConfiguration
2755         *            The cacheServerConfiguration to set.
2756         */
2757        public void setCacheServerConfiguration(boolean flag) {
2758                this.cacheServerConfiguration.setValue(flag);
2759        }
2760 
2761        /**
2762         * Configures the number of callable statements to cache. (this is
2763         * configurable during the life of the connection).
2764         * 
2765         * @param size
2766         *            The callableStatementCacheSize to set.
2767         */
2768        public void setCallableStatementCacheSize(int size) {
2769                this.callableStatementCacheSize.setValue(size);
2770        }
2771 
2772        /**
2773         * DOCUMENT ME!
2774         * 
2775         * @param property
2776         */
2777        public void setCapitalizeDBMDTypes(boolean property) {
2778                this.capitalizeTypeNames.setValue(property);
2779        }
2780 
2781        /**
2782         * DOCUMENT ME!
2783         * 
2784         * @param flag
2785         *            The capitalizeTypeNames to set.
2786         */
2787        public void setCapitalizeTypeNames(boolean flag) {
2788                this.capitalizeTypeNames.setValue(flag);
2789        }
2790 
2791        /**
2792         * DOCUMENT ME!
2793         * 
2794         * @param encoding
2795         *            The characterEncoding to set.
2796         */
2797        public void setCharacterEncoding(String encoding) {
2798                this.characterEncoding.setValue(encoding);
2799        }
2800 
2801        /**
2802         * DOCUMENT ME!
2803         * 
2804         * @param characterSet
2805         *            The characterSetResults to set.
2806         */
2807        public void setCharacterSetResults(String characterSet) {
2808                this.characterSetResults.setValue(characterSet);
2809        }
2810 
2811        /**
2812         * DOCUMENT ME!
2813         * 
2814         * @param flag
2815         *            The clobberStreamingResults to set.
2816         */
2817        public void setClobberStreamingResults(boolean flag) {
2818                this.clobberStreamingResults.setValue(flag);
2819        }
2820 
2821        public void setClobCharacterEncoding(String encoding) {
2822                this.clobCharacterEncoding.setValue(encoding);
2823        }
2824 
2825        /**
2826         * DOCUMENT ME!
2827         * 
2828         * @param collation
2829         *            The connectionCollation to set.
2830         */
2831        public void setConnectionCollation(String collation) {
2832                this.connectionCollation.setValue(collation);
2833        }
2834 
2835        /**
2836         * DOCUMENT ME!
2837         * 
2838         * @param timeoutMs
2839         */
2840        public void setConnectTimeout(int timeoutMs) {
2841                this.connectTimeout.setValue(timeoutMs);
2842        }
2843 
2844        /**
2845         * DOCUMENT ME!
2846         * 
2847         * @param property
2848         */
2849        public void setContinueBatchOnError(boolean property) {
2850                this.continueBatchOnError.setValue(property);
2851        }
2852 
2853        public void setCreateDatabaseIfNotExist(boolean flag) {
2854                this.createDatabaseIfNotExist.setValue(flag);
2855        }
2856 
2857        public void setDefaultFetchSize(int n) {
2858                this.defaultFetchSize.setValue(n);
2859        }
2860 
2861        /**
2862         * DOCUMENT ME!
2863         * 
2864         * @param property
2865         */
2866        public void setDetectServerPreparedStmts(boolean property) {
2867                this.detectServerPreparedStmts.setValue(property);
2868        }
2869 
2870        /**
2871         * @param dontTrackOpenResources
2872         *            The dontTrackOpenResources to set.
2873         */
2874        public void setDontTrackOpenResources(boolean flag) {
2875                this.dontTrackOpenResources.setValue(flag);
2876        }
2877 
2878        /**
2879         * DOCUMENT ME!
2880         * 
2881         * @param flag
2882         *            The dumpQueriesOnException to set.
2883         */
2884        public void setDumpQueriesOnException(boolean flag) {
2885                this.dumpQueriesOnException.setValue(flag);
2886        }
2887 
2888        /**
2889         * @param dynamicCalendars
2890         *            The dynamicCalendars to set.
2891         */
2892        public void setDynamicCalendars(boolean flag) {
2893                this.dynamicCalendars.setValue(flag);
2894        }
2895 
2896        /**
2897         * DOCUMENT ME!
2898         * 
2899         * @param flag
2900         *            The elideSetAutoCommits to set.
2901         */
2902        public void setElideSetAutoCommits(boolean flag) {
2903                this.elideSetAutoCommits.setValue(flag);
2904        }
2905 
2906        public void setEmptyStringsConvertToZero(boolean flag) {
2907                this.emptyStringsConvertToZero.setValue(flag);
2908        }
2909 
2910        /**
2911         * DOCUMENT ME!
2912         * 
2913         * @param property
2914         */
2915        public void setEmulateLocators(boolean property) {
2916                this.emulateLocators.setValue(property);
2917        }
2918 
2919        /**
2920         * @param emulateUnsupportedPstmts
2921         *            The emulateUnsupportedPstmts to set.
2922         */
2923        public void setEmulateUnsupportedPstmts(boolean flag) {
2924                this.emulateUnsupportedPstmts.setValue(flag);
2925        }
2926 
2927        /**
2928         * DOCUMENT ME!
2929         * 
2930         * @param flag
2931         *            The enablePacketDebug to set.
2932         */
2933        public void setEnablePacketDebug(boolean flag) {
2934                this.enablePacketDebug.setValue(flag);
2935        }
2936 
2937        /**
2938         * DOCUMENT ME!
2939         * 
2940         * @param property
2941         */
2942        public void setEncoding(String property) {
2943                this.characterEncoding.setValue(property);
2944                this.characterEncodingAsString = this.characterEncoding
2945                                .getValueAsString();
2946        }
2947 
2948        /**
2949         * DOCUMENT ME!
2950         * 
2951         * @param flag
2952         *            The explainSlowQueries to set.
2953         */
2954        public void setExplainSlowQueries(boolean flag) {
2955                this.explainSlowQueries.setValue(flag);
2956        }
2957 
2958        /**
2959         * DOCUMENT ME!
2960         * 
2961         * @param flag
2962         *            The failOverReadOnly to set.
2963         */
2964        public void setFailOverReadOnly(boolean flag) {
2965                this.failOverReadOnly.setValue(flag);
2966        }
2967 
2968        /**
2969         * DOCUMENT ME!
2970         * 
2971         * @param flag
2972         *            The gatherPerformanceMetrics to set.
2973         */
2974        public void setGatherPerformanceMetrics(boolean flag) {
2975                this.gatherPerformanceMetrics.setValue(flag);
2976        }
2977 
2978        /**
2979         * DOCUMENT ME!
2980         * 
2981         * @param property
2982         */
2983        protected void setHighAvailability(boolean property) {
2984                this.autoReconnect.setValue(property);
2985                this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2986        }
2987 
2988        /**
2989         * @param holdResultsOpenOverStatementClose
2990         *            The holdResultsOpenOverStatementClose to set.
2991         */
2992        public void setHoldResultsOpenOverStatementClose(boolean flag) {
2993                this.holdResultsOpenOverStatementClose.setValue(flag);
2994        }
2995 
2996        /**
2997         * DOCUMENT ME!
2998         * 
2999         * @param property
3000         */
3001        public void setIgnoreNonTxTables(boolean property) {
3002                this.ignoreNonTxTables.setValue(property);
3003        }
3004 
3005        /**
3006         * DOCUMENT ME!
3007         * 
3008         * @param property
3009         */
3010        public void setInitialTimeout(int property) {
3011                this.initialTimeout.setValue(property);
3012        }
3013 
3014        /**
3015         * DOCUMENT ME!
3016         * 
3017         * @param property
3018         */
3019        public void setIsInteractiveClient(boolean property) {
3020                this.isInteractiveClient.setValue(property);
3021        }
3022 
3023        /**
3024         * DOCUMENT ME!
3025         * 
3026         * @param flag
3027         *            The jdbcCompliantTruncation to set.
3028         */
3029        public void setJdbcCompliantTruncation(boolean flag) {
3030                this.jdbcCompliantTruncation.setValue(flag);
3031        }
3032 
3033        /**
3034         * @param locatorFetchBufferSize
3035         *            The locatorFetchBufferSize to set.
3036         */
3037        public void setLocatorFetchBufferSize(String value) throws SQLException {
3038                this.locatorFetchBufferSize.setValue(value);
3039        }
3040 
3041        /**
3042         * DOCUMENT ME!
3043         * 
3044         * @param property
3045         */
3046        public void setLogger(String property) {
3047                this.loggerClassName.setValueAsObject(property);
3048        }
3049 
3050        /**
3051         * DOCUMENT ME!
3052         * 
3053         * @param className
3054         *            The loggerClassName to set.
3055         */
3056        public void setLoggerClassName(String className) {
3057                this.loggerClassName.setValue(className);
3058        }
3059 
3060        /**
3061         * DOCUMENT ME!
3062         * 
3063         * @param flag
3064         *            The logSlowQueries to set.
3065         */
3066        public void setLogSlowQueries(boolean flag) {
3067                this.logSlowQueries.setValue(flag);
3068        }
3069 
3070        public void setMaintainTimeStats(boolean flag) {
3071                this.maintainTimeStats.setValue(flag);
3072                this.maintainTimeStatsAsBoolean = this.maintainTimeStats
3073                                .getValueAsBoolean();
3074        }
3075 
3076        /**
3077         * DOCUMENT ME!
3078         * 
3079         * @param sizeInBytes
3080         *            The maxQuerySizeToLog to set.
3081         */
3082        public void setMaxQuerySizeToLog(int sizeInBytes) {
3083                this.maxQuerySizeToLog.setValue(sizeInBytes);
3084        }
3085 
3086        /**
3087         * DOCUMENT ME!
3088         * 
3089         * @param property
3090         */
3091        public void setMaxReconnects(int property) {
3092                this.maxReconnects.setValue(property);
3093        }
3094 
3095        /**
3096         * DOCUMENT ME!
3097         * 
3098         * @param property
3099         */
3100        public void setMaxRows(int property) {
3101                this.maxRows.setValue(property);
3102                this.maxRowsAsInt = this.maxRows.getValueAsInt();
3103        }
3104 
3105        /**
3106         * Sets the number of queries that metadata can be cached if caching is
3107         * enabled.
3108         * 
3109         * @param value
3110         *            the number of queries to cache metadata for.
3111         */
3112        public void setMetadataCacheSize(int value) {
3113                this.metadataCacheSize.setValue(value);
3114        }
3115 
3116        /**
3117         * @param noDatetimeStringSync
3118         *            The noDatetimeStringSync to set.
3119         */
3120        public void setNoDatetimeStringSync(boolean flag) {
3121                this.noDatetimeStringSync.setValue(flag);
3122        }
3123 
3124        public void setNullCatalogMeansCurrent(boolean value) {
3125                this.nullCatalogMeansCurrent.setValue(value);
3126        }
3127 
3128        public void setNullNamePatternMatchesAll(boolean value) {
3129                this.nullNamePatternMatchesAll.setValue(value);
3130        }
3131 
3132        /**
3133         * DOCUMENT ME!
3134         * 
3135         * @param size
3136         *            The packetDebugBufferSize to set.
3137         */
3138        public void setPacketDebugBufferSize(int size) {
3139                this.packetDebugBufferSize.setValue(size);
3140        }
3141 
3142        /**
3143         * DOCUMENT ME!
3144         * 
3145         * @param property
3146         */
3147        public void setParanoid(boolean property) {
3148                this.paranoid.setValue(property);
3149        }
3150 
3151        /**
3152         * DOCUMENT ME!
3153         * 
3154         * @param property
3155         */
3156        public void setPedantic(boolean property) {
3157                this.pedantic.setValue(property);
3158        }
3159 
3160        /**
3161         * DOCUMENT ME!
3162         * 
3163         * @param cacheSize
3164         *            The preparedStatementCacheSize to set.
3165         */
3166        public void setPreparedStatementCacheSize(int cacheSize) {
3167                this.preparedStatementCacheSize.setValue(cacheSize);
3168        }
3169 
3170        /**
3171         * DOCUMENT ME!
3172         * 
3173         * @param cacheSqlLimit
3174         *            The preparedStatementCacheSqlLimit to set.
3175         */
3176        public void setPreparedStatementCacheSqlLimit(int cacheSqlLimit) {
3177                this.preparedStatementCacheSqlLimit.setValue(cacheSqlLimit);
3178        }
3179 
3180        /**
3181         * DOCUMENT ME!
3182         * 
3183         * @param property
3184         */
3185        public void setProfileSql(boolean property) {
3186                this.profileSQL.setValue(property);
3187                this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
3188        }
3189 
3190        /**
3191         * DOCUMENT ME!
3192         * 
3193         * @param flag
3194         *            The profileSQL to set.
3195         */
3196        public void setProfileSQL(boolean flag) {
3197                this.profileSQL.setValue(flag);
3198        }
3199 
3200        /**
3201         * @param propertiesTransform
3202         *            The propertiesTransform to set.
3203         */
3204        public void setPropertiesTransform(String value) {
3205                this.propertiesTransform.setValue(value);
3206        }
3207 
3208        /**
3209         * DOCUMENT ME!
3210         * 
3211         * @param property
3212         */
3213        public void setQueriesBeforeRetryMaster(int property) {
3214                this.queriesBeforeRetryMaster.setValue(property);
3215        }
3216 
3217        /**
3218         * DOCUMENT ME!
3219         * 
3220         * @param property
3221         */
3222        public void setReconnectAtTxEnd(boolean property) {
3223                this.reconnectAtTxEnd.setValue(property);
3224                this.reconnectTxAtEndAsBoolean = this.reconnectAtTxEnd
3225                                .getValueAsBoolean();
3226        }
3227 
3228        /**
3229         * DOCUMENT ME!
3230         * 
3231         * @param property
3232         */
3233        public void setRelaxAutoCommit(boolean property) {
3234                this.relaxAutoCommit.setValue(property);
3235        }
3236 
3237        /**
3238         * DOCUMENT ME!
3239         * 
3240         * @param millis
3241         *            The reportMetricsIntervalMillis to set.
3242         */
3243        public void setReportMetricsIntervalMillis(int millis) {
3244                this.reportMetricsIntervalMillis.setValue(millis);
3245        }
3246 
3247        /**
3248         * DOCUMENT ME!
3249         * 
3250         * @param property
3251         */
3252        public void setRequireSSL(boolean property) {
3253                this.requireSSL.setValue(property);
3254        }
3255 
3256        public void setRetainStatementAfterResultSetClose(boolean flag) {
3257                this.retainStatementAfterResultSetClose.setValue(flag);
3258        }
3259 
3260        /**
3261         * @param rollbackOnPooledClose
3262         *            The rollbackOnPooledClose to set.
3263         */
3264        public void setRollbackOnPooledClose(boolean flag) {
3265                this.rollbackOnPooledClose.setValue(flag);
3266        }
3267 
3268        /**
3269         * Sets whether or not hosts will be picked in a round-robin fashion.
3270         * 
3271         * @param flag
3272         *            The roundRobinLoadBalance property to set.
3273         */
3274        public void setRoundRobinLoadBalance(boolean flag) {
3275                this.roundRobinLoadBalance.setValue(flag);
3276        }
3277 
3278        /**
3279         * @param runningCTS13
3280         *            The runningCTS13 to set.
3281         */
3282        public void setRunningCTS13(boolean flag) {
3283                this.runningCTS13.setValue(flag);
3284        }
3285 
3286        /**
3287         * DOCUMENT ME!
3288         * 
3289         * @param property
3290         */
3291        public void setSecondsBeforeRetryMaster(int property) {
3292                this.secondsBeforeRetryMaster.setValue(property);
3293        }
3294 
3295        /**
3296         * DOCUMENT ME!
3297         * 
3298         * @param property
3299         *            DOCUMENT ME!
3300         */
3301        public void setServerTimezone(String property) {
3302                this.serverTimezone.setValue(property);
3303        }
3304 
3305        /**
3306         * @param sessionVariables
3307         *            The sessionVariables to set.
3308         */
3309        public void setSessionVariables(String variables) {
3310                this.sessionVariables.setValue(variables);
3311        }
3312 
3313        /**
3314         * DOCUMENT ME!
3315         * 
3316         * @param millis
3317         *            The slowQueryThresholdMillis to set.
3318         */
3319        public void setSlowQueryThresholdMillis(int millis) {
3320                this.slowQueryThresholdMillis.setValue(millis);
3321        }
3322 
3323        /**
3324         * DOCUMENT ME!
3325         * 
3326         * @param property
3327         */
3328        public void setSocketFactoryClassName(String property) {
3329                this.socketFactoryClassName.setValue(property);
3330        }
3331 
3332        /**
3333         * DOCUMENT ME!
3334         * 
3335         * @param property
3336         */
3337        public void setSocketTimeout(int property) {
3338                this.socketTimeout.setValue(property);
3339        }
3340 
3341        /**
3342         * DOCUMENT ME!
3343         * 
3344         * @param property
3345         */
3346        public void setStrictFloatingPoint(boolean property) {
3347                this.strictFloatingPoint.setValue(property);
3348        }
3349 
3350        /**
3351         * DOCUMENT ME!
3352         * 
3353         * @param property
3354         */
3355        public void setStrictUpdates(boolean property) {
3356                this.strictUpdates.setValue(property);
3357        }
3358 
3359        /**
3360         * @param tinyInt1isBit
3361         *            The tinyInt1isBit to set.
3362         */
3363        public void setTinyInt1isBit(boolean flag) {
3364                this.tinyInt1isBit.setValue(flag);
3365        }
3366 
3367        /**
3368         * DOCUMENT ME!
3369         * 
3370         * @param flag
3371         *            The logProtocol to set.
3372         */
3373        public void setTraceProtocol(boolean flag) {
3374                this.traceProtocol.setValue(flag);
3375        }
3376 
3377        public void setTransformedBitIsBoolean(boolean flag) {
3378                this.transformedBitIsBoolean.setValue(flag);
3379        }
3380 
3381        /**
3382         * DOCUMENT ME!
3383         * 
3384         * @param property
3385         */
3386        public void setUseCompression(boolean property) {
3387                this.useCompression.setValue(property);
3388        }
3389 
3390        /**
3391         * @param useFastIntParsing
3392         *            The useFastIntParsing to set.
3393         */
3394        public void setUseFastIntParsing(boolean flag) {
3395                this.useFastIntParsing.setValue(flag);
3396        }
3397 
3398        /**
3399         * DOCUMENT ME!
3400         * 
3401         * @param property
3402         */
3403        public void setUseHostsInPrivileges(boolean property) {
3404                this.useHostsInPrivileges.setValue(property);
3405        }
3406 
3407        public void setUseInformationSchema(boolean flag) {
3408                this.useInformationSchema.setValue(flag);
3409        }
3410 
3411        /**
3412         * @param useLocalSessionState
3413         *            The useLocalSessionState to set.
3414         */
3415        public void setUseLocalSessionState(boolean flag) {
3416                this.useLocalSessionState.setValue(flag);
3417        }
3418 
3419        /**
3420         * @param useOldUTF8Behavior
3421         *            The useOldUTF8Behavior to set.
3422         */
3423        public void setUseOldUTF8Behavior(boolean flag) {
3424                this.useOldUTF8Behavior.setValue(flag);
3425                this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
3426                                .getValueAsBoolean();
3427        }
3428 
3429        /**
3430         * @param useOnlyServerErrorMessages
3431         *            The useOnlyServerErrorMessages to set.
3432         */
3433        public void setUseOnlyServerErrorMessages(boolean flag) {
3434                this.useOnlyServerErrorMessages.setValue(flag);
3435        }
3436 
3437        /**
3438         * @param useReadAheadInput
3439         *            The useReadAheadInput to set.
3440         */
3441        public void setUseReadAheadInput(boolean flag) {
3442                this.useReadAheadInput.setValue(flag);
3443        }
3444 
3445        /**
3446         * DOCUMENT ME!
3447         * 
3448         * @param flag
3449         *            The detectServerPreparedStmts to set.
3450         */
3451        public void setUseServerPreparedStmts(boolean flag) {
3452                this.detectServerPreparedStmts.setValue(flag);
3453        }
3454 
3455        /**
3456         * DOCUMENT ME!
3457         * 
3458         * @param flag
3459         *            The useSqlStateCodes to set.
3460         */
3461        public void setUseSqlStateCodes(boolean flag) {
3462                this.useSqlStateCodes.setValue(flag);
3463        }
3464 
3465        /**
3466         * DOCUMENT ME!
3467         * 
3468         * @param property
3469         */
3470        public void setUseSSL(boolean property) {
3471                this.useSSL.setValue(property);
3472        }
3473 
3474        /**
3475         * DOCUMENT ME!
3476         * 
3477         * @param property
3478         */
3479        public void setUseStreamLengthsInPrepStmts(boolean property) {
3480                this.useStreamLengthsInPrepStmts.setValue(property);
3481        }
3482 
3483        /**
3484         * DOCUMENT ME!
3485         * 
3486         * @param property
3487         */
3488        public void setUseTimezone(boolean property) {
3489                this.useTimezone.setValue(property);
3490        }
3491 
3492        /**
3493         * DOCUMENT ME!
3494         * 
3495         * @param property
3496         */
3497        public void setUseUltraDevWorkAround(boolean property) {
3498                this.useUltraDevWorkAround.setValue(property);
3499        }
3500 
3501        /**
3502         * DOCUMENT ME!
3503         * 
3504         * @param flag
3505         *            The useUnbufferedInput to set.
3506         */
3507        public void setUseUnbufferedInput(boolean flag) {
3508                this.useUnbufferedInput.setValue(flag);
3509        }
3510 
3511        /**
3512         * DOCUMENT ME!
3513         * 
3514         * @param flag
3515         *            The useUnicode to set.
3516         */
3517        public void setUseUnicode(boolean flag) {
3518                this.useUnicode.setValue(flag);
3519                this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
3520        }
3521 
3522        /**
3523         * Sets whether or not the driver advises of proper usage.
3524         * 
3525         * @param useUsageAdvisorFlag
3526         *            whether or not the driver advises of proper usage.
3527         */
3528        public void setUseUsageAdvisor(boolean useUsageAdvisorFlag) {
3529                this.useUsageAdvisor.setValue(useUsageAdvisorFlag);
3530                this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
3531                                .getValueAsBoolean();
3532        }
3533 
3534        public void setYearIsDateType(boolean flag) {
3535                this.yearIsDateType.setValue(flag);
3536        }
3537 
3538        /**
3539         * @param zeroDateTimeBehavior
3540         *            The zeroDateTimeBehavior to set.
3541         */
3542        public void setZeroDateTimeBehavior(String behavior) {
3543                this.zeroDateTimeBehavior.setValue(behavior);
3544        }
3545 
3546        protected void storeToRef(Reference ref) throws SQLException {
3547                int numPropertiesToSet = PROPERTY_LIST.size();
3548 
3549                for (int i = 0; i < numPropertiesToSet; i++) {
3550                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
3551                                        .get(i);
3552 
3553                        try {
3554                                ConnectionProperty propToStore = (ConnectionProperty) propertyField
3555                                                .get(this);
3556 
3557                                if (ref != null) {
3558                                        propToStore.storeTo(ref);
3559                                }
3560                        } catch (IllegalAccessException iae) {
3561                                throw SQLError.createSQLException("Huh?");
3562                        }
3563                }
3564        }
3565 
3566        /**
3567         * DOCUMENT ME!
3568         * 
3569         * @return Returns the useUnbufferedInput.
3570         */
3571        public boolean useUnbufferedInput() {
3572                return this.useUnbufferedInput.getValueAsBoolean();
3573        }
3574 
3575        public boolean getUseCursorFetch() {
3576                return this.useCursorFetch.getValueAsBoolean();
3577        }
3578 
3579        public void setUseCursorFetch(boolean flag) {
3580                this.useCursorFetch.setValue(flag);
3581        }
3582 
3583        public boolean getOverrideSupportsIntegrityEnhancementFacility() {
3584                return this.overrideSupportsIntegrityEnhancementFacility.getValueAsBoolean();
3585        }
3586 
3587        public void setOverrideSupportsIntegrityEnhancementFacility(boolean flag) {
3588                this.overrideSupportsIntegrityEnhancementFacility.setValue(flag);        
3589        }
3590        
3591        public boolean getNoTimezoneConversionForTimeType() {
3592                return this.noTimezoneConversionForTimeType.getValueAsBoolean();
3593        }
3594 
3595        public void setNoTimezoneConversionForTimeType(boolean flag) {
3596                this.noTimezoneConversionForTimeType.setValue(flag);
3597        }
3598 
3599        public boolean getUseJDBCCompliantTimezoneShift() {
3600                return this.useJDBCCompliantTimezoneShift.getValueAsBoolean();
3601        }
3602 
3603        public void setUseJDBCCompliantTimezoneShift(boolean flag) {
3604                this.useJDBCCompliantTimezoneShift.setValue(flag);
3605        }
3606        
3607        public boolean getAutoClosePStmtStreams() {
3608                return this.autoClosePStmtStreams.getValueAsBoolean();
3609        }
3610 
3611        public void setAutoClosePStmtStreams(boolean flag) {
3612                this.autoClosePStmtStreams.setValue(flag);
3613        }
3614 
3615        public boolean getProcessEscapeCodesForPrepStmts() {
3616                return this.processEscapeCodesForPrepStmts.getValueAsBoolean();
3617        }
3618 
3619        public void setProcessEscapeCodesForPrepStmts(boolean flag) {
3620                this.processEscapeCodesForPrepStmts.setValue(flag);
3621        }
3622 
3623        public boolean getUseGmtMillisForDatetimes() {
3624                return this.useGmtMillisForDatetimes.getValueAsBoolean();
3625        }
3626 
3627        public void setUseGmtMillisForDatetimes(boolean flag) {
3628                this.useGmtMillisForDatetimes.setValue(flag);
3629        }
3630        
3631        public boolean getDumpMetadataOnColumnNotFound() {
3632                return this.dumpMetadataOnColumnNotFound.getValueAsBoolean();
3633        }
3634 
3635        public void setDumpMetadataOnColumnNotFound(boolean flag) {
3636                this.dumpMetadataOnColumnNotFound.setValue(flag);
3637        }
3638 
3639        public String getResourceId() {
3640                return this.resourceId.getValueAsString();
3641        }
3642 
3643        public void setResourceId(String resourceId) {
3644                this.resourceId.setValue(resourceId);
3645        }
3646        
3647        public boolean getRewriteBatchedStatements() {
3648                return this.rewriteBatchedStatements.getValueAsBoolean();
3649        }
3650 
3651        public void setRewriteBatchedStatements(boolean flag) {
3652                this.rewriteBatchedStatements.setValue(flag);
3653        }
3654        
3655        public boolean getJdbcCompliantTruncationForReads() {
3656                return this.jdbcCompliantTruncationForReads;
3657        }
3658 
3659        public void setJdbcCompliantTruncationForReads(
3660                        boolean jdbcCompliantTruncationForReads) {
3661                this.jdbcCompliantTruncationForReads = jdbcCompliantTruncationForReads;
3662        }
3663 
3664        public boolean getUseJvmCharsetConverters() {
3665                return this.useJvmCharsetConverters.getValueAsBoolean();
3666        }
3667 
3668        public void setUseJvmCharsetConverters(boolean flag) {
3669                this.useJvmCharsetConverters.setValue(flag);
3670        }
3671 
3672        public boolean getPinGlobalTxToPhysicalConnection() {
3673                return this.pinGlobalTxToPhysicalConnection.getValueAsBoolean();
3674        }
3675 
3676        public void setPinGlobalTxToPhysicalConnection(boolean flag) {
3677                this.pinGlobalTxToPhysicalConnection.setValue(flag);
3678        }
3679        
3680        /*
3681         * "Aliases" which match the property names to make using 
3682         * from datasources easier.
3683         */
3684        
3685        public void setUseServerPrepStmts(boolean flag) {
3686                setUseServerPreparedStmts(flag);
3687        }
3688 
3689        public boolean getUseServerPrepStmts() {
3690                return getUseServerPreparedStmts();
3691        }
3692 
3693        public void setCacheCallableStmts(boolean flag) {
3694                setCacheCallableStatements(flag);
3695        }
3696 
3697        public boolean getCacheCallableStmts() {
3698                return getCacheCallableStatements();
3699        }
3700 
3701        public void setCachePrepStmts(boolean flag) {
3702                setCachePreparedStatements(flag);
3703        }
3704 
3705        public boolean getCachePrepStmts() {
3706                return getCachePreparedStatements();
3707        }
3708 
3709        public void setCallableStmtCacheSize(int cacheSize) {
3710                setCallableStatementCacheSize(cacheSize);
3711        }
3712 
3713        public int getCallableStmtCacheSize() {
3714                return getCallableStatementCacheSize();
3715        }
3716 
3717        public void setPrepStmtCacheSize(int cacheSize) {
3718                setPreparedStatementCacheSize(cacheSize);
3719        }
3720 
3721        public int getPrepStmtCacheSize() {
3722                return getPreparedStatementCacheSize();
3723        }
3724 
3725        public void setPrepStmtCacheSqlLimit(int sqlLimit) {
3726                setPreparedStatementCacheSqlLimit(sqlLimit);
3727        }
3728 
3729        public int getPrepStmtCacheSqlLimit() {
3730                return getPreparedStatementCacheSqlLimit();
3731        }
3732 
3733        public boolean getNoAccessToProcedureBodies() {
3734                return this.noAccessToProcedureBodies.getValueAsBoolean();
3735        }
3736 
3737        public void setNoAccessToProcedureBodies(boolean flag) {
3738                this.noAccessToProcedureBodies.setValue(flag);
3739        }
3740 
3741 
3742}

[all classes][com.mysql.jdbc]
EMMA 2.0.4217 (C) Vladimir Roubtsov