?? connectionproperties.java
字號:
try { java.lang.reflect.Field[] declaredFields = ConnectionProperties.class .getDeclaredFields(); for (int i = 0; i < declaredFields.length; i++) { if (ConnectionProperties.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 ConnectionProperties() { }).exposeAsDriverPropertyInfoInternal(info, slotsToReserve); } private BooleanConnectionProperty allowLoadLocalInfile = new BooleanConnectionProperty( "allowLoadLocalInfile", true, "Should the driver allow use of 'LOAD DATA LOCAL INFILE...' (defaults to 'true').", "3.0.3", SECURITY_CATEGORY, Integer.MAX_VALUE); private BooleanConnectionProperty allowMultiQueries = new BooleanConnectionProperty( "allowMultiQueries", false, "Allow the use of ';' to delimit multiple queries during one statement (true/false), defaults to 'false'", "3.1.1", SECURITY_CATEGORY, 1); private BooleanConnectionProperty allowNanAndInf = new BooleanConnectionProperty( "allowNanAndInf", false, "Should the driver allow NaN or +/- INF values in PreparedStatement.setDouble()?", "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty allowUrlInLocalInfile = new BooleanConnectionProperty( "allowUrlInLocalInfile", false, "Should the driver allow URLs in 'LOAD DATA LOCAL INFILE' statements?", "3.1.4", SECURITY_CATEGORY, Integer.MAX_VALUE); private BooleanConnectionProperty alwaysSendSetIsolation = new BooleanConnectionProperty( "alwaysSendSetIsolation", true, "Should the driver always communicate with the database when " + " Connection.setTransactionIsolation() is called? " + "If set to false, the driver will only communicate with the " + "database when the requested transaction isolation is different " + "than the whichever is newer, the last value that was set via " + "Connection.setTransactionIsolation(), or the value that was read from " + "the server when the connection was established.", "3.1.7", PERFORMANCE_CATEGORY, Integer.MAX_VALUE); private BooleanConnectionProperty autoClosePStmtStreams = new BooleanConnectionProperty( "autoClosePStmtStreams", false, "Should the driver automatically call .close() on streams/readers passed as " + "arguments via set*() methods?", "3.1.12", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty autoDeserialize = new BooleanConnectionProperty( "autoDeserialize", false, "Should the driver automatically detect and de-serialize objects stored in BLOB fields?", "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty autoGenerateTestcaseScript = new BooleanConnectionProperty( "autoGenerateTestcaseScript", false, "Should the driver dump the SQL it is executing, including server-side " + "prepared statements to STDERR?", "3.1.9", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private boolean autoGenerateTestcaseScriptAsBoolean = false; private BooleanConnectionProperty autoReconnect = new BooleanConnectionProperty( "autoReconnect", false, "Should the driver try to re-establish stale and/or dead connections? " + " If enabled the driver will throw an exception for a queries issued on a stale or dead connection, " + " which belong to the current transaction, but will attempt reconnect before the next query issued on the " + "connection in a new transaction. The use of this feature " + "is not recommended, because it has side effects related to session state and data consistency when applications don't" + "handle SQLExceptions properly, and is only designed to be used " + "when you are unable to configure your application to handle SQLExceptions resulting from dead and" + "stale connections properly. Alternatively, investigate setting the MySQL server variable \"wait_timeout\"" + "to some high value rather than the default of 8 hours.", "1.1", HA_CATEGORY, 0); private BooleanConnectionProperty autoReconnectForPools = new BooleanConnectionProperty( "autoReconnectForPools", false, "Use a reconnection strategy appropriate for connection pools (defaults to 'false')", "3.1.3", HA_CATEGORY, 1); private boolean autoReconnectForPoolsAsBoolean = false; private MemorySizeConnectionProperty blobSendChunkSize = new MemorySizeConnectionProperty( "blobSendChunkSize", 1024 * 1024, 1, Integer.MAX_VALUE, "Chunk to use when sending BLOB/CLOBs via ServerPreparedStatements", "3.1.9", PERFORMANCE_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, "Should the driver cache the parsing stage of CallableStatements", "3.1.2", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty cachePreparedStatements = new BooleanConnectionProperty( "cachePrepStmts", false, "Should the driver cache the parsing stage of PreparedStatements of client-side " + "prepared statements, the \"check\" for suitability of server-side prepared " + " and server-side prepared statements themselves?", "3.0.10", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty cacheResultSetMetadata = new BooleanConnectionProperty( "cacheResultSetMetadata", false, "Should the driver cache ResultSetMetaData for Statements and PreparedStatements? (Req. JDK-1.4+, true/false, default 'false')", "3.1.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private boolean cacheResultSetMetaDataAsBoolean; private BooleanConnectionProperty cacheServerConfiguration = new BooleanConnectionProperty( "cacheServerConfiguration", false, "Should the driver cache the results of " + "'SHOW VARIABLES' and 'SHOW COLLATION' on a per-URL basis?", "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private IntegerConnectionProperty callableStatementCacheSize = new IntegerConnectionProperty( "callableStmtCacheSize", 100, 0, Integer.MAX_VALUE, "If 'cacheCallableStmts' is enabled, how many callable statements should be cached?", "3.1.2", PERFORMANCE_CATEGORY, 5); private BooleanConnectionProperty capitalizeTypeNames = new BooleanConnectionProperty( "capitalizeTypeNames", true, "Capitalize type names in DatabaseMetaData? (usually only useful when using WebObjects, true/false, defaults to 'false')", "2.0.7", MISC_CATEGORY, Integer.MIN_VALUE); private StringConnectionProperty characterEncoding = new StringConnectionProperty( "characterEncoding", null, "If 'useUnicode' is set to true, what character encoding should the driver use when dealing with strings? (defaults is to 'autodetect')", "1.1g", MISC_CATEGORY, 5); private String characterEncodingAsString = null; private StringConnectionProperty characterSetResults = new StringConnectionProperty( "characterSetResults", null, "Character set to tell the server to return results as.", "3.0.13", MISC_CATEGORY, 6); private BooleanConnectionProperty clobberStreamingResults = new BooleanConnectionProperty( "clobberStreamingResults", false, "This will cause a 'streaming' ResultSet to be automatically closed, " + "and any outstanding data still streaming from the server to be discarded if another query is executed " + "before all the data has been read from the server.", "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE); private StringConnectionProperty clobCharacterEncoding = new StringConnectionProperty( "clobCharacterEncoding", null, "The character encoding to use for sending and retrieving TEXT, MEDIUMTEXT " + "and LONGTEXT values instead of the configured connection characterEncoding", "5.0.0", MISC_CATEGORY, Integer.MIN_VALUE); private StringConnectionProperty connectionCollation = new StringConnectionProperty( "connectionCollation", null, "If set, tells the server to use this collation via 'set collation_connection'", "3.0.13", MISC_CATEGORY, 7); private IntegerConnectionProperty connectTimeout = new IntegerConnectionProperty( "connectTimeout", 0, 0, Integer.MAX_VALUE, "Timeout for socket connect (in milliseconds), with 0 being no timeout. " + "Only works on JDK-1.4 or newer. Defaults to '0'.", "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 9); private BooleanConnectionProperty continueBatchOnError = new BooleanConnectionProperty( "continueBatchOnError", true, "Should the driver continue processing batch commands if " + "one statement fails. The JDBC spec allows either way (defaults to 'true').", "3.0.3", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty createDatabaseIfNotExist = new BooleanConnectionProperty( "createDatabaseIfNotExist", false, "Creates the database given in the URL if it doesn't yet exist. Assumes " + " the configured user has permissions to create databases.", "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE); 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); private BooleanConnectionProperty detectServerPreparedStmts = new BooleanConnectionProperty( "useServerPrepStmts", false, "Use server-side prepared statements if the server supports them?", "3.1.0", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty dontTrackOpenResources = new BooleanConnectionProperty( "dontTrackOpenResources", false, "The JDBC specification requires the driver to automatically track and close resources, " + "however if your application doesn't do a good job of " + "explicitly calling close() on statements or result sets, " + "this can cause memory leakage. Setting this property to true " + "relaxes this constraint, and can be more memory efficient for " + "some applications.", "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty dumpQueriesOnException = new BooleanConnectionProperty( "dumpQueriesOnException", false, "Should the driver dump the contents of the query sent to the server in the message for SQLExceptions?", "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty dynamicCalendars = new BooleanConnectionProperty( "dynamicCalendars", false, "Should the driver retrieve the default" + " calendar when required, or cache it per connection/session?", "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty elideSetAutoCommits = new BooleanConnectionProperty( "elideSetAutoCommits", false, "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)?", "3.1.3", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty emptyStringsConvertToZero = new BooleanConnectionProperty( "emptyStringsConvertToZero", true, "Should the driver allow conversions from empty string " + "fields to numeric values of '0'?", "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty emulateLocators = new BooleanConnectionProperty( "emulateLocators", false, "N/A", "3.1.0", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty emulateUnsupportedPstmts = new BooleanConnectionProperty( "emulateUnsupportedPstmts", true, "Should the driver detect prepared statements that are not supported by the server, and " + "replace them with client-side emulated versions?", "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty enablePacketDebug = new BooleanConnectionProperty( "enablePacketDebug", false, "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", "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty enableQueryTimeouts = new BooleanConnectionProperty( "enableQueryTimeouts", true, "When enabled, query timeouts set via Statement.setQueryTimeout() use a shared " + "java.util.Timer instance for scheduling. Even if the timeout doesn't expire before the query is processed, there will be " + "memory used by the TimerTask for the given timeout which won't be reclaimed until " + "the time the timeout would have expired if it hadn't been cancelled by the driver. High-load environments " + "might want to consider disabling this functionality.", "5.0.6", PERFORMANCE_CATEGORY, Integer.MIN_VALUE); private BooleanConnectionProperty explainSlowQueries = new BooleanConnectionProperty( "explainSlowQueries", false, "If 'logSlowQueries' is enabled, should the driver automatically issue an 'EXPLAIN' on the" + " server and send the results to the configured log at a WARN level?", "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE); /** When failed-over, set connection to read-only? */ private BooleanConnectionProperty failOverReadOnly = new BooleanConnectionProperty( "failOverReadOnly", true, "When failing over in autoReconnect mode, should the connection be set to 'read-only'?", "3.0.12", HA_CATEGORY, 2); private BooleanConnectionProperty gatherPerformanceMetrics = new BooleanConnectionProperty( "gatherPerfMetrics",
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -