📄 connectionpropertiesimpl.java
字号:
private static final String STANDARD_LOGGER_NAME = StandardLogger.class.getName(); protected static final String ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL = "convertToNull"; //$NON-NLS-1$ protected static final String ZERO_DATETIME_BEHAVIOR_EXCEPTION = "exception"; //$NON-NLS-1$ protected static final String ZERO_DATETIME_BEHAVIOR_ROUND = "round"; //$NON-NLS-1$ static { try { java.lang.reflect.Field[] declaredFields = ConnectionPropertiesImpl.class .getDeclaredFields(); for (int i = 0; i < declaredFields.length; i++) { if (ConnectionPropertiesImpl.ConnectionProperty.class .isAssignableFrom(declaredFields[i].getType())) { PROPERTY_LIST.add(declaredFields[i]); } } } catch (Exception ex) { throw new RuntimeException(ex.toString()); } } /** * Exposes all ConnectionPropertyInfo instances as DriverPropertyInfo * * @param info * the properties to load into these ConnectionPropertyInfo * instances * @param slotsToReserve * the number of DPI slots to reserve for 'standard' DPI * properties (user, host, password, etc) * @return a list of all ConnectionPropertyInfo instances, as * DriverPropertyInfo * @throws SQLException * if an error occurs */ protected static DriverPropertyInfo[] exposeAsDriverPropertyInfo( Properties info, int slotsToReserve) throws SQLException { return (new ConnectionPropertiesImpl() { }).exposeAsDriverPropertyInfoInternal(info, slotsToReserve); } private BooleanConnectionProperty allowLoadLocalInfile = new BooleanConnectionProperty( "allowLoadLocalInfile", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.loadDataLocal"), //$NON-NLS-1$ "3.0.3", SECURITY_CATEGORY, Integer.MAX_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty allowMultiQueries = new BooleanConnectionProperty( "allowMultiQueries", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.allowMultiQueries"), //$NON-NLS-1$ "3.1.1", SECURITY_CATEGORY, 1); //$NON-NLS-1$ private BooleanConnectionProperty allowNanAndInf = new BooleanConnectionProperty( "allowNanAndInf", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.allowNANandINF"), //$NON-NLS-1$ "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty allowUrlInLocalInfile = new BooleanConnectionProperty( "allowUrlInLocalInfile", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.allowUrlInLoadLocal"), //$NON-NLS-1$ "3.1.4", SECURITY_CATEGORY, Integer.MAX_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty alwaysSendSetIsolation = new BooleanConnectionProperty( "alwaysSendSetIsolation", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.alwaysSendSetIsolation"), //$NON-NLS-1$ "3.1.7", PERFORMANCE_CATEGORY, Integer.MAX_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty autoClosePStmtStreams = new BooleanConnectionProperty( "autoClosePStmtStreams", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.autoClosePstmtStreams"), //$NON-NLS-1$ "3.1.12", //$NON-NLS-1$ MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty autoDeserialize = new BooleanConnectionProperty( "autoDeserialize", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.autoDeserialize"), //$NON-NLS-1$ "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty autoGenerateTestcaseScript = new BooleanConnectionProperty( "autoGenerateTestcaseScript", false, //$NON-NLS-1$ Messages.getString("ConnectionProperties.autoGenerateTestcaseScript"), "3.1.9", //$NON-NLS-1$ //$NON-NLS-2$ DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private boolean autoGenerateTestcaseScriptAsBoolean = false; private BooleanConnectionProperty autoReconnect = new BooleanConnectionProperty( "autoReconnect", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.autoReconnect"), //$NON-NLS-1$ "1.1", HA_CATEGORY, 0); //$NON-NLS-1$ private BooleanConnectionProperty autoReconnectForPools = new BooleanConnectionProperty( "autoReconnectForPools", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.autoReconnectForPools"), //$NON-NLS-1$ "3.1.3", HA_CATEGORY, 1); //$NON-NLS-1$ private boolean autoReconnectForPoolsAsBoolean = false; private MemorySizeConnectionProperty blobSendChunkSize = new MemorySizeConnectionProperty( "blobSendChunkSize", //$NON-NLS-1$ 1024 * 1024, 1, Integer.MAX_VALUE, Messages.getString("ConnectionProperties.blobSendChunkSize"), //$NON-NLS-1$ "3.1.9", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty autoSlowLog = new BooleanConnectionProperty( "autoSlowLog", true, Messages.getString("ConnectionProperties.autoSlowLog"), "5.1.4", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty blobsAreStrings = new BooleanConnectionProperty( "blobsAreStrings", false, "Should the driver always treat BLOBs as Strings - specifically to work around dubious metadata " + "returned by the server for GROUP BY clauses?", "5.0.8", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty functionsNeverReturnBlobs = new BooleanConnectionProperty( "functionsNeverReturnBlobs", false, "Should the driver always treat data from functions returning BLOBs as Strings - specifically to work around dubious metadata " + "returned by the server for GROUP BY clauses?", "5.0.8", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty cacheCallableStatements = new BooleanConnectionProperty( "cacheCallableStmts", false, //$NON-NLS-1$ Messages.getString("ConnectionProperties.cacheCallableStatements"), //$NON-NLS-1$ "3.1.2", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty cachePreparedStatements = new BooleanConnectionProperty( "cachePrepStmts", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.cachePrepStmts"), //$NON-NLS-1$ "3.0.10", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty cacheResultSetMetadata = new BooleanConnectionProperty( "cacheResultSetMetadata", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.cacheRSMetadata"), //$NON-NLS-1$ "3.1.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private boolean cacheResultSetMetaDataAsBoolean; private BooleanConnectionProperty cacheServerConfiguration = new BooleanConnectionProperty( "cacheServerConfiguration", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.cacheServerConfiguration"), //$NON-NLS-1$ "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private IntegerConnectionProperty callableStatementCacheSize = new IntegerConnectionProperty( "callableStmtCacheSize", //$NON-NLS-1$ 100, 0, Integer.MAX_VALUE, Messages.getString("ConnectionProperties.callableStmtCacheSize"), //$NON-NLS-1$ "3.1.2", PERFORMANCE_CATEGORY, 5); //$NON-NLS-1$ private BooleanConnectionProperty capitalizeTypeNames = new BooleanConnectionProperty( "capitalizeTypeNames", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.capitalizeTypeNames"), //$NON-NLS-1$ "2.0.7", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private StringConnectionProperty characterEncoding = new StringConnectionProperty( "characterEncoding", //$NON-NLS-1$ null, Messages.getString("ConnectionProperties.characterEncoding"), //$NON-NLS-1$ "1.1g", MISC_CATEGORY, 5); //$NON-NLS-1$ private String characterEncodingAsString = null; private StringConnectionProperty characterSetResults = new StringConnectionProperty( "characterSetResults", null, //$NON-NLS-1$ Messages.getString("ConnectionProperties.characterSetResults"), "3.0.13", //$NON-NLS-1$ //$NON-NLS-2$ MISC_CATEGORY, 6); private StringConnectionProperty clientInfoProvider = new StringConnectionProperty( "clientInfoProvider", "com.mysql.jdbc.JDBC4CommentClientInfoProvider", //$NON-NLS-1$ //$NON-NLS-2$ Messages.getString("ConnectionProperties.clientInfoProvider"), //$NON-NLS-1$ "5.1.0", //$NON-NLS-1$ DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty clobberStreamingResults = new BooleanConnectionProperty( "clobberStreamingResults", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.clobberStreamingResults"), //$NON-NLS-1$ "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private StringConnectionProperty clobCharacterEncoding = new StringConnectionProperty( "clobCharacterEncoding", //$NON-NLS-1$ null, Messages.getString("ConnectionProperties.clobCharacterEncoding"), //$NON-NLS-1$ "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private StringConnectionProperty connectionCollation = new StringConnectionProperty( "connectionCollation", //$NON-NLS-1$ null, Messages.getString("ConnectionProperties.connectionCollation"), //$NON-NLS-1$ "3.0.13", MISC_CATEGORY, 7); //$NON-NLS-1$ private StringConnectionProperty connectionLifecycleInterceptors = new StringConnectionProperty( "connectionLifecycleInterceptors", //$NON-NLS-1$ null, Messages.getString("ConnectionProperties.connectionLifecycleInterceptors"), "5.1.4", CONNECTION_AND_AUTH_CATEGORY, Integer.MAX_VALUE); private IntegerConnectionProperty connectTimeout = new IntegerConnectionProperty( "connectTimeout", 0, 0, Integer.MAX_VALUE, //$NON-NLS-1$ Messages.getString("ConnectionProperties.connectTimeout"), //$NON-NLS-1$ "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 9); //$NON-NLS-1$ private BooleanConnectionProperty continueBatchOnError = new BooleanConnectionProperty( "continueBatchOnError", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.continueBatchOnError"), //$NON-NLS-1$ "3.0.3", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty createDatabaseIfNotExist = new BooleanConnectionProperty( "createDatabaseIfNotExist", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.createDatabaseIfNotExist"), //$NON-NLS-1$ "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private IntegerConnectionProperty defaultFetchSize = new IntegerConnectionProperty("defaultFetchSize", 0, Messages.getString("ConnectionProperties.defaultFetchSize"), "3.1.9", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ private BooleanConnectionProperty detectServerPreparedStmts = new BooleanConnectionProperty( "useServerPrepStmts", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.useServerPrepStmts"), //$NON-NLS-1$ "3.1.0", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty dontTrackOpenResources = new BooleanConnectionProperty( "dontTrackOpenResources", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.dontTrackOpenResources"), "3.1.7", PERFORMANCE_CATEGORY, //$NON-NLS-1$ //$NON-NLS-2$ Integer.MIN_VALUE); private BooleanConnectionProperty dumpQueriesOnException = new BooleanConnectionProperty( "dumpQueriesOnException", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.dumpQueriesOnException"), //$NON-NLS-1$ "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty dynamicCalendars = new BooleanConnectionProperty( "dynamicCalendars", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.dynamicCalendars"), //$NON-NLS-1$ "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty elideSetAutoCommits = new BooleanConnectionProperty( "elideSetAutoCommits", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.eliseSetAutoCommit"), //$NON-NLS-1$ "3.1.3", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty emptyStringsConvertToZero = new BooleanConnectionProperty( "emptyStringsConvertToZero", true, //$NON-NLS-1$ Messages.getString("ConnectionProperties.emptyStringsConvertToZero"), "3.1.8", //$NON-NLS-1$ //$NON-NLS-2$ MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty emulateLocators = new BooleanConnectionProperty( "emulateLocators", false, Messages.getString("ConnectionProperties.emulateLocators"), "3.1.0", MISC_CATEGORY, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Integer.MIN_VALUE); private BooleanConnectionProperty emulateUnsupportedPstmts = new BooleanConnectionProperty( "emulateUnsupportedPstmts", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.emulateUnsupportedPstmts"), //$NON-NLS-1$ "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty enablePacketDebug = new BooleanConnectionProperty( "enablePacketDebug", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.enablePacketDebug"), //$NON-NLS-1$ "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private BooleanConnectionProperty enableQueryTimeouts = new BooleanConnectionProperty( "enableQueryTimeouts", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.enableQueryTimeouts"), //$NON-NLS-1$ "5.0.6", //$NON-NLS-1$ PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty explainSlowQueries = new BooleanConnectionProperty( "explainSlowQueries", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.explainSlowQueries"), //$NON-NLS-1$ "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ /** When failed-over, set connection to read-only? */ private BooleanConnectionProperty failOverReadOnly = new BooleanConnectionProperty( "failOverReadOnly", //$NON-NLS-1$ true, Messages.getString("ConnectionProperties.failoverReadOnly"), //$NON-NLS-1$ "3.0.12", HA_CATEGORY, 2); //$NON-NLS-1$ private BooleanConnectionProperty gatherPerformanceMetrics = new BooleanConnectionProperty( "gatherPerfMetrics", //$NON-NLS-1$ false, Messages.getString("ConnectionProperties.gatherPerfMetrics"), //$NON-NLS-1$ "3.1.2", DEBUGING_PROFILING_CATEGORY, 1); //$NON-NLS-1$ private BooleanConnectionProperty generateSimpleParameterMetadata = new BooleanConnectionProperty( "generateSimpleParameterMetadata", false, Messages.getString("ConnectionProperties.generateSimpleParameterMetadata"), "5.0.5", MISC_CATEGORY, Integer.MIN_VALUE); //$NON-NLS-1$ private boolean highAvailabilityAsBoolean = false; private BooleanConnectionProperty holdResultsOpenOverStatementClose = new BooleanConnectionProperty( "holdResultsOpenOverStatementClose", //$NON-NLS-1$ false,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -