public class SysProperties
extends java.lang.Object
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");
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOWED_CLASSES
System property
h2.allowedClasses (default: *).Comma separated list of class names or prefixes. |
static boolean |
BIG_DECIMAL_IS_DECIMAL
System property
h2.bigDecimalIsDecimal , true by default. |
static java.lang.String |
BIND_ADDRESS
System property
h2.bindAddress (default: null).The bind address to use. |
static boolean |
CHECK
System property
h2.check (default: true).Assertions in the database engine. |
static boolean |
CHECK2
System property
h2.check2 (default: false).Additional assertions in the database engine. |
static java.lang.String |
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). |
static int |
COLLATOR_CACHE_SIZE
System property
h2.collatorCacheSize (default: 32000).The cache size for collation keys (in elements). |
static int |
CONSOLE_MAX_PROCEDURES_LIST_COLUMNS
System property
h2.consoleProcedureColumns
(default: 500).Up to this many procedures, the column names are listed. |
static int |
CONSOLE_MAX_TABLES_LIST_COLUMNS
System property
h2.consoleTableColumns
(default: 500).Up to this many tables, the column names are listed. |
static int |
CONSOLE_MAX_TABLES_LIST_INDEXES
System property
h2.consoleTableIndexes
(default: 100).Up to this many tables, the column type and indexes are listed. |
static boolean |
CONSOLE_STREAM
System property
h2.consoleStream (default: true).H2 Console: stream query results. |
static int |
CONSOLE_TIMEOUT
System property
h2.consoleTimeout (default: 1800000).H2 Console: session timeout in milliseconds. |
static java.lang.String |
CUSTOM_DATA_TYPES_HANDLER
System property
h2.customDataTypesHandler
(default: null).The CustomDataTypesHandler class name that is used to provide support for user defined custom data types. |
static int |
DATASOURCE_TRACE_LEVEL
System property
h2.dataSourceTraceLevel (default: 1).The trace level of the data source implementation. |
static int |
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. |
static int |
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. |
static boolean |
ENABLE_ANONYMOUS_TLS
System property
h2.enableAnonymousTLS (default: true).When using TLS connection, the anonymous cipher suites should be enabled. |
static java.lang.String |
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. |
static java.lang.String |
FILE_SEPARATOR
System property
file.separator (default: /).It is usually set by the system, and used to build absolute file names. |
static java.lang.String |
H2_BROWSER
INTERNAL
|
static java.lang.String |
H2_SCRIPT_DIRECTORY
INTERNAL
|
static boolean |
IMPLICIT_RELATIVE_PATH
System property
h2.implicitRelativePath
(default: true for version 1.3, false for version 1.4).If disabled, relative paths in database URLs need to be written as jdbc:h2:./test instead of jdbc:h2:test. |
static java.lang.String |
JAVA_OBJECT_SERIALIZER
System property
h2.javaObjectSerializer
(default: null).The JavaObjectSerializer class name for java objects being stored in column of type OTHER. |
static boolean |
JAVA_SYSTEM_COMPILER
System property
h2.javaSystemCompiler (default: true).Whether to use the Java system compiler (ToolProvider.getSystemJavaCompiler()) if it is available to compile user defined functions. |
static java.lang.String |
LINE_SEPARATOR
System property
line.separator (default: \n).It is usually set by the system, and used by the script and trace tools. |
static int |
LOB_CLIENT_MAX_SIZE_MEMORY
System property
h2.lobClientMaxSizeMemory (default:
1048576).The maximum size of a LOB object to keep in memory on the client side when using the server mode. |
static int |
LOB_FILES_PER_DIRECTORY
System property
h2.lobFilesPerDirectory
(default: 256).Maximum number of LOB files per directory. |
static boolean |
lobCloseBetweenReads
System property
h2.lobCloseBetweenReads
(default: false).Close LOB files between read operations. |
static int |
MAX_FILE_RETRY
System property
h2.maxFileRetry (default: 16).Number of times to retry file delete and rename. |
static int |
MAX_MEMORY_ROWS
System property
h2.maxMemoryRows
(default: 40000 per GB of available RAM).The default maximum number of rows to be kept in memory in a result set. |
static int |
MAX_RECONNECT
System property
h2.maxReconnect (default: 3).The maximum number of tries to reconnect in a row. |
static long |
MAX_TRACE_DATA_LENGTH
System property
h2.maxTraceDataLength
(default: 65535).The maximum size of a LOB value that is written as data to the trace system. |
static boolean |
MODIFY_ON_WRITE
System property
h2.modifyOnWrite (default: false).Only modify the database file when recovery is necessary, or when writing to the database. |
static boolean |
NIO_CLEANER_HACK
System property
h2.nioCleanerHack (default: false).If enabled, use the reflection hack to un-map the mapped file if possible. |
static boolean |
NIO_LOAD_MAPPED
System property
h2.nioLoadMapped (default: false).If the mapped buffer should be loaded when the file is opened. |
static boolean |
OBJECT_CACHE
System property
h2.objectCache (default: true).Cache commonly used values (numbers, strings). |
static int |
OBJECT_CACHE_MAX_PER_ELEMENT_SIZE
System property
h2.objectCacheMaxPerElementSize (default:
4096).The maximum size (precision) of an object in the cache. |
static int |
OBJECT_CACHE_SIZE
System property
h2.objectCacheSize (default: 1024).The maximum number of objects in the cache. |
static boolean |
OLD_RESULT_SET_GET_OBJECT
System property
h2.oldResultSetGetObject , true by default. |
static boolean |
OLD_STYLE_OUTER_JOIN
System property
h2.oldStyleOuterJoin
(default: true for version 1.3, false for version 1.4).Limited support for the old-style Oracle outer join with "(+)". |
static java.lang.String |
PG_DEFAULT_CLIENT_ENCODING
System property
h2.pgClientEncoding (default: UTF-8).Default client encoding for PG server. |
static java.lang.String |
PREFIX_TEMP_FILE
System property
h2.prefixTempFile (default: h2.temp).The prefix for temporary files in the temp directory. |
static boolean |
serializeJavaObject
System property
h2.serializeJavaObject
(default: true).If true, values of type OTHER will be stored in serialized form and have the semantics of binary data for all operations (such as sorting and conversion to string). |
static int |
SERVER_CACHED_OBJECTS
System property
h2.serverCachedObjects (default: 64).TCP Server: number of cached objects per session. |
static int |
SERVER_RESULT_SET_FETCH_SIZE
System property
h2.serverResultSetFetchSize
(default: 100).The default result set fetch size when using the server mode. |
static int |
SOCKET_CONNECT_RETRY
System property
h2.socketConnectRetry (default: 16).The number of times to retry opening a socket. |
static int |
SOCKET_CONNECT_TIMEOUT
System property
h2.socketConnectTimeout
(default: 2000).The timeout in milliseconds to connect to a server. |
static boolean |
SORT_BINARY_UNSIGNED
System property
h2.sortBinaryUnsigned
(default: false with version 1.3, true with version 1.4).Whether binary data should be sorted in unsigned mode (0xff is larger than 0x00). |
static boolean |
SORT_NULLS_HIGH
System property
h2.sortNullsHigh (default: false).Invert the default sorting behavior for NULL, such that NULL is at the end of a result set in an ascending sort and at the beginning of a result set in a descending sort. |
static long |
SPLIT_FILE_SIZE_SHIFT
System property
h2.splitFileSizeShift (default: 30).The maximum file size of a split file is 1L << x. |
static java.lang.String |
SYNC_METHOD
System property
h2.syncMethod (default: sync).What method to call when closing the database, on checkpoint, and on CHECKPOINT SYNC. |
static boolean |
THREAD_DEADLOCK_DETECTOR
System property
h2.threadDeadlockDetector
(default: false).Detect thread deadlocks in a background thread. |
static boolean |
TRACE_IO
System property
h2.traceIO (default: false).Trace all I/O operations. |
static boolean |
UNLIMITED_TIME_RANGE
System property
h2.unlimitedTimeRange , false by default. |
static java.lang.String |
URL_MAP
System property
h2.urlMap (default: null).A properties file that contains a mapping between database URLs. |
static boolean |
USE_THREAD_CONTEXT_CLASS_LOADER
System property
h2.useThreadContextClassLoader
(default: false).Instead of using the default class loader when deserializing objects, the current thread-context class loader will be used. |
static java.lang.String |
USER_HOME
System property
user.home (empty string if not set).It is usually set by the system, and used as a replacement for ~ in file names. |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBaseDir()
INTERNAL
|
static java.lang.String |
getScriptDirectory()
System property
h2.scriptDirectory (default: empty
string).Relative or absolute directory where the script files are stored to or read from. |
static void |
setBaseDir(java.lang.String dir)
INTERNAL
|
public static final java.lang.String H2_SCRIPT_DIRECTORY
public static final java.lang.String H2_BROWSER
public static final java.lang.String FILE_ENCODING
file.encoding
(default: Cp1252).public static final java.lang.String FILE_SEPARATOR
file.separator
(default: /).public static final java.lang.String LINE_SEPARATOR
line.separator
(default: \n).public static final java.lang.String USER_HOME
user.home
(empty string if not set).public static final java.lang.String ALLOWED_CLASSES
h2.allowedClasses
(default: *).public static final boolean ENABLE_ANONYMOUS_TLS
h2.enableAnonymousTLS
(default: true).public static final java.lang.String BIND_ADDRESS
h2.bindAddress
(default: null).public static final boolean CHECK
h2.check
(default: true).public static final boolean CHECK2
h2.check2
(default: false).public static final java.lang.String CLIENT_TRACE_DIRECTORY
h2.clientTraceDirectory
(default:
trace.db/).public static final int COLLATOR_CACHE_SIZE
h2.collatorCacheSize
(default: 32000).public static final int CONSOLE_MAX_TABLES_LIST_INDEXES
h2.consoleTableIndexes
(default: 100).public static final int CONSOLE_MAX_TABLES_LIST_COLUMNS
h2.consoleTableColumns
(default: 500).public static final int CONSOLE_MAX_PROCEDURES_LIST_COLUMNS
h2.consoleProcedureColumns
(default: 500).public static final boolean CONSOLE_STREAM
h2.consoleStream
(default: true).public static final int CONSOLE_TIMEOUT
h2.consoleTimeout
(default: 1800000).public static final int DATASOURCE_TRACE_LEVEL
h2.dataSourceTraceLevel
(default: 1).public static final int DELAY_WRONG_PASSWORD_MIN
h2.delayWrongPasswordMin
(default: 250).public static final int DELAY_WRONG_PASSWORD_MAX
h2.delayWrongPasswordMax
(default: 4000).public static final boolean JAVA_SYSTEM_COMPILER
h2.javaSystemCompiler
(default: true).public static boolean lobCloseBetweenReads
h2.lobCloseBetweenReads
(default: false).public static final int LOB_FILES_PER_DIRECTORY
h2.lobFilesPerDirectory
(default: 256).public static final int LOB_CLIENT_MAX_SIZE_MEMORY
h2.lobClientMaxSizeMemory
(default:
1048576).public static final int MAX_FILE_RETRY
h2.maxFileRetry
(default: 16).public static final int MAX_RECONNECT
h2.maxReconnect
(default: 3).public static final int MAX_MEMORY_ROWS
h2.maxMemoryRows
(default: 40000 per GB of available RAM).public static final long MAX_TRACE_DATA_LENGTH
h2.maxTraceDataLength
(default: 65535).public static final boolean MODIFY_ON_WRITE
h2.modifyOnWrite
(default: false).public static final boolean NIO_LOAD_MAPPED
h2.nioLoadMapped
(default: false).public static final boolean NIO_CLEANER_HACK
h2.nioCleanerHack
(default: false).public static final boolean OBJECT_CACHE
h2.objectCache
(default: true).public static final int OBJECT_CACHE_MAX_PER_ELEMENT_SIZE
h2.objectCacheMaxPerElementSize
(default:
4096).public static final int OBJECT_CACHE_SIZE
h2.objectCacheSize
(default: 1024).public static final boolean OLD_STYLE_OUTER_JOIN
h2.oldStyleOuterJoin
(default: true for version 1.3, false for version 1.4).public static final boolean OLD_RESULT_SET_GET_OBJECT
h2.oldResultSetGetObject
, true
by default.
Return Byte
and Short
instead of Integer
from
ResultSet#getObject(...)
for TINYINT
and SMALLINT
values.public static final boolean BIG_DECIMAL_IS_DECIMAL
h2.bigDecimalIsDecimal
, true
by default. If
true
map BigDecimal
to DECIMAL
type, if false
map it to NUMERIC
as specified in JDBC specification (see Mapping
from Java Object Types to JDBC Types).public static final boolean UNLIMITED_TIME_RANGE
h2.unlimitedTimeRange
, false
by default.
Controls limits of TIME data type.
h2.unlimitedTimeRange | Minimum TIME value | Maximum TIME value |
---|---|---|
false | 00:00:00.000000000 | 23:59:59.999999999 |
true | -2562047:47:16.854775808 | 2562047:47:16.854775807 |
public static final java.lang.String PG_DEFAULT_CLIENT_ENCODING
h2.pgClientEncoding
(default: UTF-8).public static final java.lang.String PREFIX_TEMP_FILE
h2.prefixTempFile
(default: h2.temp).public static final int SERVER_CACHED_OBJECTS
h2.serverCachedObjects
(default: 64).public static final int SERVER_RESULT_SET_FETCH_SIZE
h2.serverResultSetFetchSize
(default: 100).public static final int SOCKET_CONNECT_RETRY
h2.socketConnectRetry
(default: 16).public static final int SOCKET_CONNECT_TIMEOUT
h2.socketConnectTimeout
(default: 2000).public static final boolean SORT_BINARY_UNSIGNED
h2.sortBinaryUnsigned
(default: false with version 1.3, true with version 1.4).public static final boolean SORT_NULLS_HIGH
h2.sortNullsHigh
(default: false).public static final long SPLIT_FILE_SIZE_SHIFT
h2.splitFileSizeShift
(default: 30).public static final java.lang.String SYNC_METHOD
h2.syncMethod
(default: sync).public static final boolean TRACE_IO
h2.traceIO
(default: false).public static final boolean THREAD_DEADLOCK_DETECTOR
h2.threadDeadlockDetector
(default: false).public static final boolean IMPLICIT_RELATIVE_PATH
h2.implicitRelativePath
(default: true for version 1.3, false for version 1.4).public static final java.lang.String URL_MAP
h2.urlMap
(default: null).public static final boolean USE_THREAD_CONTEXT_CLASS_LOADER
h2.useThreadContextClassLoader
(default: false).public static boolean serializeJavaObject
h2.serializeJavaObject
(default: true).public static final java.lang.String JAVA_OBJECT_SERIALIZER
h2.javaObjectSerializer
(default: null).public static final java.lang.String CUSTOM_DATA_TYPES_HANDLER
h2.customDataTypesHandler
(default: null).public static void setBaseDir(java.lang.String dir)
public static java.lang.String getBaseDir()
public static java.lang.String getScriptDirectory()
h2.scriptDirectory
(default: empty
string).