SysPropertiesThe constants defined in this class are initialized from system properties. Some system properties are per machine settings, and others are as a last resort and temporary solution to work around a problem in the application or database engine. Also, there are system properties to enable features that are not yet fully tested or that are not backward compatible.System properties can be set when starting the virtual machine: java -Dh2.baseDir=/tempThey can be set within the application, but this must be done before loading any classes of this database (before loading the JDBC driver):
System.setProperty("h2.baseDir", "/temp");
ALIAS_COLUMN_NAMESystem property
h2.aliasColumnName (default: false).When enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the alias (I in this case) in ResultSetMetaData.getColumnName() and 'null' in getTableName(). If disabled, the real column name (ID in this case) and table name is returned. This setting only affects the default mode. When using different modes, this feature is disabled for compatibility for all databases except MySQL. For MySQL, it is always enabled. ALLOWED_CLASSESSystem property
h2.allowedClasses (default: *).Comma separated list of class names or prefixes. ALLOW_BIG_DECIMAL_EXTENSIONSSystem property
h2.allowBigDecimalExtensions (default:
false).When enabled, classes that extend BigDecimal are supported in PreparedStatement.setBigDecimal. ANALYZE_AUTOSystem property
h2.analyzeAuto (default: 0).After changing this many rows, ANALYZE is automatically run for a table. Automatically running ANALYZE is disabled if set to 0. If set to 1000, then ANALYZE will run against each user table after about 1000 changes to that table. The time between running ANALYZE doubles each time since starting the database. It is not run on local temporary tables, and tables that have a trigger on SELECT. ANALYZE_SAMPLESystem property
h2.analyzeSample (default: 10000).The default sample size when analyzing a table. BIND_ADDRESSSystem property
h2.bindAddress (default: null).Comma separated list of class names or prefixes. BROWSERSystem property
h2.browser (default: null).The preferred browser to use. If not set, the default browser is used. For Windows, to use the Internet Explorer, set this property to 'explorer'. For Mac OS, if the default browser is not Safari and you want to use Safari, use: java -Dh2.browser="open,-a,Safari,%url" ....CACHE_SIZE_DEFAULTSystem property
h2.cacheSizeDefault (default: 16384).The default cache size in KB. CACHE_TYPE_DEFAULTSystem property
h2.cacheTypeDefault (default: LRU).How many time the cache size value is divided by two to get the index cache size. The index cache size is calculated like this: cacheSize >> cacheSizeIndexShift. CHECKSystem property
h2.check (default: true).Assertions in the database engine. CHECK2System property
h2.check2 (default: true).Additional assertions in the database engine. CLIENT_TRACE_DIRECTORYSystem property
h2.clientTraceDirectory (default:
trace.db/).Directory where the trace files of the JDBC client are stored (only for client / server). CONSOLE_STREAMSystem property
h2.consoleStream (default: true).H2 Console: stream query results. DATABASE_TO_UPPERSystem property
h2.databaseToUpper (default: true).Database short names are converted to uppercase for the DATABASE() function, and in the CATALOG column of all database meta data methods. Setting this to "false" is experimental. DATASOURCE_TRACE_LEVELSystem property
h2.dataSourceTraceLevel (default: 1).The trace level of the data source implementation. Default is 1 for error. DEFAULT_ESCAPESystem property
h2.defaultEscape (default: \).The default escape character for LIKE comparisons. To select no escape character, use an empty string. DEFAULT_LOCK_MODESystem property
h2.defaultLockMode (default: 3).The default value for the LOCK_MODE setting. DEFAULT_MAX_LENGTH_INPLACE_LOBSystem property
h2.defaultMaxLengthInplaceLob
(default: 4096).The default maximum length of an LOB that is stored in the database file. DEFAULT_MAX_LENGTH_INPLACE_LOB2System property
h2.defaultMaxLengthInplaceLob2
(default: 128).The default maximum length of an LOB that is stored with the record itself. Only used if h2.lobInDatabase is enabled. DEFAULT_MAX_MEMORY_UNDOSystem property
h2.defaultMaxMemoryUndo (default: 50000).The default value for the MAX_MEMORY_UNDO setting. DEFAULT_MAX_OPERATION_MEMORYSystem property
h2.defaultMaxOperationMemory (default:
100000).The default for the setting MAX_OPERATION_MEMORY. DEFAULT_RESULT_SET_CONCURRENCYSystem property
h2.defaultResultSetConcurrency (default:
ResultSet.CONCUR_READ_ONLY).The default result set concurrency for statements created with Connection.createStatement() or prepareStatement(String sql). DELAY_WRONG_PASSWORD_MAXSystem property
h2.delayWrongPasswordMax (default: 4000).The maximum delay in milliseconds before an exception is thrown for using the wrong user name or password. This slows down brute force attacks. The delay is reset after a successful login. The value 0 means there is no maximum delay. DELAY_WRONG_PASSWORD_MINSystem property
h2.delayWrongPasswordMin (default: 250).The minimum delay in milliseconds before an exception is thrown for using the wrong user name or password. This slows down brute force attacks. The delay is reset to this value after a successful login. Unsuccessful logins will double the time until DELAY_WRONG_PASSWORD_MAX. To disable the delay, set this system property to 0. DROP_RESTRICTSystem property
h2.dropRestrict (default: false).Whether the default action for DROP TABLE and DROP VIEW is RESTRICT. For most databases, the default action is RESTRICT, but for compatibility with older versions of H2 the default action is currently CASCADE. This will change in a future version of H2. ENABLE_ANONYMOUS_SSLSystem property
h2.enableAnonymousSSL (default: true).When using SSL connection, the anonymous cipher suite SSL_DH_anon_WITH_RC4_128_MD5 should be enabled. ESTIMATED_FUNCTION_TABLE_ROWSSystem property
h2.estimatedFunctionTableRows (default:
1000).The estimated number of rows in a function table (for example, CSVREAD or FTL_SEARCH). This value is used by the optimizer. FILE_ENCODINGSystem property
file.encoding (default: Cp1252).It is usually set by the system and is the default encoding used for the RunScript and CSV tool. FILE_SEPARATORSystem property
file.separator (default: /).It is usually set by the system, and used to build absolute file names. FUNCTIONS_IN_SCHEMASystem property
h2.functionsInSchema (default:
false).If set, all functions are stored in a schema. Specially, the SCRIPT statement will always include the schema name in the CREATE ALIAS statement. This is not backward compatible with H2 versions 1.2.134 and older. IDENTIFIERS_TO_UPPERSystem property
h2.identifiersToUpper (default: true).Unquoted identifiers in SQL statements are case insensitive and converted to uppercase. JAVA_SPECIFICATION_VERSIONSystem property
java.specification.version.It is set by the system. Examples: 1.4, 1.5, 1.6. LARGE_RESULT_BUFFER_SIZESystem property
h2.largeResultBufferSize (default: 4096).Buffer size for large result sets. Set this value to 0 to disable the buffer. LARGE_TRANSACTIONSSystem property
h2.largeTransactions (default: false).Support very large transactions LINE_SEPARATORSystem property
line.separator (default: \n).It is usually set by the system, and used by the script and trace tools. LOB_FILES_PER_DIRECTORYSystem property
h2.lobFilesPerDirectory (default: 256).Maximum number of LOB files per directory. LOB_IN_DATABASESystem property
h2.lobInDatabase (default: false).Store LOB files in the database. LOG_ALL_ERRORSSystem property
h2.logAllErrors (default: false).Write stack traces of any kind of error to a file. LOG_ALL_ERRORS_FILESystem property
h2.logAllErrorsFile (default:
h2errors.txt).File name to log errors. MAX_COMPACT_COUNTSystem property
h2.maxCompactCount
(default: Integer.MAX_VALUE).The maximum number of pages to move when closing a database. MAX_COMPACT_TIMESystem property
h2.maxCompactTime (default: 200).The maximum time in milliseconds used to compact a database when closing. MAX_FILE_RETRYSystem property
h2.maxFileRetry (default: 16).Number of times to retry file delete and rename. in Windows, files can't be deleted if they are open. Waiting a bit can help (sometimes the Windows Explorer opens the files for a short time) may help. Sometimes, running garbage collection may close files if the user forgot to call Connection.close() or InputStream.close(). MAX_MEMORY_ROWS_DISTINCTSystem property
h2.maxMemoryRowsDistinct (default:
Integer.MAX_VALUE).The maximum number of rows kept in-memory for SELECT DISTINCT queries. If more than this number of rows are in a result set, a temporary table is used. MAX_RECONNECTSystem property
h2.maxReconnect (default: 3).The maximum number of tries to reconnect in a row. MAX_TRACE_DATA_LENGTHSystem property
h2.maxTraceDataLength (default: 65535).The maximum size of a LOB value that is written as data to the trace system. MIN_COLUMN_NAME_MAPSystem property
h2.minColumnNameMap (default: 3).The minimum number of columns where a hash table is created when result set methods with column name (instead of column index) parameter are called. MIN_WRITE_DELAYSystem property
h2.minWriteDelay (default: 5).The minimum write delay that causes commits to be delayed. NESTED_JOINSSystem property
h2.nestedJoins (default: false).Whether nested joins should be supported. NIO_CLEANER_HACKSystem property
h2.nioCleanerHack (default: false).If enabled, use the reflection hack to un-map the mapped file if possible. If disabled, System.gc() is called in a loop until the object is garbage collected. See also http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038 NIO_LOAD_MAPPEDSystem property
h2.nioLoadMapped (default: false).If the mapped buffer should be loaded when the file is opened. This can improve performance. OBJECT_CACHESystem property
h2.objectCache (default: true).Cache commonly used values (numbers, strings). There is a shared cache for all values. OBJECT_CACHE_MAX_PER_ELEMENT_SIZESystem property
h2.objectCacheMaxPerElementSize (default:
4096).The maximum size (precision) of an object in the cache. OBJECT_CACHE_SIZESystem property
h2.objectCacheSize (default: 1024).The maximum number of objects in the cache. This value must be a power of 2. OPTIMIZE_DISTINCTSystem property
h2.optimizeDistinct (default: true).Improve the performance of simple DISTINCT queries if an index is available for the given column. The optimization is used if:
OPTIMIZE_EVALUATABLE_SUBQUERIESSystem property
h2.optimizeEvaluatableSubqueries (default:
true).Optimize subqueries that are not dependent on the outer query. OPTIMIZE_IN_LISTSystem property
h2.optimizeInList (default: true).Optimize IN(...) and IN(SELECT ...) comparisons. This includes optimization for SELECT, DELETE, and UPDATE. OPTIMIZE_IS_NULLSystem property
h2.optimizeIsNull (default: false).Use an index for condition of the form columnName IS NULL. OPTIMIZE_ORSystem property
h2.optimizeOr (default: false).Convert (C=? OR C=?) to (C IN(?, ?)). OPTIMIZE_SUBQUERY_CACHESystem property
h2.optimizeSubqueryCache (default: true).Cache subquery results. OPTIMIZE_TWO_EQUALSSystem property
h2.optimizeTwoEquals (default: true).Optimize expressions of the form A=B AND B=1. In this case, AND A=1 is added so an index on A can be used. OPTIMIZE_UPDATESystem property
h2.optimizeUpdate (default: true).Speed up inserts, updates, and deletes by not reading all rows from a page unless necessary. PAGE_SIZESystem property
h2.pageSize (default: 2048).The page size to use for new databases. PAGE_STORE_INTERNAL_COUNTSystem property
h2.pageStoreInternalCount (default: false).Update the row counts on a node level. PAGE_STORE_TRIMSystem property
h2.pageStoreTrim (default: true).Trim the database size when closing. PG_DEFAULT_CLIENT_ENCODINGSystem property
h2.pgClientEncoding (default: UTF-8).Default client encoding for PG server. It is used if the client does not sends his encoding. PREFIX_TEMP_FILESystem property
h2.prefixTempFile (default: h2.temp).The prefix for temporary files in the temp directory. QUERY_CACHE_SIZESystem property
h2.commandCacheSize (default: 0).The size of the query cache. Each session has it's own cache with the given size. The cache is only used if the SQL statement and all parameters match. Only the last returned result per query is cached. Only SELECT statements are cached (excluding UNION and FOR UPDATE statements). This works for both statements and prepared statement. RECOMPILE_ALWAYSSystem property
h2.recompileAlways (default: false).Always recompile prepared statements. RECONNECT_CHECK_DELAYSystem property
h2.reconnectCheckDelay (default: 200).Check the .lock.db file every this many milliseconds to detect that the database was changed. The process writing to the database must first notify a change in the .lock.db file, then wait twice this many milliseconds before updating the database. REDO_BUFFER_SIZESystem property
h2.redoBufferSize (default: 262144).Size of the redo buffer (used at startup when recovering). RESERVE_MEMORYSystem property
h2.reserveMemory (default: 524288).This many bytes in main memory are allocated as a reserve. This reserve is freed up when if no memory is available, so that rolling back a large transaction is easier. RETURN_LOB_OBJECTSSystem property
h2.returnLobObjects (default: true).When true, ResultSet.getObject for CLOB or BLOB will return a java.sql.Clob / java.sql.Blob object. When set to false, it will return a java.io.Reader / java.io.InputStream. SELECT_FOR_UPDATE_MVCCSystem property
h2.selectForUpdateMvcc (default: false).If set, SELECT .. FOR UPDATE queries lock the rows when using MVCC. SERVER_CACHED_OBJECTSSystem property
h2.serverCachedObjects (default: 64).TCP Server: number of cached objects per session. SERVER_RESULT_SET_FETCH_SIZESystem property
h2.serverResultSetFetchSize
(default: 100).The default result set fetch size when using the server mode. SHARE_LINKED_CONNECTIONSSystem property
h2.shareLinkedConnections
(default: true).Linked connections should be shared, that means connections to the same database should be used for all linked tables that connect to the same database. SOCKET_CONNECT_RETRYSystem property
h2.socketConnectRetry (default: 16).The number of times to retry opening a socket. Windows sometimes fails to open a socket, see bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213296 SOCKET_CONNECT_TIMEOUTSystem property
h2.socketConnectTimeout (default: 2000).The timeout in milliseconds to connect to a server. SORT_NULLS_HIGHSystem property
h2.sortNullsHigh (default: false).Invert the default sorting behavior for NULL values, such that NULL values are sorted to the end of a result set in an ascending sort and to the beginning of a result set in a descending sort. SPLIT_FILE_SIZE_SHIFTSystem property
h2.splitFileSizeShift (default: 30).The maximum file size of a split file is 1L << x. SYNC_METHODSystem property
h2.syncMethod (default: sync).What method to call when closing the database, on checkpoint, and on CHECKPOINT SYNC. The following options are supported: "sync" (default): RandomAccessFile.getFD().sync(); "force": RandomAccessFile.getChannel().force(true); "forceFalse": RandomAccessFile.getChannel().force(false); "": do not call a method (fast but there is a risk of data loss on power failure). TRACE_IOSystem property
h2.traceIO (default: false).Trace all I/O operations. USER_HOMESystem property
user.home (empty string if not set).It is usually set by the system, and used as a replacement for ~ in file names. WEB_MAX_VALUE_LENGTHSystem property
h2.webMaxValueLength (default: 100000).The H2 Console will abbreviate (truncate) result values larger than this size. The data in the database is not truncated, it is only to avoid out of memory in the H2 Console application. lobCloseBetweenReadsSystem property
h2.lobCloseBetweenReads (default: false).Close LOB files between read operations. runFinalizeSystem property
h2.runFinalize (default: true).Run finalizers to detect unclosed connections. | ||||||||||||||