EMMA Coverage Report (generated Mon Jul 24 20:22:52 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)67%  (2789/4133)52%  (440.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%  (2353/3473)50%  (347.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)67%  (111/166)62%  (26/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 noDatetimeStringSync = new BooleanConnectionProperty(
996                        "noDatetimeStringSync",
997                        false,
998                        "Don't ensure that ResultSet.getDatetimeType().toString().equals(ResultSet.getString())",
999                        "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
1000        
1001        private BooleanConnectionProperty noTimezoneConversionForTimeType = new BooleanConnectionProperty(
1002                        "noTimezoneConversionForTimeType",
1003                        false,
1004                        "Don't convert TIME values using the server timezone if 'useTimezone'='true'",
1005                        "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE);
1006 
1007        private BooleanConnectionProperty nullCatalogMeansCurrent = new BooleanConnectionProperty(
1008                        "nullCatalogMeansCurrent",
1009                        true,
1010                        "When DatabaseMetadataMethods ask for a 'catalog' parameter, does the value null mean use the current catalog? "
1011                                        + "(this is not JDBC-compliant, but follows legacy behavior from earlier versions of the driver)",
1012                        "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
1013 
1014        private BooleanConnectionProperty nullNamePatternMatchesAll = new BooleanConnectionProperty(
1015                        "nullNamePatternMatchesAll",
1016                        true,
1017                        "Should DatabaseMetaData methods that accept *pattern parameters treat null the same as '%' "
1018                                        + " (this is not JDBC-compliant, however older versions of the driver accepted this departure from the specification)",
1019                        "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
1020 
1021        private IntegerConnectionProperty packetDebugBufferSize = new IntegerConnectionProperty(
1022                        "packetDebugBufferSize",
1023                        20,
1024                        0,
1025                        Integer.MAX_VALUE,
1026                        "The maximum number of packets to retain when 'enablePacketDebug' is true",
1027                        "3.1.3", DEBUGING_PROFILING_CATEGORY, 7);
1028 
1029        private BooleanConnectionProperty paranoid = new BooleanConnectionProperty(
1030                        "paranoid",
1031                        false,
1032                        "Take measures to prevent exposure sensitive information in error messages and clear "
1033                                        + "data structures holding sensitive data when possible? (defaults to 'false')",
1034                        "3.0.1", SECURITY_CATEGORY, Integer.MIN_VALUE);
1035 
1036        private BooleanConnectionProperty pedantic = new BooleanConnectionProperty(
1037                        "pedantic", false, "Follow the JDBC spec to the letter.", "3.0.0",
1038                        MISC_CATEGORY, Integer.MIN_VALUE);
1039 
1040        private BooleanConnectionProperty pinGlobalTxToPhysicalConnection = new BooleanConnectionProperty(
1041                        "pinGlobalTxToPhysicalConnection", false, "When using XAConnections, should the driver ensure that "
1042                        + " operations on a given XID are always routed to the same physical connection? This allows the XAConnection"
1043                        + " to support \"XA START ... JOIN\" after \"XA END\" has been called",
1044                        "5.0.1", MISC_CATEGORY, Integer.MIN_VALUE);
1045        
1046        private IntegerConnectionProperty preparedStatementCacheSize = new IntegerConnectionProperty(
1047                        "prepStmtCacheSize", 25, 0, Integer.MAX_VALUE,
1048                        "If prepared statement caching is enabled, "
1049                                        + "how many prepared statements should be cached?",
1050                        "3.0.10", PERFORMANCE_CATEGORY, 10);
1051 
1052        private IntegerConnectionProperty preparedStatementCacheSqlLimit = new IntegerConnectionProperty(
1053                        "prepStmtCacheSqlLimit",
1054                        256,
1055                        1,
1056                        Integer.MAX_VALUE,
1057                        "If prepared statement caching is enabled, "
1058                                        + "what's the largest SQL the driver will cache the parsing for?",
1059                        "3.0.10", PERFORMANCE_CATEGORY, 11);
1060 
1061        private BooleanConnectionProperty processEscapeCodesForPrepStmts = 
1062                new BooleanConnectionProperty("processEscapeCodesForPrepStmts",
1063                                true,
1064                                "Should the driver process escape codes in queries that are prepared?",
1065                                "3.1.12",
1066                                MISC_CATEGORY, Integer.MIN_VALUE);
1067        
1068        private StringConnectionProperty profileSql = new StringConnectionProperty(
1069                        "profileSql",
1070                        null,
1071                        "Deprecated, use 'profileSQL' instead. Trace queries and their execution/fetch times on STDERR (true/false) defaults to 'false'",
1072                        "2.0.14", DEBUGING_PROFILING_CATEGORY, 3);
1073 
1074        private BooleanConnectionProperty profileSQL = new BooleanConnectionProperty(
1075                        "profileSQL",
1076                        false,
1077                        "Trace queries and their execution/fetch times to the configured logger (true/false) defaults to 'false'",
1078                        "3.1.0", DEBUGING_PROFILING_CATEGORY, 1);
1079 
1080        private boolean profileSQLAsBoolean = false;
1081 
1082        private StringConnectionProperty propertiesTransform = new StringConnectionProperty(
1083                        NonRegisteringDriver.PROPERTIES_TRANSFORM_KEY,
1084                        null,
1085                        "An implementation of com.mysql.jdbc.ConnectionPropertiesTransform that the driver will use to modify URL properties passed to the driver before attempting a connection",
1086                        "3.1.4", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1087 
1088        private IntegerConnectionProperty queriesBeforeRetryMaster = new IntegerConnectionProperty(
1089                        "queriesBeforeRetryMaster",
1090                        50,
1091                        1,
1092                        Integer.MAX_VALUE,
1093                        "Number of queries to issue before falling back to master when failed over "
1094                                        + "(when using multi-host failover). Whichever condition is met first, "
1095                                        + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1096                                        + "attempt to be made to reconnect to the master. Defaults to 50.",
1097                        "3.0.2", HA_CATEGORY, 7);
1098 
1099        private BooleanConnectionProperty reconnectAtTxEnd = new BooleanConnectionProperty(
1100                        "reconnectAtTxEnd", false,
1101                        "If autoReconnect is set to true, should the driver attempt reconnections"
1102                                        + "at the end of every transaction?", "3.0.10",
1103                        HA_CATEGORY, 4);
1104 
1105        private boolean reconnectTxAtEndAsBoolean = false;
1106 
1107        private BooleanConnectionProperty relaxAutoCommit = new BooleanConnectionProperty(
1108                        "relaxAutoCommit",
1109                        false,
1110                        "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')?",
1111                        "2.0.13", MISC_CATEGORY, Integer.MIN_VALUE);
1112 
1113        private IntegerConnectionProperty reportMetricsIntervalMillis = new IntegerConnectionProperty(
1114                        "reportMetricsIntervalMillis",
1115                        30000,
1116                        0,
1117                        Integer.MAX_VALUE,
1118                        "If 'gatherPerfMetrics' is enabled, how often should they be logged (in ms)?",
1119                        "3.1.2", DEBUGING_PROFILING_CATEGORY, 3);
1120 
1121        private BooleanConnectionProperty requireSSL = new BooleanConnectionProperty(
1122                        "requireSSL", false,
1123                        "Require SSL connection if useSSL=true? (defaults to 'false').",
1124                        "3.1.0", SECURITY_CATEGORY, 3);
1125 
1126        private StringConnectionProperty resourceId = new StringConnectionProperty(
1127                        "resourceId",
1128                        null, "A globally unique name that identifies the resource that this datasource or connection is " +
1129                        "connected to, used for XAResource.isSameRM() when the driver can't determine this value based on " +
1130                        "hostnames used in the URL",
1131                        "5.0.1",
1132                        HA_CATEGORY,
1133                        Integer.MIN_VALUE);
1134                        
1135        private BooleanConnectionProperty retainStatementAfterResultSetClose = new BooleanConnectionProperty(
1136                        "retainStatementAfterResultSetClose",
1137                        false,
1138                        "Should the driver retain the Statement reference in a ResultSet after ResultSet.close()"
1139                                        + " has been called. This is not JDBC-compliant after JDBC-4.0.",
1140                        "3.1.11", MISC_CATEGORY, Integer.MIN_VALUE);
1141        
1142        private BooleanConnectionProperty rewriteBatchedStatements = new BooleanConnectionProperty(
1143                        "rewriteBatchedStatements",
1144                        false, 
1145                        "Should the driver use multiqueries (irregardless of the setting of \"allowMultiQueries\") as well as "
1146                        + "rewriting of prepared statements for INSERT into multi-value inserts when executeBatch() is called? Notice that this has the potential "
1147                        + "for SQL injection if using plain java.sql.Statements and your code doesn't sanitize input correctly.\n\n"
1148                        + "Notice that for prepared statements, server-side prepared statements can not currently take advantage of "
1149                        + "this rewrite option, and that if you don't specify stream lengths when using PreparedStatement.set*Stream()," 
1150                        + "the driver won't be able to determine the optimium number of parameters per batch and you might receive an" 
1151                        + "an error from the driver that the resultant packet is too large.\n\n"
1152                        + "Statement.getGeneratedKeys() for these rewritten statements only works when the entire " 
1153                        + "batch includes INSERT statements.",
1154                        "3.1.13", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1155 
1156        private BooleanConnectionProperty rollbackOnPooledClose = new BooleanConnectionProperty(
1157                        "rollbackOnPooledClose",
1158                        true,
1159                        "Should the driver issue a rollback() when the logical connection in a pool is closed?",
1160                        "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1161 
1162        private BooleanConnectionProperty roundRobinLoadBalance = new BooleanConnectionProperty(
1163                        "roundRobinLoadBalance",
1164                        false,
1165                        "When autoReconnect is enabled, and failoverReadonly is false, should we pick hosts to connect to on a round-robin basis?",
1166                        "3.1.2", HA_CATEGORY, 5);
1167 
1168        private BooleanConnectionProperty runningCTS13 = new BooleanConnectionProperty(
1169                        "runningCTS13",
1170                        false,
1171                        "Enables workarounds for bugs in Sun's JDBC compliance testsuite version 1.3",
1172                        "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
1173 
1174        private IntegerConnectionProperty secondsBeforeRetryMaster = new IntegerConnectionProperty(
1175                        "secondsBeforeRetryMaster",
1176                        30,
1177                        1,
1178                        Integer.MAX_VALUE,
1179                        "How long should the driver wait, when failed over, before attempting "
1180                                        + "to reconnect to the master server? Whichever condition is met first, "
1181                                        + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1182                                        + "attempt to be made to reconnect to the master. Time in seconds, defaults to 30",
1183                        "3.0.2", HA_CATEGORY, 8);
1184 
1185        private StringConnectionProperty serverTimezone = new StringConnectionProperty(
1186                        "serverTimezone",
1187                        null,
1188                        "Override detection/mapping of timezone. Used when timezone from server doesn't map to Java timezone",
1189                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1190 
1191        private StringConnectionProperty sessionVariables = new StringConnectionProperty(
1192                        "sessionVariables", null,
1193                        "A comma-separated list of name/value pairs to be sent as SET SESSION ... to "
1194                                        + " the server when the driver connects.", "3.1.8",
1195                        MISC_CATEGORY, Integer.MAX_VALUE);
1196 
1197        private IntegerConnectionProperty slowQueryThresholdMillis = new IntegerConnectionProperty(
1198                        "slowQueryThresholdMillis",
1199                        2000,
1200                        0,
1201                        Integer.MAX_VALUE,
1202                        "If 'logSlowQueries' is enabled, how long should a query (in ms) before it is logged as 'slow'?",
1203                        "3.1.2", DEBUGING_PROFILING_CATEGORY, 9);
1204 
1205        private StringConnectionProperty socketFactoryClassName = new StringConnectionProperty(
1206                        "socketFactory",
1207                        StandardSocketFactory.class.getName(),
1208                        "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.",
1209                        "3.0.3", CONNECTION_AND_AUTH_CATEGORY, 4);
1210 
1211        private IntegerConnectionProperty socketTimeout = new IntegerConnectionProperty(
1212                        "socketTimeout",
1213                        0,
1214                        0,
1215                        Integer.MAX_VALUE,
1216                        "Timeout on network socket operations (0, the default means no timeout).",
1217                        "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 10);
1218 
1219        private BooleanConnectionProperty strictFloatingPoint = new BooleanConnectionProperty(
1220                        "strictFloatingPoint", false,
1221                        "Used only in older versions of compliance test", "3.0.0",
1222                        MISC_CATEGORY, Integer.MIN_VALUE);
1223 
1224        private BooleanConnectionProperty strictUpdates = new BooleanConnectionProperty(
1225                        "strictUpdates",
1226                        true,
1227                        "Should the driver do strict checking (all primary keys selected) of updatable result sets (true, false, defaults to 'true')?",
1228                        "3.0.4", MISC_CATEGORY, Integer.MIN_VALUE);
1229 
1230        private BooleanConnectionProperty overrideSupportsIntegrityEnhancementFacility =
1231                new BooleanConnectionProperty("overrideSupportsIntegrityEnhancementFacility",
1232                                false,
1233                                "Should the driver return \"true\" for DatabaseMetaData.supportsIntegrityEnhancementFacility() "
1234                                + "even if the database doesn't support it to workaround applications that require this method to return "
1235                                + "\"true\" to signal support of foreign keys, even though the SQL specification states that this facility "
1236                                + "contains much more than just foreign key support (one such application being OpenOffice)?",
1237                                "3.1.12", MISC_CATEGORY, Integer.MIN_VALUE);
1238        
1239        private BooleanConnectionProperty tinyInt1isBit = new BooleanConnectionProperty(
1240                        "tinyInt1isBit",
1241                        true,
1242                        "Should the driver treat the datatype TINYINT(1) as the BIT type "
1243                                        + "(because the server silently converts BIT -> TINYINT(1) when creating tables)?",
1244                        "3.0.16", MISC_CATEGORY, Integer.MIN_VALUE);
1245 
1246        private BooleanConnectionProperty traceProtocol = new BooleanConnectionProperty(
1247                        "traceProtocol", false,
1248                        "Should trace-level network protocol be logged?", "3.1.2",
1249                        DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
1250 
1251        private BooleanConnectionProperty transformedBitIsBoolean = new BooleanConnectionProperty(
1252                        "transformedBitIsBoolean",
1253                        false,
1254                        "If the driver converts TINYINT(1) to a different type, should it use BOOLEAN instead of BIT "
1255                                        + " for future compatibility with MySQL-5.0, as MySQL-5.0 has a BIT type?",
1256                        "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1257 
1258        private BooleanConnectionProperty useCompression = new BooleanConnectionProperty(
1259                        "useCompression",
1260                        false,
1261                        "Use zlib compression when communicating with the server (true/false)? Defaults to 'false'.",
1262                        "3.0.17", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1263 
1264        private StringConnectionProperty useConfig = new StringConnectionProperty(
1265                        "useConfigs",
1266                        null,
1267                        "Load the comma-delimited list of configuration properties before parsing the "
1268                                        + "URL or applying user-specified properties. These configurations are explained in the 'Configurations' of the documentation.",
1269                        "3.1.5", CONNECTION_AND_AUTH_CATEGORY, Integer.MAX_VALUE);
1270 
1271        private BooleanConnectionProperty useCursorFetch = new BooleanConnectionProperty(
1272                        "useCursorFetch",
1273                        false,
1274                        "If connected to MySQL > 5.0.2, and setFetchSize() > 0 on a statement, should "
1275                        + " that statement use cursor-based fetching to retrieve rows?",
1276                        "5.0.0", PERFORMANCE_CATEGORY, Integer.MAX_VALUE);
1277        
1278        private BooleanConnectionProperty useFastIntParsing = new BooleanConnectionProperty(
1279                        "useFastIntParsing",
1280                        true,
1281                        "Use internal String->Integer conversion routines to avoid excessive object creation?",
1282                        "3.1.4", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1283 
1284        private BooleanConnectionProperty useHostsInPrivileges = new BooleanConnectionProperty(
1285                        "useHostsInPrivileges",
1286                        true,
1287                        "Add '@hostname' to users in DatabaseMetaData.getColumn/TablePrivileges() (true/false), defaults to 'true'.",
1288                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1289        private BooleanConnectionProperty useInformationSchema = new BooleanConnectionProperty(
1290                        "useInformationSchema",
1291                        false,
1292                        "When connected to MySQL-5.0.7 or newer, should the driver use the INFORMATION_SCHEMA to " 
1293                        + " derive information used by DatabaseMetaData?",
1294                        "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE);
1295        private BooleanConnectionProperty useJDBCCompliantTimezoneShift = new BooleanConnectionProperty(
1296                        "useJDBCCompliantTimezoneShift",
1297                        false,
1298                        "Should the driver use JDBC-compliant rules when converting TIME/TIMESTAMP/DATETIME values' timezone information " +
1299                        "for those JDBC arguments which take a java.util.Calendar argument? (Notice that this " +
1300                        "option is exclusive of the \"useTimezone=true\" configuration option.)",
1301                        "5.0.0",
1302                        MISC_CATEGORY, Integer.MIN_VALUE);
1303        private BooleanConnectionProperty useLocalSessionState = new BooleanConnectionProperty(
1304                        "useLocalSessionState",
1305                        false,
1306                        "Should the driver refer to the internal values of autocommit and transaction isolation that are set "
1307                                        + " by Connection.setAutoCommit() and Connection.setTransactionIsolation(), rather than querying the database?",
1308                        "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1309 
1310        private BooleanConnectionProperty useOldUTF8Behavior = new BooleanConnectionProperty(
1311                        "useOldUTF8Behavior",
1312                        false,
1313                        "Use the UTF-8 behavior the driver did when communicating with 4.0 and older servers",
1314                        "3.1.6", MISC_CATEGORY, Integer.MIN_VALUE);
1315 
1316        private boolean useOldUTF8BehaviorAsBoolean = false;
1317 
1318        private BooleanConnectionProperty useOnlyServerErrorMessages = new BooleanConnectionProperty(
1319                        "useOnlyServerErrorMessages",
1320                        true,
1321                        "Don't prepend 'standard' SQLState error messages to error messages returned by the server.",
1322                        "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1323 
1324        private BooleanConnectionProperty useReadAheadInput = new BooleanConnectionProperty(
1325                        "useReadAheadInput",
1326                        true,
1327                        "Use newer, optimized non-blocking, buffered input stream when reading from the server?",
1328                        "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1329 
1330        private BooleanConnectionProperty useSqlStateCodes = new BooleanConnectionProperty(
1331                        "useSqlStateCodes",
1332                        true,
1333                        "Use SQL Standard state codes instead of 'legacy' X/Open/SQL state codes (true/false), default is 'true'",
1334                        "3.1.3", MISC_CATEGORY, Integer.MIN_VALUE);
1335 
1336        private BooleanConnectionProperty useSSL = new BooleanConnectionProperty(
1337                        "useSSL",
1338                        false,
1339                        "Use SSL when communicating with the server (true/false), defaults to 'false'",
1340                        "3.0.2", SECURITY_CATEGORY, 2);
1341 
1342        private BooleanConnectionProperty useStreamLengthsInPrepStmts = new BooleanConnectionProperty(
1343                        "useStreamLengthsInPrepStmts",
1344                        true,
1345                        "Honor stream length parameter in "
1346                                        + "PreparedStatement/ResultSet.setXXXStream() method calls (true/false, defaults to 'true')?",
1347                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1348 
1349        private BooleanConnectionProperty useTimezone = new BooleanConnectionProperty(
1350                        "useTimezone",
1351                        false,
1352                        "Convert time/date types between client and server timezones (true/false, defaults to 'false')?",
1353                        "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1354 
1355        private BooleanConnectionProperty useUltraDevWorkAround = new BooleanConnectionProperty(
1356                        "ultraDevHack",
1357                        false,
1358                        "Create PreparedStatements for prepareCall() when required, because UltraDev "
1359                                        + " is broken and issues a prepareCall() for _all_ statements? (true/false, defaults to 'false')",
1360                        "2.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
1361 
1362        private BooleanConnectionProperty useUnbufferedInput = new BooleanConnectionProperty(
1363                        "useUnbufferedInput", true,
1364                        "Don't use BufferedInputStream for reading data from the server",
1365                        "3.0.11", MISC_CATEGORY, Integer.MIN_VALUE);
1366 
1367        private BooleanConnectionProperty useUnicode = new BooleanConnectionProperty(
1368                        "useUnicode",
1369                        true,
1370                        "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'",
1371                        "1.1g", MISC_CATEGORY, 0);
1372 
1373        // Cache these values, they are 'hot'
1374        private boolean useUnicodeAsBoolean = true;
1375 
1376        private BooleanConnectionProperty useUsageAdvisor = new BooleanConnectionProperty(
1377                        "useUsageAdvisor",
1378                        false,
1379                        "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')?",
1380                        "3.1.1", DEBUGING_PROFILING_CATEGORY, 10);
1381 
1382        private boolean useUsageAdvisorAsBoolean = false;
1383 
1384        private BooleanConnectionProperty yearIsDateType = new BooleanConnectionProperty(
1385                        "yearIsDateType",
1386                        true,
1387                        "Should the JDBC driver treat the MySQL type \"YEAR\" as a java.sql.Date, or as a SHORT?",
1388                        "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1389 
1390        private StringConnectionProperty zeroDateTimeBehavior = new StringConnectionProperty(
1391                        "zeroDateTimeBehavior",
1392                        ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1393                        new String[] { ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1394                                        ZERO_DATETIME_BEHAVIOR_ROUND,
1395                                        ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL },
1396                        "What should happen when the driver encounters DATETIME values that are composed "
1397                                        + "entirely of zeroes (used by MySQL to represent invalid dates)? "
1398                                        + "Valid values are '"
1399                                        + ZERO_DATETIME_BEHAVIOR_EXCEPTION
1400                                        + "', '"
1401                                        + ZERO_DATETIME_BEHAVIOR_ROUND
1402                                        + "' and '"
1403                                        + ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL + "'.", "3.1.4",
1404                        MISC_CATEGORY, Integer.MIN_VALUE);
1405 
1406        private BooleanConnectionProperty useJvmCharsetConverters = new BooleanConnectionProperty("useJvmCharsetConverters",
1407                        true, "Always use the character encoding routines built into the JVM, rather than using "
1408                        + "lookup tables for single-byte character sets? (The default of \"true\" for this is appropriate for " 
1409                        + "newer JVMs", "5.0.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1410        
1411        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);
1412 
1413        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);
1414 
1415        protected DriverPropertyInfo[] exposeAsDriverPropertyInfoInternal(
1416                        Properties info, int slotsToReserve) throws SQLException {
1417                initializeProperties(info);
1418 
1419                int numProperties = PROPERTY_LIST.size();
1420 
1421                int listSize = numProperties + slotsToReserve;
1422 
1423                DriverPropertyInfo[] driverProperties = new DriverPropertyInfo[listSize];
1424 
1425                for (int i = slotsToReserve; i < listSize; i++) {
1426                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1427                                        .get(i - slotsToReserve);
1428 
1429                        try {
1430                                ConnectionProperty propToExpose = (ConnectionProperty) propertyField
1431                                                .get(this);
1432 
1433                                if (info != null) {
1434                                        propToExpose.initializeFrom(info);
1435                                }
1436 
1437                                
1438                                driverProperties[i] = propToExpose.getAsDriverPropertyInfo();
1439                        } catch (IllegalAccessException iae) {
1440                                throw SQLError.createSQLException("Internal properties failure",
1441                                                SQLError.SQL_STATE_GENERAL_ERROR);
1442                        }
1443                }
1444 
1445                return driverProperties;
1446        }
1447 
1448        protected Properties exposeAsProperties(Properties info)
1449                        throws SQLException {
1450                if (info == null) {
1451                        info = new Properties();
1452                }
1453 
1454                int numPropertiesToSet = PROPERTY_LIST.size();
1455 
1456                for (int i = 0; i < numPropertiesToSet; i++) {
1457                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1458                                        .get(i);
1459 
1460                        try {
1461                                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1462                                                .get(this);
1463 
1464                                Object propValue = propToGet.getValueAsObject();
1465 
1466                                if (propValue != null) {
1467                                        info.setProperty(propToGet.getPropertyName(), propValue
1468                                                        .toString());
1469                                }
1470                        } catch (IllegalAccessException iae) {
1471                                throw SQLError.createSQLException("Internal properties failure",
1472                                                SQLError.SQL_STATE_GENERAL_ERROR);
1473                        }
1474                }
1475 
1476                return info;
1477        }
1478 
1479        /**
1480         * Returns a description of the connection properties as an XML document.
1481         * 
1482         * @return the connection properties as an XML document.
1483         * @throws SQLException
1484         *             if an error occurs.
1485         */
1486        public String exposeAsXml() throws SQLException {
1487                StringBuffer xmlBuf = new StringBuffer();
1488                xmlBuf.append("<ConnectionProperties>");
1489 
1490                int numPropertiesToSet = PROPERTY_LIST.size();
1491 
1492                int numCategories = PROPERTY_CATEGORIES.length;
1493 
1494                Map propertyListByCategory = new HashMap();
1495 
1496                for (int i = 0; i < numCategories; i++) {
1497                        propertyListByCategory.put(PROPERTY_CATEGORIES[i], new Map[] {
1498                                        new TreeMap(), new TreeMap() });
1499                }
1500 
1501                //
1502                // The following properties are not exposed as 'normal' properties, but
1503                // they are
1504                // settable nonetheless, so we need to have them documented, make sure
1505                // that they sort 'first' as #1 and #2 in the category
1506                //
1507                StringConnectionProperty userProp = new StringConnectionProperty(
1508                                NonRegisteringDriver.USER_PROPERTY_KEY, null,
1509                                "The user to connect as", "all", CONNECTION_AND_AUTH_CATEGORY,
1510                                Integer.MIN_VALUE + 1);
1511                StringConnectionProperty passwordProp = new StringConnectionProperty(
1512                                NonRegisteringDriver.PASSWORD_PROPERTY_KEY, null,
1513                                "The password to use when connecting", "all",
1514                                CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE + 2);
1515 
1516                Map[] connectionSortMaps = (Map[]) propertyListByCategory
1517                                .get(CONNECTION_AND_AUTH_CATEGORY);
1518                connectionSortMaps[0].put(new Integer(userProp.getOrder()), userProp);
1519                connectionSortMaps[0].put(new Integer(passwordProp.getOrder()),
1520                                passwordProp);
1521 
1522                try {
1523                        for (int i = 0; i < numPropertiesToSet; i++) {
1524                                java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
1525                                                .get(i);
1526                                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1527                                                .get(this);
1528                                Map[] sortMaps = (Map[]) propertyListByCategory.get(propToGet
1529                                                .getCategoryName());
1530                                int orderInCategory = propToGet.getOrder();
1531 
1532                                if (orderInCategory == Integer.MIN_VALUE) {
1533                                        sortMaps[1].put(propToGet.getPropertyName(), propToGet);
1534                                } else {
1535                                        sortMaps[0].put(new Integer(orderInCategory), propToGet);
1536                                }
1537                        }
1538 
1539                        for (int j = 0; j < numCategories; j++) {
1540                                Map[] sortMaps = (Map[]) propertyListByCategory
1541                                                .get(PROPERTY_CATEGORIES[j]);
1542                                Iterator orderedIter = sortMaps[0].values().iterator();
1543                                Iterator alphaIter = sortMaps[1].values().iterator();
1544 
1545                                xmlBuf.append("\n <PropertyCategory name=\"");
1546                                xmlBuf.append(PROPERTY_CATEGORIES[j]);
1547                                xmlBuf.append("\">");
1548 
1549                                while (orderedIter.hasNext()) {
1550                                        ConnectionProperty propToGet = (ConnectionProperty) orderedIter
1551                                                        .next();
1552                                        
1553                                        xmlBuf.append("\n  <Property name=\"");
1554                                        xmlBuf.append(propToGet.getPropertyName());
1555                                        xmlBuf.append("\" required=\"");
1556                                        xmlBuf.append(propToGet.required ? "Yes" : "No");
1557 
1558                                        xmlBuf.append("\" default=\"");
1559 
1560                                        if (propToGet.getDefaultValue() != null) {
1561                                                xmlBuf.append(propToGet.getDefaultValue());
1562                                        }
1563 
1564                                        xmlBuf.append("\" sortOrder=\"");
1565                                        xmlBuf.append(propToGet.getOrder());
1566                                        xmlBuf.append("\" since=\"");
1567                                        xmlBuf.append(propToGet.sinceVersion);
1568                                        xmlBuf.append("\">\n");
1569                                        xmlBuf.append("    ");
1570                                        xmlBuf.append(propToGet.description);
1571                                        xmlBuf.append("\n  </Property>");
1572                                }
1573 
1574                                while (alphaIter.hasNext()) {
1575                                        ConnectionProperty propToGet = (ConnectionProperty) alphaIter
1576                                                        .next();
1577                                        
1578                                        xmlBuf.append("\n  <Property name=\"");
1579                                        xmlBuf.append(propToGet.getPropertyName());
1580                                        xmlBuf.append("\" required=\"");
1581                                        xmlBuf.append(propToGet.required ? "Yes" : "No");
1582 
1583                                        xmlBuf.append("\" default=\"");
1584 
1585                                        if (propToGet.getDefaultValue() != null) {
1586                                                xmlBuf.append(propToGet.getDefaultValue());
1587                                        }
1588 
1589                                        xmlBuf.append("\" sortOrder=\"alpha\" since=\"");
1590                                        xmlBuf.append(propToGet.sinceVersion);
1591                                        xmlBuf.append("\">\n");
1592                                        xmlBuf.append("    ");
1593                                        xmlBuf.append(propToGet.description);
1594                                        xmlBuf.append("\n  </Property>");
1595                                }
1596 
1597                                xmlBuf.append("\n </PropertyCategory>");
1598                        }
1599                } catch (IllegalAccessException iae) {
1600                        throw SQLError.createSQLException("Internal properties failure",
1601                                        SQLError.SQL_STATE_GENERAL_ERROR);
1602                }
1603 
1604                xmlBuf.append("\n</ConnectionProperties>");
1605 
1606                return xmlBuf.toString();
1607        }
1608 
1609        /**
1610         * DOCUMENT ME!
1611         * 
1612         * @return
1613         */
1614        public boolean getAllowLoadLocalInfile() {
1615                return this.allowLoadLocalInfile.getValueAsBoolean();
1616        }
1617 
1618        /**
1619         * DOCUMENT ME!
1620         * 
1621         * @return
1622         */
1623        public boolean getAllowMultiQueries() {
1624                return this.allowMultiQueries.getValueAsBoolean();
1625        }
1626 
1627        /**
1628         * @return Returns the allowNanAndInf.
1629         */
1630        protected boolean getAllowNanAndInf() {
1631                return allowNanAndInf.getValueAsBoolean();
1632        }
1633 
1634        /**
1635         * @return Returns the allowUrlInLocalInfile.
1636         */
1637        public boolean getAllowUrlInLocalInfile() {
1638                return this.allowUrlInLocalInfile.getValueAsBoolean();
1639        }
1640 
1641        /**
1642         * @return Returns the alwaysSendSetIsolation.
1643         */
1644        public boolean getAlwaysSendSetIsolation() {
1645                return this.alwaysSendSetIsolation.getValueAsBoolean();
1646        }
1647 
1648        /**
1649         * @return Returns the autoDeserialize.
1650         */
1651        public boolean getAutoDeserialize() {
1652                return autoDeserialize.getValueAsBoolean();
1653        }
1654 
1655        public boolean getAutoGenerateTestcaseScript() {
1656                return this.autoGenerateTestcaseScriptAsBoolean;
1657        }
1658 
1659        /**
1660         * DOCUMENT ME!
1661         * 
1662         * @return
1663         */
1664        public boolean getAutoReconnectForPools() {
1665                return this.autoReconnectForPoolsAsBoolean;
1666        }
1667 
1668        /**
1669         * @return Returns the blobSendChunkSize.
1670         */
1671        public int getBlobSendChunkSize() {
1672                return blobSendChunkSize.getValueAsInt();
1673        }
1674 
1675        /**
1676         * DOCUMENT ME!
1677         * 
1678         * @return Returns if cacheCallableStatements is enabled
1679         */
1680        public boolean getCacheCallableStatements() {
1681                return this.cacheCallableStatements.getValueAsBoolean();
1682        }
1683 
1684        /**
1685         * DOCUMENT ME!
1686         * 
1687         * @return Returns the cachePreparedStatements.
1688         */
1689        public boolean getCachePreparedStatements() {
1690                return ((Boolean) this.cachePreparedStatements.getValueAsObject())
1691                                .booleanValue();
1692        }
1693 
1694        /**
1695         * DOCUMENT ME!
1696         * 
1697         * @return DOCUMENT ME!
1698         */
1699        public boolean getCacheResultSetMetadata() {
1700                return this.cacheResultSetMetaDataAsBoolean;
1701        }
1702 
1703        /**
1704         * @return Returns the cacheServerConfiguration.
1705         */
1706        public boolean getCacheServerConfiguration() {
1707                return cacheServerConfiguration.getValueAsBoolean();
1708        }
1709 
1710        /**
1711         * DOCUMENT ME!
1712         * 
1713         * @return Returns the callableStatementCacheSize.
1714         */
1715        public int getCallableStatementCacheSize() {
1716                return this.callableStatementCacheSize.getValueAsInt();
1717        }
1718 
1719        /**
1720         * DOCUMENT ME!
1721         * 
1722         * @return
1723         */
1724        public boolean getCapitalizeTypeNames() {
1725                return this.capitalizeTypeNames.getValueAsBoolean();
1726        }
1727 
1728        /**
1729         * DOCUMENT ME!
1730         * 
1731         * @return Returns the characterSetResults.
1732         */
1733        public String getCharacterSetResults() {
1734                return this.characterSetResults.getValueAsString();
1735        }
1736 
1737        /**
1738         * DOCUMENT ME!
1739         * 
1740         * @return Returns the clobberStreamingResults.
1741         */
1742        public boolean getClobberStreamingResults() {
1743                return this.clobberStreamingResults.getValueAsBoolean();
1744        }
1745 
1746        public String getClobCharacterEncoding() {
1747                return this.clobCharacterEncoding.getValueAsString();
1748        }
1749 
1750        /**
1751         * DOCUMENT ME!
1752         * 
1753         * @return Returns the connectionCollation.
1754         */
1755        public String getConnectionCollation() {
1756                return this.connectionCollation.getValueAsString();
1757        }
1758 
1759        /**
1760         * DOCUMENT ME!
1761         * 
1762         * @return
1763         */
1764        public int getConnectTimeout() {
1765                return this.connectTimeout.getValueAsInt();
1766        }
1767 
1768        /**
1769         * DOCUMENT ME!
1770         * 
1771         * @return
1772         */
1773        public boolean getContinueBatchOnError() {
1774                return this.continueBatchOnError.getValueAsBoolean();
1775        }
1776 
1777        public boolean getCreateDatabaseIfNotExist() {
1778                return this.createDatabaseIfNotExist.getValueAsBoolean();
1779        }
1780 
1781        public int getDefaultFetchSize() {
1782                return this.defaultFetchSize.getValueAsInt();
1783        }
1784 
1785        /**
1786         * @return Returns the dontTrackOpenResources.
1787         */
1788        public boolean getDontTrackOpenResources() {
1789                return this.dontTrackOpenResources.getValueAsBoolean();
1790        }
1791 
1792        /**
1793         * DOCUMENT ME!
1794         * 
1795         * @return Returns the dumpQueriesOnException.
1796         */
1797        public boolean getDumpQueriesOnException() {
1798                return this.dumpQueriesOnException.getValueAsBoolean();
1799        }
1800 
1801        /**
1802         * @return Returns the dynamicCalendars.
1803         */
1804        public boolean getDynamicCalendars() {
1805                return this.dynamicCalendars.getValueAsBoolean();
1806        }
1807 
1808        /**
1809         * DOCUMENT ME!
1810         * 
1811         * @return Returns the elideSetAutoCommits.
1812         */
1813        public boolean getElideSetAutoCommits() {
1814                return this.elideSetAutoCommits.getValueAsBoolean();
1815        }
1816 
1817        public boolean getEmptyStringsConvertToZero() {
1818                return this.emptyStringsConvertToZero.getValueAsBoolean();
1819        }
1820 
1821        /**
1822         * DOCUMENT ME!
1823         * 
1824         * @return
1825         */
1826        public boolean getEmulateLocators() {
1827                return this.emulateLocators.getValueAsBoolean();
1828        }
1829 
1830        /**
1831         * @return Returns the emulateUnsupportedPstmts.
1832         */
1833        public boolean getEmulateUnsupportedPstmts() {
1834                return this.emulateUnsupportedPstmts.getValueAsBoolean();
1835        }
1836 
1837        /**
1838         * DOCUMENT ME!
1839         * 
1840         * @return Returns the enablePacketDebug.
1841         */
1842        public boolean getEnablePacketDebug() {
1843                return this.enablePacketDebug.getValueAsBoolean();
1844        }
1845 
1846        /**
1847         * DOCUMENT ME!
1848         * 
1849         * @return
1850         */
1851        protected String getEncoding() {
1852                return this.characterEncodingAsString;
1853        }
1854 
1855        /**
1856         * DOCUMENT ME!
1857         * 
1858         * @return Returns the explainSlowQueries.
1859         */
1860        public boolean getExplainSlowQueries() {
1861                return this.explainSlowQueries.getValueAsBoolean();
1862        }
1863 
1864        /**
1865         * DOCUMENT ME!
1866         * 
1867         * @return Returns the failOverReadOnly.
1868         */
1869        public boolean getFailOverReadOnly() {
1870                return this.failOverReadOnly.getValueAsBoolean();
1871        }
1872 
1873        /**
1874         * DOCUMENT ME!
1875         * 
1876         * @return Returns the gatherPerformanceMetrics.
1877         */
1878        public boolean getGatherPerformanceMetrics() {
1879                return this.gatherPerformanceMetrics.getValueAsBoolean();
1880        }
1881 
1882        /**
1883         * DOCUMENT ME!
1884         * 
1885         * @return
1886         */
1887        protected boolean getHighAvailability() {
1888                return this.highAvailabilityAsBoolean;
1889        }
1890 
1891        /**
1892         * @return Returns the holdResultsOpenOverStatementClose.
1893         */
1894        public boolean getHoldResultsOpenOverStatementClose() {
1895                return holdResultsOpenOverStatementClose.getValueAsBoolean();
1896        }
1897 
1898        /**
1899         * DOCUMENT ME!
1900         * 
1901         * @return
1902         */
1903        public boolean getIgnoreNonTxTables() {
1904                return this.ignoreNonTxTables.getValueAsBoolean();
1905        }
1906 
1907        /**
1908         * DOCUMENT ME!
1909         * 
1910         * @return
1911         */
1912        public int getInitialTimeout() {
1913                return this.initialTimeout.getValueAsInt();
1914        }
1915 
1916        /**
1917         * DOCUMENT ME!
1918         * 
1919         * @return
1920         */
1921        public boolean getInteractiveClient() {
1922                return this.isInteractiveClient.getValueAsBoolean();
1923        }
1924 
1925        /**
1926         * DOCUMENT ME!
1927         * 
1928         * @return Returns the isInteractiveClient.
1929         */
1930        public boolean getIsInteractiveClient() {
1931                return this.isInteractiveClient.getValueAsBoolean();
1932        }
1933 
1934        /**
1935         * DOCUMENT ME!
1936         * 
1937         * @return Returns the jdbcCompliantTruncation.
1938         */
1939        public boolean getJdbcCompliantTruncation() {
1940                return this.jdbcCompliantTruncation.getValueAsBoolean();
1941        }
1942 
1943        /**
1944         * @return Returns the dontTrackOpenResources.
1945         */
1946        public int getLocatorFetchBufferSize() {
1947                return this.locatorFetchBufferSize.getValueAsInt();
1948        }
1949 
1950        /**
1951         * DOCUMENT ME!
1952         * 
1953         * @return
1954         */
1955        public String getLogger() {
1956                return this.loggerClassName.getValueAsString();
1957        }
1958 
1959        /**
1960         * DOCUMENT ME!
1961         * 
1962         * @return Returns the loggerClassName.
1963         */
1964        public String getLoggerClassName() {
1965                return this.loggerClassName.getValueAsString();
1966        }
1967 
1968        /**
1969         * DOCUMENT ME!
1970         * 
1971         * @return Returns the logSlowQueries.
1972         */
1973        public boolean getLogSlowQueries() {
1974                return this.logSlowQueries.getValueAsBoolean();
1975        }
1976 
1977        public boolean getMaintainTimeStats() {
1978                return maintainTimeStatsAsBoolean;
1979        }
1980 
1981        /**
1982         * DOCUMENT ME!
1983         * 
1984         * @return Returns the maxQuerySizeToLog.
1985         */
1986        public int getMaxQuerySizeToLog() {
1987                return this.maxQuerySizeToLog.getValueAsInt();
1988        }
1989 
1990        /**
1991         * DOCUMENT ME!
1992         * 
1993         * @return
1994         */
1995        public int getMaxReconnects() {
1996                return this.maxReconnects.getValueAsInt();
1997        }
1998 
1999        /**
2000         * DOCUMENT ME!
2001         * 
2002         * @return
2003         */
2004        public int getMaxRows() {
2005                return this.maxRowsAsInt;
2006        }
2007 
2008        /**
2009         * Returns the number of queries that metadata can be cached if caching is
2010         * enabled.
2011         * 
2012         * @return the number of queries to cache metadata for.
2013         */
2014        public int getMetadataCacheSize() {
2015                return this.metadataCacheSize.getValueAsInt();
2016        }
2017 
2018        /**
2019         * @return Returns the noDatetimeStringSync.
2020         */
2021        public boolean getNoDatetimeStringSync() {
2022                return this.noDatetimeStringSync.getValueAsBoolean();
2023        }
2024 
2025        public boolean getNullCatalogMeansCurrent() {
2026                return this.nullCatalogMeansCurrent.getValueAsBoolean();
2027        }
2028 
2029        public boolean getNullNamePatternMatchesAll() {
2030                return this.nullNamePatternMatchesAll.getValueAsBoolean();
2031        }
2032 
2033        /**
2034         * DOCUMENT ME!
2035         * 
2036         * @return Returns the packetDebugBufferSize.
2037         */
2038        public int getPacketDebugBufferSize() {
2039                return this.packetDebugBufferSize.getValueAsInt();
2040        }
2041 
2042        /**
2043         * DOCUMENT ME!
2044         * 
2045         * @return
2046         */
2047        public boolean getParanoid() {
2048                return this.paranoid.getValueAsBoolean();
2049        }
2050 
2051        /**
2052         * DOCUMENT ME!
2053         * 
2054         * @return
2055         */
2056        public boolean getPedantic() {
2057                return this.pedantic.getValueAsBoolean();
2058        }
2059 
2060        /**
2061         * DOCUMENT ME!
2062         * 
2063         * @return Returns the preparedStatementCacheSize.
2064         */
2065        public int getPreparedStatementCacheSize() {
2066                return ((Integer) this.preparedStatementCacheSize.getValueAsObject())
2067                                .intValue();
2068        }
2069 
2070        /**
2071         * DOCUMENT ME!
2072         * 
2073         * @return Returns the preparedStatementCacheSqlLimit.
2074         */
2075        public int getPreparedStatementCacheSqlLimit() {
2076                return ((Integer) this.preparedStatementCacheSqlLimit
2077                                .getValueAsObject()).intValue();
2078        }
2079 
2080        /**
2081         * DOCUMENT ME!
2082         * 
2083         * @return
2084         */
2085        public boolean getProfileSql() {
2086                return this.profileSQLAsBoolean;
2087        }
2088 
2089        /**
2090         * DOCUMENT ME!
2091         * 
2092         * @return Returns the profileSQL flag
2093         */
2094        public boolean getProfileSQL() {
2095                return this.profileSQL.getValueAsBoolean();
2096        }
2097 
2098        /**
2099         * @return Returns the propertiesTransform.
2100         */
2101        public String getPropertiesTransform() {
2102                return this.propertiesTransform.getValueAsString();
2103        }
2104 
2105        /**
2106         * DOCUMENT ME!
2107         * 
2108         * @return
2109         */
2110        public int getQueriesBeforeRetryMaster() {
2111                return this.queriesBeforeRetryMaster.getValueAsInt();
2112        }
2113 
2114        /**
2115         * DOCUMENT ME!
2116         * 
2117         * @return
2118         */
2119        public boolean getReconnectAtTxEnd() {
2120                return this.reconnectTxAtEndAsBoolean;
2121        }
2122 
2123        /**
2124         * DOCUMENT ME!
2125         * 
2126         * @return
2127         */
2128        public boolean getRelaxAutoCommit() {
2129                return this.relaxAutoCommit.getValueAsBoolean();
2130        }
2131 
2132        /**
2133         * DOCUMENT ME!
2134         * 
2135         * @return Returns the reportMetricsIntervalMillis.
2136         */
2137        public int getReportMetricsIntervalMillis() {
2138                return this.reportMetricsIntervalMillis.getValueAsInt();
2139        }
2140 
2141        /**
2142         * DOCUMENT ME!
2143         * 
2144         * @return
2145         */
2146        public boolean getRequireSSL() {
2147                return this.requireSSL.getValueAsBoolean();
2148        }
2149 
2150        protected boolean getRetainStatementAfterResultSetClose() {
2151                return this.retainStatementAfterResultSetClose.getValueAsBoolean();
2152        }
2153 
2154        /**
2155         * @return Returns the rollbackOnPooledClose.
2156         */
2157        public boolean getRollbackOnPooledClose() {
2158                return this.rollbackOnPooledClose.getValueAsBoolean();
2159        }
2160 
2161        /**
2162         * Returns whether or not hosts will be picked in a round-robin fashion.
2163         * 
2164         * @return Returns the roundRobinLoadBalance property.
2165         */
2166        public boolean getRoundRobinLoadBalance() {
2167                return this.roundRobinLoadBalance.getValueAsBoolean();
2168        }
2169 
2170        /**
2171         * @return Returns the runningCTS13.
2172         */
2173        public boolean getRunningCTS13() {
2174                return this.runningCTS13.getValueAsBoolean();
2175        }
2176 
2177        /**
2178         * DOCUMENT ME!
2179         * 
2180         * @return
2181         */
2182        public int getSecondsBeforeRetryMaster() {
2183                return this.secondsBeforeRetryMaster.getValueAsInt();
2184        }
2185 
2186        /**
2187         * Returns the 'serverTimezone' property.
2188         * 
2189         * @return the configured server timezone property.
2190         */
2191        public String getServerTimezone() {
2192                return this.serverTimezone.getValueAsString();
2193        }
2194 
2195        /**
2196         * @return Returns the sessionVariables.
2197         */
2198        public String getSessionVariables() {
2199                return sessionVariables.getValueAsString();
2200        }
2201 
2202        /**
2203         * DOCUMENT ME!
2204         * 
2205         * @return Returns the slowQueryThresholdMillis.
2206         */
2207        public int getSlowQueryThresholdMillis() {
2208                return this.slowQueryThresholdMillis.getValueAsInt();
2209        }
2210 
2211        /**
2212         * DOCUMENT ME!
2213         * 
2214         * @return
2215         */
2216        public String getSocketFactoryClassName() {
2217                return this.socketFactoryClassName.getValueAsString();
2218        }
2219 
2220        /**
2221         * DOCUMENT ME!
2222         * 
2223         * @return
2224         */
2225        public int getSocketTimeout() {
2226                return this.socketTimeout.getValueAsInt();
2227        }
2228 
2229        /**
2230         * DOCUMENT ME!
2231         * 
2232         * @return
2233         */
2234        public boolean getStrictFloatingPoint() {
2235                return this.strictFloatingPoint.getValueAsBoolean();
2236        }
2237 
2238        /**
2239         * DOCUMENT ME!
2240         * 
2241         * @return
2242         */
2243        public boolean getStrictUpdates() {
2244                return this.strictUpdates.getValueAsBoolean();
2245        }
2246 
2247        /**
2248         * @return Returns the tinyInt1isBit.
2249         */
2250        public boolean getTinyInt1isBit() {
2251                return this.tinyInt1isBit.getValueAsBoolean();
2252        }
2253 
2254        /**
2255         * DOCUMENT ME!
2256         * 
2257         * @return Returns the logProtocol.
2258         */
2259        public boolean getTraceProtocol() {
2260                return this.traceProtocol.getValueAsBoolean();
2261        }
2262 
2263        public boolean getTransformedBitIsBoolean() {
2264                return this.transformedBitIsBoolean.getValueAsBoolean();
2265        }
2266 
2267        /**
2268         * DOCUMENT ME!
2269         * 
2270         * @return
2271         */
2272        public boolean getUseCompression() {
2273                return this.useCompression.getValueAsBoolean();
2274        }
2275 
2276        /**
2277         * @return Returns the useFastIntParsing.
2278         */
2279        public boolean getUseFastIntParsing() {
2280                return this.useFastIntParsing.getValueAsBoolean();
2281        }
2282 
2283        /**
2284         * DOCUMENT ME!
2285         * 
2286         * @return
2287         */
2288        public boolean getUseHostsInPrivileges() {
2289                return this.useHostsInPrivileges.getValueAsBoolean();
2290        }
2291 
2292        public boolean getUseInformationSchema() {
2293                return this.useInformationSchema.getValueAsBoolean();
2294        }
2295 
2296        /**
2297         * @return Returns the useLocalSessionState.
2298         */
2299        public boolean getUseLocalSessionState() {
2300                return this.useLocalSessionState.getValueAsBoolean();
2301        }
2302 
2303        /**
2304         * @return Returns the useOldUTF8Behavior.
2305         */
2306        public boolean getUseOldUTF8Behavior() {
2307                return this.useOldUTF8BehaviorAsBoolean;
2308        }
2309 
2310        /**
2311         * @return Returns the useOnlyServerErrorMessages.
2312         */
2313        public boolean getUseOnlyServerErrorMessages() {
2314                return this.useOnlyServerErrorMessages.getValueAsBoolean();
2315        }
2316 
2317        /**
2318         * @return Returns the useReadAheadInput.
2319         */
2320        public boolean getUseReadAheadInput() {
2321                return this.useReadAheadInput.getValueAsBoolean();
2322        }
2323 
2324        /**
2325         * DOCUMENT ME!
2326         * 
2327         * @return
2328         */
2329        public boolean getUseServerPreparedStmts() {
2330                return this.detectServerPreparedStmts.getValueAsBoolean();
2331        }
2332 
2333        /**
2334         * DOCUMENT ME!
2335         * 
2336         * @return Returns the useSqlStateCodes state.
2337         */
2338        public boolean getUseSqlStateCodes() {
2339                return this.useSqlStateCodes.getValueAsBoolean();
2340        }
2341 
2342        /**
2343         * DOCUMENT ME!
2344         * 
2345         * @return
2346         */
2347        public boolean getUseSSL() {
2348                return this.useSSL.getValueAsBoolean();
2349        }
2350 
2351        /**
2352         * DOCUMENT ME!
2353         * 
2354         * @return
2355         */
2356        public boolean getUseStreamLengthsInPrepStmts() {
2357                return this.useStreamLengthsInPrepStmts.getValueAsBoolean();
2358        }
2359 
2360        /**
2361         * DOCUMENT ME!
2362         * 
2363         * @return
2364         */
2365        public boolean getUseTimezone() {
2366                return this.useTimezone.getValueAsBoolean();
2367        }
2368 
2369        /**
2370         * DOCUMENT ME!
2371         * 
2372         * @return
2373         */
2374        public boolean getUseUltraDevWorkAround() {
2375                return this.useUltraDevWorkAround.getValueAsBoolean();
2376        }
2377 
2378        /**
2379         * DOCUMENT ME!
2380         * 
2381         * @return Returns the useUnbufferedInput.
2382         */
2383        public boolean getUseUnbufferedInput() {
2384                return this.useUnbufferedInput.getValueAsBoolean();
2385        }
2386 
2387        /**
2388         * DOCUMENT ME!
2389         * 
2390         * @return
2391         */
2392        public boolean getUseUnicode() {
2393                return this.useUnicodeAsBoolean;
2394        }
2395 
2396        /**
2397         * Returns whether or not the driver advises of proper usage.
2398         * 
2399         * @return the value of useUsageAdvisor
2400         */
2401        public boolean getUseUsageAdvisor() {
2402                return this.useUsageAdvisorAsBoolean;
2403        }
2404 
2405        public boolean getYearIsDateType() {
2406                return this.yearIsDateType.getValueAsBoolean();
2407        }
2408 
2409        /**
2410         * @return Returns the zeroDateTimeBehavior.
2411         */
2412        public String getZeroDateTimeBehavior() {
2413                return this.zeroDateTimeBehavior.getValueAsString();
2414        }
2415 
2416        /**
2417         * Initializes driver properties that come from a JNDI reference (in the
2418         * case of a javax.sql.DataSource bound into some name service that doesn't
2419         * handle Java objects directly).
2420         * 
2421         * @param ref
2422         *            The JNDI Reference that holds RefAddrs for all properties
2423         * @throws SQLException
2424         *             DOCUMENT ME!
2425         */
2426        protected void initializeFromRef(Reference ref) throws SQLException {
2427                int numPropertiesToSet = PROPERTY_LIST.size();
2428 
2429                for (int i = 0; i < numPropertiesToSet; i++) {
2430                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
2431                                        .get(i);
2432 
2433                        try {
2434                                ConnectionProperty propToSet = (ConnectionProperty) propertyField
2435                                                .get(this);
2436 
2437                                if (ref != null) {
2438                                        propToSet.initializeFrom(ref);
2439                                }
2440                        } catch (IllegalAccessException iae) {
2441                                throw SQLError.createSQLException("Internal properties failure",
2442                                                SQLError.SQL_STATE_GENERAL_ERROR);
2443                        }
2444                }
2445 
2446                postInitialization();
2447        }
2448 
2449        /**
2450         * Initializes driver properties that come from URL or properties passed to
2451         * the driver manager.
2452         * 
2453         * @param info
2454         *            DOCUMENT ME!
2455         * @throws SQLException
2456         *             DOCUMENT ME!
2457         */
2458        protected void initializeProperties(Properties info) throws SQLException {
2459                if (info != null) {
2460                        // For backwards-compatibility
2461                        String profileSqlLc = info.getProperty("profileSql");
2462 
2463                        if (profileSqlLc != null) {
2464                                info.put("profileSQL", profileSqlLc);
2465                        }
2466 
2467                        Properties infoCopy = (Properties) info.clone();
2468 
2469                        infoCopy.remove(NonRegisteringDriver.HOST_PROPERTY_KEY);
2470                        infoCopy.remove(NonRegisteringDriver.USER_PROPERTY_KEY);
2471                        infoCopy.remove(NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
2472                        infoCopy.remove(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
2473                        infoCopy.remove(NonRegisteringDriver.PORT_PROPERTY_KEY);
2474                        infoCopy.remove("profileSql");
2475 
2476                        int numPropertiesToSet = PROPERTY_LIST.size();
2477 
2478                        for (int i = 0; i < numPropertiesToSet; i++) {
2479                                java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
2480                                                .get(i);
2481 
2482                                try {
2483                                        ConnectionProperty propToSet = (ConnectionProperty) propertyField
2484                                                        .get(this);
2485 
2486                                        propToSet.initializeFrom(infoCopy);
2487                                } catch (IllegalAccessException iae) {
2488                                        throw SQLError.createSQLException(
2489                                                        "Unable to initialize driver properties due to "
2490                                                                        + iae.toString(),
2491                                                        SQLError.SQL_STATE_GENERAL_ERROR);
2492                                }
2493                        }
2494 
2495                        // TODO -- Not yet
2496                        /*
2497                         * int numUnknownProperties = infoCopy.size(); if
2498                         * (numUnknownProperties > 0) { StringBuffer errorMessageBuf = new
2499                         * StringBuffer( "Unknown connection ");
2500                         * errorMessageBuf.append((numUnknownProperties == 1) ? "property " :
2501                         * "properties "); Iterator propNamesItor =
2502                         * infoCopy.keySet().iterator(); errorMessageBuf.append("'");
2503                         * errorMessageBuf.append(propNamesItor.next().toString());
2504                         * errorMessageBuf.append("'"); while (propNamesItor.hasNext()) {
2505                         * errorMessageBuf.append(", '");
2506                         * errorMessageBuf.append(propNamesItor.next().toString());
2507                         * errorMessageBuf.append("'"); } throw new
2508                         * SQLException(errorMessageBuf.toString(),
2509                         * SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE); }
2510                         */
2511                        postInitialization();
2512                }
2513        }
2514 
2515        protected void postInitialization() throws SQLException {
2516                //
2517                // Configure logger If the value has been set by the user, then use
2518                // that, otherwise, autodetect it : JDK1.4 logging, 
2519                // Then fallback to our STDERR logging.
2520                //
2521 
2522                //
2523                // Yes, this looks goofy (String == instead of .equals),
2524                // but it's how we tell whether we're using defaults
2525                // or not, and it survives JNDI/Properties initialization, etc.
2526                //
2527                
2528                if (getLogger() == STANDARD_LOGGER_NAME) {
2529                        String environmentLoggerName = null;
2530 
2531                        try {
2532                                environmentLoggerName = System
2533                                                .getProperty("com.mysql.jdbc.logger");
2534                        } catch (Throwable noAccessToSystemProperties) {
2535                                environmentLoggerName = null;
2536                        }
2537 
2538                        if (environmentLoggerName != null) {
2539                                setLogger(environmentLoggerName);
2540                        } else {        
2541                                try {
2542                                        // Are we running on JDK-1.4?
2543                                        Class.forName("java.util.logging.Level");
2544                                        setLogger(Jdk14Logger.class.getName());
2545                                } catch (Throwable t2) {
2546                                        // guess not
2547                                        setLogger(STANDARD_LOGGER_NAME);
2548                                }
2549                        }
2550                }
2551 
2552                // Support 'old' profileSql capitalization
2553                if (this.profileSql.getValueAsObject() != null) {
2554                        this.profileSQL.initializeFrom(this.profileSql.getValueAsObject()
2555                                        .toString());
2556                }
2557 
2558                this.reconnectTxAtEndAsBoolean = ((Boolean) this.reconnectAtTxEnd
2559                                .getValueAsObject()).booleanValue();
2560 
2561                // Adjust max rows
2562                if (this.getMaxRows() == 0) {
2563                        // adjust so that it will become MysqlDefs.MAX_ROWS
2564                        // in execSQL()
2565                        this.maxRows.setValueAsObject(new Integer(-1));
2566                }
2567 
2568                //
2569                // Check character encoding
2570                //
2571                String testEncoding = this.getEncoding();
2572 
2573                if (testEncoding != null) {
2574                        // Attempt to use the encoding, and bail out if it
2575                        // can't be used
2576                        try {
2577                                String testString = "abc";
2578                                testString.getBytes(testEncoding);
2579                        } catch (UnsupportedEncodingException UE) {
2580                                throw SQLError.createSQLException("Unsupported character " + "encoding '"
2581                                                + testEncoding + "'.", "0S100");
2582                        }
2583                }
2584 
2585                // Metadata caching is only supported on JDK-1.4 and newer
2586                // because it relies on LinkedHashMap being present.
2587                // Check (and disable) if not supported
2588                if (((Boolean) this.cacheResultSetMetadata.getValueAsObject())
2589                                .booleanValue()) {
2590                        try {
2591                                Class.forName("java.util.LinkedHashMap");
2592                        } catch (ClassNotFoundException cnfe) {
2593                                this.cacheResultSetMetadata.setValue(false);
2594                        }
2595                }
2596 
2597                this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2598                                .getValueAsBoolean();
2599                this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
2600                this.characterEncodingAsString = ((String) this.characterEncoding
2601                                .getValueAsObject());
2602                this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2603                this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2604                                .getValueAsBoolean();
2605                this.maxRowsAsInt = ((Integer) this.maxRows.getValueAsObject())
2606                                .intValue();
2607                this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
2608                this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
2609                                .getValueAsBoolean();
2610                this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
2611                                .getValueAsBoolean();
2612                this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2613                                .getValueAsBoolean();
2614                this.maintainTimeStatsAsBoolean = this.maintainTimeStats
2615                                .getValueAsBoolean();
2616        }
2617 
2618        /**
2619         * DOCUMENT ME!
2620         * 
2621         * @param property
2622         */
2623        public void setAllowLoadLocalInfile(boolean property) {
2624                this.allowLoadLocalInfile.setValue(property);
2625        }
2626 
2627        /**
2628         * DOCUMENT ME!
2629         * 
2630         * @param property
2631         */
2632        public void setAllowMultiQueries(boolean property) {
2633                this.allowMultiQueries.setValue(property);
2634        }
2635 
2636        /**
2637         * @param allowNanAndInf
2638         *            The allowNanAndInf to set.
2639         */
2640        protected void setAllowNanAndInf(boolean flag) {
2641                this.allowNanAndInf.setValue(flag);
2642        }
2643 
2644        /**
2645         * @param allowUrlInLocalInfile
2646         *            The allowUrlInLocalInfile to set.
2647         */
2648        public void setAllowUrlInLocalInfile(boolean flag) {
2649                this.allowUrlInLocalInfile.setValue(flag);
2650        }
2651 
2652        /**
2653         * @param alwaysSendSetIsolation
2654         *            The alwaysSendSetIsolation to set.
2655         */
2656        public void setAlwaysSendSetIsolation(boolean flag) {
2657                this.alwaysSendSetIsolation.setValue(flag);
2658        }
2659 
2660        /**
2661         * @param autoDeserialize
2662         *            The autoDeserialize to set.
2663         */
2664        public void setAutoDeserialize(boolean flag) {
2665                this.autoDeserialize.setValue(flag);
2666        }
2667 
2668        public void setAutoGenerateTestcaseScript(boolean flag) {
2669                this.autoGenerateTestcaseScript.setValue(flag);
2670                this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2671                                .getValueAsBoolean();
2672        }
2673 
2674        /**
2675         * DOCUMENT ME!
2676         * 
2677         * @param flag
2678         *            The autoReconnect to set.
2679         */
2680        public void setAutoReconnect(boolean flag) {
2681                this.autoReconnect.setValue(flag);
2682        }
2683 
2684        /**
2685         * DOCUMENT ME!
2686         * 
2687         * @param property
2688         */
2689        public void setAutoReconnectForConnectionPools(boolean property) {
2690                this.autoReconnectForPools.setValue(property);
2691                this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2692                                .getValueAsBoolean();
2693        }
2694 
2695        /**
2696         * DOCUMENT ME!
2697         * 
2698         * @param flag
2699         *            The autoReconnectForPools to set.
2700         */
2701        public void setAutoReconnectForPools(boolean flag) {
2702                this.autoReconnectForPools.setValue(flag);
2703        }
2704 
2705        /**
2706         * @param blobSendChunkSize
2707         *            The blobSendChunkSize to set.
2708         */
2709        public void setBlobSendChunkSize(String value) throws SQLException {
2710                this.blobSendChunkSize.setValue(value);
2711        }
2712 
2713        /**
2714         * DOCUMENT ME!
2715         * 
2716         * @param flag
2717         *            The cacheCallableStatements to set.
2718         */
2719        public void setCacheCallableStatements(boolean flag) {
2720                this.cacheCallableStatements.setValue(flag);
2721        }
2722 
2723        /**
2724         * DOCUMENT ME!
2725         * 
2726         * @param flag
2727         *            The cachePreparedStatements to set.
2728         */
2729        public void setCachePreparedStatements(boolean flag) {
2730                this.cachePreparedStatements.setValue(flag);
2731        }
2732 
2733        /**
2734         * Sets whether or not we should cache result set metadata.
2735         * 
2736         * @param property
2737         */
2738        public void setCacheResultSetMetadata(boolean property) {
2739                this.cacheResultSetMetadata.setValue(property);
2740                this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2741                                .getValueAsBoolean();
2742        }
2743 
2744        /**
2745         * @param cacheServerConfiguration
2746         *            The cacheServerConfiguration to set.
2747         */
2748        public void setCacheServerConfiguration(boolean flag) {
2749                this.cacheServerConfiguration.setValue(flag);
2750        }
2751 
2752        /**
2753         * Configures the number of callable statements to cache. (this is
2754         * configurable during the life of the connection).
2755         * 
2756         * @param size
2757         *            The callableStatementCacheSize to set.
2758         */
2759        public void setCallableStatementCacheSize(int size) {
2760                this.callableStatementCacheSize.setValue(size);
2761        }
2762 
2763        /**
2764         * DOCUMENT ME!
2765         * 
2766         * @param property
2767         */
2768        public void setCapitalizeDBMDTypes(boolean property) {
2769                this.capitalizeTypeNames.setValue(property);
2770        }
2771 
2772        /**
2773         * DOCUMENT ME!
2774         * 
2775         * @param flag
2776         *            The capitalizeTypeNames to set.
2777         */
2778        public void setCapitalizeTypeNames(boolean flag) {
2779                this.capitalizeTypeNames.setValue(flag);
2780        }
2781 
2782        /**
2783         * DOCUMENT ME!
2784         * 
2785         * @param encoding
2786         *            The characterEncoding to set.
2787         */
2788        public void setCharacterEncoding(String encoding) {
2789                this.characterEncoding.setValue(encoding);
2790        }
2791 
2792        /**
2793         * DOCUMENT ME!
2794         * 
2795         * @param characterSet
2796         *            The characterSetResults to set.
2797         */
2798        public void setCharacterSetResults(String characterSet) {
2799                this.characterSetResults.setValue(characterSet);
2800        }
2801 
2802        /**
2803         * DOCUMENT ME!
2804         * 
2805         * @param flag
2806         *            The clobberStreamingResults to set.
2807         */
2808        public void setClobberStreamingResults(boolean flag) {
2809                this.clobberStreamingResults.setValue(flag);
2810        }
2811 
2812        public void setClobCharacterEncoding(String encoding) {
2813                this.clobCharacterEncoding.setValue(encoding);
2814        }
2815 
2816        /**
2817         * DOCUMENT ME!
2818         * 
2819         * @param collation
2820         *            The connectionCollation to set.
2821         */
2822        public void setConnectionCollation(String collation) {
2823                this.connectionCollation.setValue(collation);
2824        }
2825 
2826        /**
2827         * DOCUMENT ME!
2828         * 
2829         * @param timeoutMs
2830         */
2831        public void setConnectTimeout(int timeoutMs) {
2832                this.connectTimeout.setValue(timeoutMs);
2833        }
2834 
2835        /**
2836         * DOCUMENT ME!
2837         * 
2838         * @param property
2839         */
2840        public void setContinueBatchOnError(boolean property) {
2841                this.continueBatchOnError.setValue(property);
2842        }
2843 
2844        public void setCreateDatabaseIfNotExist(boolean flag) {
2845                this.createDatabaseIfNotExist.setValue(flag);
2846        }
2847 
2848        public void setDefaultFetchSize(int n) {
2849                this.defaultFetchSize.setValue(n);
2850        }
2851 
2852        /**
2853         * DOCUMENT ME!
2854         * 
2855         * @param property
2856         */
2857        public void setDetectServerPreparedStmts(boolean property) {
2858                this.detectServerPreparedStmts.setValue(property);
2859        }
2860 
2861        /**
2862         * @param dontTrackOpenResources
2863         *            The dontTrackOpenResources to set.
2864         */
2865        public void setDontTrackOpenResources(boolean flag) {
2866                this.dontTrackOpenResources.setValue(flag);
2867        }
2868 
2869        /**
2870         * DOCUMENT ME!
2871         * 
2872         * @param flag
2873         *            The dumpQueriesOnException to set.
2874         */
2875        public void setDumpQueriesOnException(boolean flag) {
2876                this.dumpQueriesOnException.setValue(flag);
2877        }
2878 
2879        /**
2880         * @param dynamicCalendars
2881         *            The dynamicCalendars to set.
2882         */
2883        public void setDynamicCalendars(boolean flag) {
2884                this.dynamicCalendars.setValue(flag);
2885        }
2886 
2887        /**
2888         * DOCUMENT ME!
2889         * 
2890         * @param flag
2891         *            The elideSetAutoCommits to set.
2892         */
2893        public void setElideSetAutoCommits(boolean flag) {
2894                this.elideSetAutoCommits.setValue(flag);
2895        }
2896 
2897        public void setEmptyStringsConvertToZero(boolean flag) {
2898                this.emptyStringsConvertToZero.setValue(flag);
2899        }
2900 
2901        /**
2902         * DOCUMENT ME!
2903         * 
2904         * @param property
2905         */
2906        public void setEmulateLocators(boolean property) {
2907                this.emulateLocators.setValue(property);
2908        }
2909 
2910        /**
2911         * @param emulateUnsupportedPstmts
2912         *            The emulateUnsupportedPstmts to set.
2913         */
2914        public void setEmulateUnsupportedPstmts(boolean flag) {
2915                this.emulateUnsupportedPstmts.setValue(flag);
2916        }
2917 
2918        /**
2919         * DOCUMENT ME!
2920         * 
2921         * @param flag
2922         *            The enablePacketDebug to set.
2923         */
2924        public void setEnablePacketDebug(boolean flag) {
2925                this.enablePacketDebug.setValue(flag);
2926        }
2927 
2928        /**
2929         * DOCUMENT ME!
2930         * 
2931         * @param property
2932         */
2933        public void setEncoding(String property) {
2934                this.characterEncoding.setValue(property);
2935                this.characterEncodingAsString = this.characterEncoding
2936                                .getValueAsString();
2937        }
2938 
2939        /**
2940         * DOCUMENT ME!
2941         * 
2942         * @param flag
2943         *            The explainSlowQueries to set.
2944         */
2945        public void setExplainSlowQueries(boolean flag) {
2946                this.explainSlowQueries.setValue(flag);
2947        }
2948 
2949        /**
2950         * DOCUMENT ME!
2951         * 
2952         * @param flag
2953         *            The failOverReadOnly to set.
2954         */
2955        public void setFailOverReadOnly(boolean flag) {
2956                this.failOverReadOnly.setValue(flag);
2957        }
2958 
2959        /**
2960         * DOCUMENT ME!
2961         * 
2962         * @param flag
2963         *            The gatherPerformanceMetrics to set.
2964         */
2965        public void setGatherPerformanceMetrics(boolean flag) {
2966                this.gatherPerformanceMetrics.setValue(flag);
2967        }
2968 
2969        /**
2970         * DOCUMENT ME!
2971         * 
2972         * @param property
2973         */
2974        protected void setHighAvailability(boolean property) {
2975                this.autoReconnect.setValue(property);
2976                this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2977        }
2978 
2979        /**
2980         * @param holdResultsOpenOverStatementClose
2981         *            The holdResultsOpenOverStatementClose to set.
2982         */
2983        public void setHoldResultsOpenOverStatementClose(boolean flag) {
2984                this.holdResultsOpenOverStatementClose.setValue(flag);
2985        }
2986 
2987        /**
2988         * DOCUMENT ME!
2989         * 
2990         * @param property
2991         */
2992        public void setIgnoreNonTxTables(boolean property) {
2993                this.ignoreNonTxTables.setValue(property);
2994        }
2995 
2996        /**
2997         * DOCUMENT ME!
2998         * 
2999         * @param property
3000         */
3001        public void setInitialTimeout(int property) {
3002                this.initialTimeout.setValue(property);
3003        }
3004 
3005        /**
3006         * DOCUMENT ME!
3007         * 
3008         * @param property
3009         */
3010        public void setIsInteractiveClient(boolean property) {
3011                this.isInteractiveClient.setValue(property);
3012        }
3013 
3014        /**
3015         * DOCUMENT ME!
3016         * 
3017         * @param flag
3018         *            The jdbcCompliantTruncation to set.
3019         */
3020        public void setJdbcCompliantTruncation(boolean flag) {
3021                this.jdbcCompliantTruncation.setValue(flag);
3022        }
3023 
3024        /**
3025         * @param locatorFetchBufferSize
3026         *            The locatorFetchBufferSize to set.
3027         */
3028        public void setLocatorFetchBufferSize(String value) throws SQLException {
3029                this.locatorFetchBufferSize.setValue(value);
3030        }
3031 
3032        /**
3033         * DOCUMENT ME!
3034         * 
3035         * @param property
3036         */
3037        public void setLogger(String property) {
3038                this.loggerClassName.setValueAsObject(property);
3039        }
3040 
3041        /**
3042         * DOCUMENT ME!
3043         * 
3044         * @param className
3045         *            The loggerClassName to set.
3046         */
3047        public void setLoggerClassName(String className) {
3048                this.loggerClassName.setValue(className);
3049        }
3050 
3051        /**
3052         * DOCUMENT ME!
3053         * 
3054         * @param flag
3055         *            The logSlowQueries to set.
3056         */
3057        public void setLogSlowQueries(boolean flag) {
3058                this.logSlowQueries.setValue(flag);
3059        }
3060 
3061        public void setMaintainTimeStats(boolean flag) {
3062                this.maintainTimeStats.setValue(flag);
3063                this.maintainTimeStatsAsBoolean = this.maintainTimeStats
3064                                .getValueAsBoolean();
3065        }
3066 
3067        /**
3068         * DOCUMENT ME!
3069         * 
3070         * @param sizeInBytes
3071         *            The maxQuerySizeToLog to set.
3072         */
3073        public void setMaxQuerySizeToLog(int sizeInBytes) {
3074                this.maxQuerySizeToLog.setValue(sizeInBytes);
3075        }
3076 
3077        /**
3078         * DOCUMENT ME!
3079         * 
3080         * @param property
3081         */
3082        public void setMaxReconnects(int property) {
3083                this.maxReconnects.setValue(property);
3084        }
3085 
3086        /**
3087         * DOCUMENT ME!
3088         * 
3089         * @param property
3090         */
3091        public void setMaxRows(int property) {
3092                this.maxRows.setValue(property);
3093                this.maxRowsAsInt = this.maxRows.getValueAsInt();
3094        }
3095 
3096        /**
3097         * Sets the number of queries that metadata can be cached if caching is
3098         * enabled.
3099         * 
3100         * @param value
3101         *            the number of queries to cache metadata for.
3102         */
3103        public void setMetadataCacheSize(int value) {
3104                this.metadataCacheSize.setValue(value);
3105        }
3106 
3107        /**
3108         * @param noDatetimeStringSync
3109         *            The noDatetimeStringSync to set.
3110         */
3111        public void setNoDatetimeStringSync(boolean flag) {
3112                this.noDatetimeStringSync.setValue(flag);
3113        }
3114 
3115        public void setNullCatalogMeansCurrent(boolean value) {
3116                this.nullCatalogMeansCurrent.setValue(value);
3117        }
3118 
3119        public void setNullNamePatternMatchesAll(boolean value) {
3120                this.nullNamePatternMatchesAll.setValue(value);
3121        }
3122 
3123        /**
3124         * DOCUMENT ME!
3125         * 
3126         * @param size
3127         *            The packetDebugBufferSize to set.
3128         */
3129        public void setPacketDebugBufferSize(int size) {
3130                this.packetDebugBufferSize.setValue(size);
3131        }
3132 
3133        /**
3134         * DOCUMENT ME!
3135         * 
3136         * @param property
3137         */
3138        public void setParanoid(boolean property) {
3139                this.paranoid.setValue(property);
3140        }
3141 
3142        /**
3143         * DOCUMENT ME!
3144         * 
3145         * @param property
3146         */
3147        public void setPedantic(boolean property) {
3148                this.pedantic.setValue(property);
3149        }
3150 
3151        /**
3152         * DOCUMENT ME!
3153         * 
3154         * @param cacheSize
3155         *            The preparedStatementCacheSize to set.
3156         */
3157        public void setPreparedStatementCacheSize(int cacheSize) {
3158                this.preparedStatementCacheSize.setValue(cacheSize);
3159        }
3160 
3161        /**
3162         * DOCUMENT ME!
3163         * 
3164         * @param cacheSqlLimit
3165         *            The preparedStatementCacheSqlLimit to set.
3166         */
3167        public void setPreparedStatementCacheSqlLimit(int cacheSqlLimit) {
3168                this.preparedStatementCacheSqlLimit.setValue(cacheSqlLimit);
3169        }
3170 
3171        /**
3172         * DOCUMENT ME!
3173         * 
3174         * @param property
3175         */
3176        public void setProfileSql(boolean property) {
3177                this.profileSQL.setValue(property);
3178                this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
3179        }
3180 
3181        /**
3182         * DOCUMENT ME!
3183         * 
3184         * @param flag
3185         *            The profileSQL to set.
3186         */
3187        public void setProfileSQL(boolean flag) {
3188                this.profileSQL.setValue(flag);
3189        }
3190 
3191        /**
3192         * @param propertiesTransform
3193         *            The propertiesTransform to set.
3194         */
3195        public void setPropertiesTransform(String value) {
3196                this.propertiesTransform.setValue(value);
3197        }
3198 
3199        /**
3200         * DOCUMENT ME!
3201         * 
3202         * @param property
3203         */
3204        public void setQueriesBeforeRetryMaster(int property) {
3205                this.queriesBeforeRetryMaster.setValue(property);
3206        }
3207 
3208        /**
3209         * DOCUMENT ME!
3210         * 
3211         * @param property
3212         */
3213        public void setReconnectAtTxEnd(boolean property) {
3214                this.reconnectAtTxEnd.setValue(property);
3215                this.reconnectTxAtEndAsBoolean = this.reconnectAtTxEnd
3216                                .getValueAsBoolean();
3217        }
3218 
3219        /**
3220         * DOCUMENT ME!
3221         * 
3222         * @param property
3223         */
3224        public void setRelaxAutoCommit(boolean property) {
3225                this.relaxAutoCommit.setValue(property);
3226        }
3227 
3228        /**
3229         * DOCUMENT ME!
3230         * 
3231         * @param millis
3232         *            The reportMetricsIntervalMillis to set.
3233         */
3234        public void setReportMetricsIntervalMillis(int millis) {
3235                this.reportMetricsIntervalMillis.setValue(millis);
3236        }
3237 
3238        /**
3239         * DOCUMENT ME!
3240         * 
3241         * @param property
3242         */
3243        public void setRequireSSL(boolean property) {
3244                this.requireSSL.setValue(property);
3245        }
3246 
3247        protected void setRetainStatementAfterResultSetClose(boolean flag) {
3248                this.retainStatementAfterResultSetClose.setValue(flag);
3249        }
3250 
3251        /**
3252         * @param rollbackOnPooledClose
3253         *            The rollbackOnPooledClose to set.
3254         */
3255        public void setRollbackOnPooledClose(boolean flag) {
3256                this.rollbackOnPooledClose.setValue(flag);
3257        }
3258 
3259        /**
3260         * Sets whether or not hosts will be picked in a round-robin fashion.
3261         * 
3262         * @param flag
3263         *            The roundRobinLoadBalance property to set.
3264         */
3265        public void setRoundRobinLoadBalance(boolean flag) {
3266                this.roundRobinLoadBalance.setValue(flag);
3267        }
3268 
3269        /**
3270         * @param runningCTS13
3271         *            The runningCTS13 to set.
3272         */
3273        public void setRunningCTS13(boolean flag) {
3274                this.runningCTS13.setValue(flag);
3275        }
3276 
3277        /**
3278         * DOCUMENT ME!
3279         * 
3280         * @param property
3281         */
3282        public void setSecondsBeforeRetryMaster(int property) {
3283                this.secondsBeforeRetryMaster.setValue(property);
3284        }
3285 
3286        /**
3287         * DOCUMENT ME!
3288         * 
3289         * @param property
3290         *            DOCUMENT ME!
3291         */
3292        public void setServerTimezone(String property) {
3293                this.serverTimezone.setValue(property);
3294        }
3295 
3296        /**
3297         * @param sessionVariables
3298         *            The sessionVariables to set.
3299         */
3300        public void setSessionVariables(String variables) {
3301                this.sessionVariables.setValue(variables);
3302        }
3303 
3304        /**
3305         * DOCUMENT ME!
3306         * 
3307         * @param millis
3308         *            The slowQueryThresholdMillis to set.
3309         */
3310        public void setSlowQueryThresholdMillis(int millis) {
3311                this.slowQueryThresholdMillis.setValue(millis);
3312        }
3313 
3314        /**
3315         * DOCUMENT ME!
3316         * 
3317         * @param property
3318         */
3319        public void setSocketFactoryClassName(String property) {
3320                this.socketFactoryClassName.setValue(property);
3321        }
3322 
3323        /**
3324         * DOCUMENT ME!
3325         * 
3326         * @param property
3327         */
3328        public void setSocketTimeout(int property) {
3329                this.socketTimeout.setValue(property);
3330        }
3331 
3332        /**
3333         * DOCUMENT ME!
3334         * 
3335         * @param property
3336         */
3337        public void setStrictFloatingPoint(boolean property) {
3338                this.strictFloatingPoint.setValue(property);
3339        }
3340 
3341        /**
3342         * DOCUMENT ME!
3343         * 
3344         * @param property
3345         */
3346        public void setStrictUpdates(boolean property) {
3347                this.strictUpdates.setValue(property);
3348        }
3349 
3350        /**
3351         * @param tinyInt1isBit
3352         *            The tinyInt1isBit to set.
3353         */
3354        public void setTinyInt1isBit(boolean flag) {
3355                this.tinyInt1isBit.setValue(flag);
3356        }
3357 
3358        /**
3359         * DOCUMENT ME!
3360         * 
3361         * @param flag
3362         *            The logProtocol to set.
3363         */
3364        public void setTraceProtocol(boolean flag) {
3365                this.traceProtocol.setValue(flag);
3366        }
3367 
3368        public void setTransformedBitIsBoolean(boolean flag) {
3369                this.transformedBitIsBoolean.setValue(flag);
3370        }
3371 
3372        /**
3373         * DOCUMENT ME!
3374         * 
3375         * @param property
3376         */
3377        public void setUseCompression(boolean property) {
3378                this.useCompression.setValue(property);
3379        }
3380 
3381        /**
3382         * @param useFastIntParsing
3383         *            The useFastIntParsing to set.
3384         */
3385        public void setUseFastIntParsing(boolean flag) {
3386                this.useFastIntParsing.setValue(flag);
3387        }
3388 
3389        /**
3390         * DOCUMENT ME!
3391         * 
3392         * @param property
3393         */
3394        public void setUseHostsInPrivileges(boolean property) {
3395                this.useHostsInPrivileges.setValue(property);
3396        }
3397 
3398        public void setUseInformationSchema(boolean flag) {
3399                this.useInformationSchema.setValue(flag);
3400        }
3401 
3402        /**
3403         * @param useLocalSessionState
3404         *            The useLocalSessionState to set.
3405         */
3406        public void setUseLocalSessionState(boolean flag) {
3407                this.useLocalSessionState.setValue(flag);
3408        }
3409 
3410        /**
3411         * @param useOldUTF8Behavior
3412         *            The useOldUTF8Behavior to set.
3413         */
3414        public void setUseOldUTF8Behavior(boolean flag) {
3415                this.useOldUTF8Behavior.setValue(flag);
3416                this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
3417                                .getValueAsBoolean();
3418        }
3419 
3420        /**
3421         * @param useOnlyServerErrorMessages
3422         *            The useOnlyServerErrorMessages to set.
3423         */
3424        public void setUseOnlyServerErrorMessages(boolean flag) {
3425                this.useOnlyServerErrorMessages.setValue(flag);
3426        }
3427 
3428        /**
3429         * @param useReadAheadInput
3430         *            The useReadAheadInput to set.
3431         */
3432        public void setUseReadAheadInput(boolean flag) {
3433                this.useReadAheadInput.setValue(flag);
3434        }
3435 
3436        /**
3437         * DOCUMENT ME!
3438         * 
3439         * @param flag
3440         *            The detectServerPreparedStmts to set.
3441         */
3442        public void setUseServerPreparedStmts(boolean flag) {
3443                this.detectServerPreparedStmts.setValue(flag);
3444        }
3445 
3446        /**
3447         * DOCUMENT ME!
3448         * 
3449         * @param flag
3450         *            The useSqlStateCodes to set.
3451         */
3452        public void setUseSqlStateCodes(boolean flag) {
3453                this.useSqlStateCodes.setValue(flag);
3454        }
3455 
3456        /**
3457         * DOCUMENT ME!
3458         * 
3459         * @param property
3460         */
3461        public void setUseSSL(boolean property) {
3462                this.useSSL.setValue(property);
3463        }
3464 
3465        /**
3466         * DOCUMENT ME!
3467         * 
3468         * @param property
3469         */
3470        public void setUseStreamLengthsInPrepStmts(boolean property) {
3471                this.useStreamLengthsInPrepStmts.setValue(property);
3472        }
3473 
3474        /**
3475         * DOCUMENT ME!
3476         * 
3477         * @param property
3478         */
3479        public void setUseTimezone(boolean property) {
3480                this.useTimezone.setValue(property);
3481        }
3482 
3483        /**
3484         * DOCUMENT ME!
3485         * 
3486         * @param property
3487         */
3488        public void setUseUltraDevWorkAround(boolean property) {
3489                this.useUltraDevWorkAround.setValue(property);
3490        }
3491 
3492        /**
3493         * DOCUMENT ME!
3494         * 
3495         * @param flag
3496         *            The useUnbufferedInput to set.
3497         */
3498        public void setUseUnbufferedInput(boolean flag) {
3499                this.useUnbufferedInput.setValue(flag);
3500        }
3501 
3502        /**
3503         * DOCUMENT ME!
3504         * 
3505         * @param flag
3506         *            The useUnicode to set.
3507         */
3508        public void setUseUnicode(boolean flag) {
3509                this.useUnicode.setValue(flag);
3510                this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
3511        }
3512 
3513        /**
3514         * Sets whether or not the driver advises of proper usage.
3515         * 
3516         * @param useUsageAdvisorFlag
3517         *            whether or not the driver advises of proper usage.
3518         */
3519        public void setUseUsageAdvisor(boolean useUsageAdvisorFlag) {
3520                this.useUsageAdvisor.setValue(useUsageAdvisorFlag);
3521                this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
3522                                .getValueAsBoolean();
3523        }
3524 
3525        public void setYearIsDateType(boolean flag) {
3526                this.yearIsDateType.setValue(flag);
3527        }
3528 
3529        /**
3530         * @param zeroDateTimeBehavior
3531         *            The zeroDateTimeBehavior to set.
3532         */
3533        public void setZeroDateTimeBehavior(String behavior) {
3534                this.zeroDateTimeBehavior.setValue(behavior);
3535        }
3536 
3537        protected void storeToRef(Reference ref) throws SQLException {
3538                int numPropertiesToSet = PROPERTY_LIST.size();
3539 
3540                for (int i = 0; i < numPropertiesToSet; i++) {
3541                        java.lang.reflect.Field propertyField = (java.lang.reflect.Field) PROPERTY_LIST
3542                                        .get(i);
3543 
3544                        try {
3545                                ConnectionProperty propToStore = (ConnectionProperty) propertyField
3546                                                .get(this);
3547 
3548                                if (ref != null) {
3549                                        propToStore.storeTo(ref);
3550                                }
3551                        } catch (IllegalAccessException iae) {
3552                                throw SQLError.createSQLException("Huh?");
3553                        }
3554                }
3555        }
3556 
3557        /**
3558         * DOCUMENT ME!
3559         * 
3560         * @return Returns the useUnbufferedInput.
3561         */
3562        public boolean useUnbufferedInput() {
3563                return this.useUnbufferedInput.getValueAsBoolean();
3564        }
3565 
3566        public boolean getUseCursorFetch() {
3567                return this.useCursorFetch.getValueAsBoolean();
3568        }
3569 
3570        public void setUseCursorFetch(boolean flag) {
3571                this.useCursorFetch.setValue(flag);
3572        }
3573 
3574        public boolean getOverrideSupportsIntegrityEnhancementFacility() {
3575                return this.overrideSupportsIntegrityEnhancementFacility.getValueAsBoolean();
3576        }
3577 
3578        public void setOverrideSupportsIntegrityEnhancementFacility(boolean flag) {
3579                this.overrideSupportsIntegrityEnhancementFacility.setValue(flag);        
3580        }
3581        
3582        public boolean getNoTimezoneConversionForTimeType() {
3583                return this.noTimezoneConversionForTimeType.getValueAsBoolean();
3584        }
3585 
3586        public void setNoTimezoneConversionForTimeType(boolean flag) {
3587                this.noTimezoneConversionForTimeType.setValue(flag);
3588        }
3589 
3590        public boolean getUseJDBCCompliantTimezoneShift() {
3591                return this.useJDBCCompliantTimezoneShift.getValueAsBoolean();
3592        }
3593 
3594        public void setUseJDBCCompliantTimezoneShift(boolean flag) {
3595                this.useJDBCCompliantTimezoneShift.setValue(flag);
3596        }
3597        
3598        public boolean getAutoClosePStmtStreams() {
3599                return this.autoClosePStmtStreams.getValueAsBoolean();
3600        }
3601 
3602        public void setAutoClosePStmtStreams(boolean flag) {
3603                this.autoClosePStmtStreams.setValue(flag);
3604        }
3605 
3606        public boolean getProcessEscapeCodesForPrepStmts() {
3607                return this.processEscapeCodesForPrepStmts.getValueAsBoolean();
3608        }
3609 
3610        public void setProcessEscapeCodesForPrepStmts(boolean flag) {
3611                this.processEscapeCodesForPrepStmts.setValue(flag);
3612        }
3613 
3614        public boolean getUseGmtMillisForDatetimes() {
3615                return this.useGmtMillisForDatetimes.getValueAsBoolean();
3616        }
3617 
3618        public void setUseGmtMillisForDatetimes(boolean flag) {
3619                this.useGmtMillisForDatetimes.setValue(flag);
3620        }
3621        
3622        public boolean getDumpMetadataOnColumnNotFound() {
3623                return this.dumpMetadataOnColumnNotFound.getValueAsBoolean();
3624        }
3625 
3626        public void setDumpMetadataOnColumnNotFound(boolean flag) {
3627                this.dumpMetadataOnColumnNotFound.setValue(flag);
3628        }
3629 
3630        public String getResourceId() {
3631                return this.resourceId.getValueAsString();
3632        }
3633 
3634        public void setResourceId(String resourceId) {
3635                this.resourceId.setValue(resourceId);
3636        }
3637        
3638        public boolean getRewriteBatchedStatements() {
3639                return this.rewriteBatchedStatements.getValueAsBoolean();
3640        }
3641 
3642        public void setRewriteBatchedStatements(boolean flag) {
3643                this.rewriteBatchedStatements.setValue(flag);
3644        }
3645        
3646        public boolean getJdbcCompliantTruncationForReads() {
3647                return this.jdbcCompliantTruncationForReads;
3648        }
3649 
3650        public void setJdbcCompliantTruncationForReads(
3651                        boolean jdbcCompliantTruncationForReads) {
3652                this.jdbcCompliantTruncationForReads = jdbcCompliantTruncationForReads;
3653        }
3654 
3655        public boolean getUseJvmCharsetConverters() {
3656                return this.useJvmCharsetConverters.getValueAsBoolean();
3657        }
3658 
3659        public void setUseJvmCharsetConverters(boolean flag) {
3660                this.useJvmCharsetConverters.setValue(flag);
3661        }
3662 
3663        public boolean getPinGlobalTxToPhysicalConnection() {
3664                return this.pinGlobalTxToPhysicalConnection.getValueAsBoolean();
3665        }
3666 
3667        public void setPinGlobalTxToPhysicalConnection(boolean flag) {
3668                this.pinGlobalTxToPhysicalConnection.setValue(flag);
3669        }
3670        
3671        /*
3672         * "Aliases" which match the property names to make using 
3673         * from datasources easier.
3674         */
3675        
3676        public void setUseServerPrepStmts(boolean flag) {
3677                setUseServerPreparedStmts(flag);
3678        }
3679 
3680        public boolean getUseServerPrepStmts() {
3681                return getUseServerPreparedStmts();
3682        }
3683 
3684        public void setCacheCallableStmts(boolean flag) {
3685                setCacheCallableStatements(flag);
3686        }
3687 
3688        public boolean getCacheCallableStmts() {
3689                return getCacheCallableStatements();
3690        }
3691 
3692        public void setCachePrepStmts(boolean flag) {
3693                setCachePreparedStatements(flag);
3694        }
3695 
3696        public boolean getCachePrepStmts() {
3697                return getCachePreparedStatements();
3698        }
3699 
3700        public void setCallableStmtCacheSize(int cacheSize) {
3701                setCallableStatementCacheSize(cacheSize);
3702        }
3703 
3704        public int getCallableStmtCacheSize() {
3705                return getCallableStatementCacheSize();
3706        }
3707 
3708        public void setPrepStmtCacheSize(int cacheSize) {
3709                setPreparedStatementCacheSize(cacheSize);
3710        }
3711 
3712        public int getPrepStmtCacheSize() {
3713                return getPreparedStatementCacheSize();
3714        }
3715 
3716        public void setPrepStmtCacheSqlLimit(int sqlLimit) {
3717                setPreparedStatementCacheSqlLimit(sqlLimit);
3718        }
3719 
3720        public int getPrepStmtCacheSqlLimit() {
3721                return getPreparedStatementCacheSqlLimit();
3722        }
3723 
3724 
3725}

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