SysProperties

The constants defined in this class are initialized from system properties. Those properties can be set when starting the virtual machine:
 java -Dh2.baseDir=/temp
They 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");



Fields
static boolean ALIAS_COLUMN_NAME
static String ALLOWED_CLASSES
static boolean ALLOW_BIG_DECIMAL_EXTENSIONS
static String BIND_ADDRESS
static int CACHE_SIZE_DEFAULT
static int CACHE_SIZE_INDEX_SHIFT
static boolean CHECK
static boolean CHECK2
static String CLIENT_TRACE_DIRECTORY
static int COLLATOR_CACHE_SIZE
static int DATASOURCE_TRACE_LEVEL
static int DEFAULT_LOCK_MODE
static int DEFAULT_MAX_MEMORY_UNDO
static int DEFAULT_MAX_OPERATION_MEMORY
static int DELAY_WRONG_PASSWORD_MAX
static int DELAY_WRONG_PASSWORD_MIN
static boolean DOLLAR_QUOTING
static int EMERGENCY_SPACE_INITIAL
static int EMERGENCY_SPACE_MIN
static boolean ENABLE_ANONYMOUS_SSL
static String FILE_ENCODING
static String FILE_SEPARATOR
static int LARGE_RESULT_BUFFER_SIZE
static String LINE_SEPARATOR
static boolean LOB_FILES_IN_DIRECTORIES
static int LOB_FILES_PER_DIRECTORY
static boolean LOG_ALL_ERRORS
static String LOG_ALL_ERRORS_FILE
static int MAX_FILE_RETRY
static int MAX_MEMORY_ROWS_DISTINCT
static int MAX_QUERY_TIMEOUT
static int MIN_COLUMN_NAME_MAP
static int MIN_WRITE_DELAY
static boolean OBJECT_CACHE
static int OBJECT_CACHE_MAX_PER_ELEMENT_SIZE
static int OBJECT_CACHE_SIZE
static boolean OLD_COMMAND_LINE_OPTIONS
static boolean OPTIMIZE_DISTINCT
static boolean OPTIMIZE_DROP_DEPENDENCIES
static boolean OPTIMIZE_EVALUATABLE_SUBQUERIES
static boolean OPTIMIZE_GROUP_SORTED
static boolean OPTIMIZE_IN
static boolean OPTIMIZE_IN_JOIN
static boolean OPTIMIZE_MIN_MAX
static boolean OPTIMIZE_NOT
static boolean OPTIMIZE_SUBQUERY_CACHE
static boolean OPTIMIZE_TWO_EQUALS
static boolean OVERFLOW_EXCEPTIONS
static boolean RECOMPILE_ALWAYS
static int REDO_BUFFER_SIZE
static int RESERVE_MEMORY
static int REUSE_SPACE_AFTER
static boolean REUSE_SPACE_QUICKLY
static int SERVER_CACHED_OBJECTS
static int SERVER_RESULT_SET_FETCH_SIZE
static boolean SORT_NULLS_HIGH
static boolean TRACE_IO
static String USER_HOME
static boolean lobCloseBetweenReads
static boolean runFinalize
static String scriptDirectory

ALIAS_COLUMN_NAME

System property h2.aliasColumnName (default: false).
When enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the real table and column name in ResultSetMetaData.getTableName() and getColumnName(). This is disabled by default for compatibility with other databases (HSQLDB, Apache Derby, PostgreSQL, some version of MySQL).

ALLOWED_CLASSES

System property h2.allowedClasses (default: *).
Comma separated list of class names or prefixes.

ALLOW_BIG_DECIMAL_EXTENSIONS

System property h2.allowBigDecimalExtensions (default: false).
When enabled, classes that extend BigDecimal are supported in PreparedStatement.setBigDecimal.

BIND_ADDRESS

System property h2.bindAddress (default: *).
Comma separated list of class names or prefixes.

CACHE_SIZE_DEFAULT

System property h2.cacheSizeDefault (default: 16384).
The default cache size in KB.

CACHE_SIZE_INDEX_SHIFT

System property h2.cacheSizeIndexShift (default: 3).
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.

CHECK

System property h2.check (default: true).
Assertions in the database engine.

CHECK2

System property h2.check2 (default: true).
Additional assertions in the database engine.

CLIENT_TRACE_DIRECTORY

System property h2.clientTraceDirectory (default: trace.db/).
Directory where the trace files of the JDBC client are stored (only for client / server).

COLLATOR_CACHE_SIZE

System property h2.collatorCacheSize (default: 10000).
The cache size for collation keys (in elements). Used when a collator has been set for the database.

DATASOURCE_TRACE_LEVEL

System property h2.dataSourceTraceLevel (default: 1).
The trace level of the data source implementation. Default is 1 for error.

DEFAULT_LOCK_MODE

System property h2.defaultLockMode (default: 3).
The default value for the LOCK_MODE setting.

DEFAULT_MAX_MEMORY_UNDO

System property h2.defaultMaxMemoryUndo (default: 100000).
The default value for the MAX_MEMORY_UNDO setting.

DEFAULT_MAX_OPERATION_MEMORY

System property h2.defaultMaxOperationMemory (default: 100000).
The default for the setting MAX_OPERATION_MEMORY.

DELAY_WRONG_PASSWORD_MAX

System 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_MIN

System 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.

DOLLAR_QUOTING

System property h2.dollarQuoting (default: true).
Dollar quoting is used to quote text without having to use escape characters. A dollar quoted string starts and ends with $$. Inside the text, $$ is not allowed.

EMERGENCY_SPACE_INITIAL

System property h2.emergencySpaceInitial (default: 262144).
Size of 'reserve' file to detect disk full problems early.

EMERGENCY_SPACE_MIN

System property h2.emergencySpaceMin (default: 65536).
Minimum size of 'reserve' file.

ENABLE_ANONYMOUS_SSL

System property h2.enableAnonymousSSL (default: true).
Comma separated list of class names or prefixes.

FILE_ENCODING

System 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_SEPARATOR

System property file.separator (default: /).
It is usually set by the system, and used to build absolute file names.

LARGE_RESULT_BUFFER_SIZE

System property h2.largeResultBufferSize (default: 4096).
Buffer size for large result sets. Set this value to 0 to disable the buffer.

LINE_SEPARATOR

System property line.separator (default: \n).
It is usually set by the system, and used by the script and trace tools.

LOB_FILES_IN_DIRECTORIES

System property h2.lobFilesInDirectories (default: false).
Store LOB files in subdirectories.

LOB_FILES_PER_DIRECTORY

System property h2.lobFilesPerDirectory (default: 256).
Maximum number of LOB files per directory.

LOG_ALL_ERRORS

System property h2.logAllErrors (default: false).
Write stack traces of any kind of error to a file.

LOG_ALL_ERRORS_FILE

System property h2.logAllErrorsFile (default: h2errors.txt).
File name to log errors.

MAX_FILE_RETRY

System property h2.maxFileRetry (default: 16).
Number of times to retry file delete and rename.

MAX_MEMORY_ROWS_DISTINCT

System 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_QUERY_TIMEOUT

System property h2.maxQueryTimeout (default: 0).
The maximum timeout of a query. The default is 0, meaning no limit.

MIN_COLUMN_NAME_MAP

System 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_DELAY

System property h2.minWriteDelay (default: 5).
The minimum write delay that causes commits to be delayed.

OBJECT_CACHE

System property h2.objectCache (default: true).
Cache commonly used objects (integers, strings).

OBJECT_CACHE_MAX_PER_ELEMENT_SIZE

System property h2.objectCacheMaxPerElementSize (default: 4096).
Maximum size of an object in the cache.

OBJECT_CACHE_SIZE

System property h2.objectCacheSize (default: 1024).
Maximum size of an object in the cache. This value must be a power of 2.

OLD_COMMAND_LINE_OPTIONS

System property h2.oldCommandLineOptions (default: true).
Support old command line options.

OPTIMIZE_DISTINCT

System 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:
  • The select is a single column query without condition
  • The query contains only one table, and no group by
  • There is only one table involved
  • There is an ascending index on the column
  • The selectivity of the column is below 20

OPTIMIZE_DROP_DEPENDENCIES

System property h2.optimizeDropDependencies (default: true).
Improve the performance of DROP and DROP ALL OBJECTS by quicker scanning if other objects depend on this object.

OPTIMIZE_EVALUATABLE_SUBQUERIES

System property h2.optimizeEvaluatableSubqueries (default: true).
Optimize subqueries that are not dependent on the outer query.

OPTIMIZE_GROUP_SORTED

System property h2.optimizeGroupSorted (default: false).
Optimize GROUP BY queries if an index can be used that matches the group by columns.

OPTIMIZE_IN

System property h2.optimizeIn (default: true).
Optimize IN(...) comparisons.

OPTIMIZE_IN_JOIN

System property h2.optimizeInJoin (default: false).
Optimize IN(...) comparisons by converting them to inner joins.

OPTIMIZE_MIN_MAX

System property h2.optimizeMinMax (default: true).
Optimize MIN and MAX aggregate functions.

OPTIMIZE_NOT

System property h2.optimizeNot (default: true).
Optimize NOT conditions by removing the NOT and inverting the condition.

OPTIMIZE_SUBQUERY_CACHE

System property h2.optimizeSubqueryCache (default: true).
Cache subquery results.

OPTIMIZE_TWO_EQUALS

System 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.

OVERFLOW_EXCEPTIONS

System property h2.overflowExceptions (default: true).
Throw an exception on integer overflows.

RECOMPILE_ALWAYS

System property h2.recompileAlways (default: false).
Always recompile prepared statements.

REDO_BUFFER_SIZE

System property h2.redoBufferSize (default: 262144).
Size of the redo buffer (used at startup when recovering).

RESERVE_MEMORY

System property h2.reserveMemory (default: 131072).
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.

REUSE_SPACE_AFTER

System property h2.reuseSpaceAfter (default: 16).
Reuse space in database files after this many pages are free.

REUSE_SPACE_QUICKLY

System property h2.reuseSpaceQuickly (default: true).
Reuse space in database files quickly.

SERVER_CACHED_OBJECTS

System property h2.serverCachedObjects (default: 64).
TCP Server: number of cached objects per session.

SERVER_RESULT_SET_FETCH_SIZE

System property h2.serverResultSetFetchSize (default: 100).
The default result set fetch size when using the server mode.

SORT_NULLS_HIGH

System 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.

TRACE_IO

System property h2.traceIO (default: false).
Trace all I/O operations.

USER_HOME

System property user.home (default: empty string).
It is usually set by the system, and used as a replacement for ~ in file names.

lobCloseBetweenReads

System property h2.lobCloseBetweenReads (default: false).
Close LOB files between read operations.

runFinalize

System property h2.runFinalize (default: true).
Run finalizers to detect unclosed connections.

scriptDirectory

System property h2.scriptDirectory (default: empty string).
Relative or absolute directory where the script files are stored to or read from.