001: /*
002: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
003: * (http://h2database.com/html/license.html).
004: * Initial Developer: H2 Group
005: */
006: package org.h2.engine;
007:
008: /*
009: * Release checklist
010: * - Test with Hibernate
011: * - Run FindBugs
012: * - ant jarClient, check jar file size
013: * - ant jar, test with IKVM
014: * - Compile with JDK 1.4, 1.5 and 1.6:
015: * set path=C:\Programme\Java\jdk1.6.0\bin;%PATH%
016: * set JAVA_HOME=C:\Programme\Java\jdk1.6.0
017: * set path=C:\Program Files\Java\jdk1.6.0_03\bin;%PATH%
018: * set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_03
019: * ant compile
020: * set classpath=
021: * ant javadoc
022: * ant javadocImpl (to find missing javadocs)
023: * ant codeswitchJdk14
024: * ant javadocImpl
025: *
026: * - Change version and build number in
027: * Constants.java
028: * ant-build.properties
029: * build.html
030: * mainWeb.html
031: * download.html
032: * - Maybe increase TCP_DRIVER_VERSION (old clients must be compatible!)
033: * - Check code coverage
034: * - No " Message.get" (must be "throw Message.get")
035: * - No TODO in the docs, remove @~ in .utf8.txt files
036: * - Run regression test with JDK 1.4 and 1.5
037: *
038: * - Change version(s) in performance.html; use latest versions of other dbs
039: * - Run 'ant benchmark' (with JDK 1.4 currently)
040: * - Copy the benchmark results and update the performance page and diagram
041: *
042: * - Documentation: if there are new files, add them to MergeDocs
043: * - Documentation: check if all Javadoc files are in the index
044: * - Update newsfeed and create files
045: * - ant docs
046: * - PDF
047: * - footer
048: * - front page
049: * - orphan control
050: * - check images
051: * - table of contents
052: * - Switch off auto-build
053: * - ant all
054: * - Make sure FullTextLucene is included in h2.jar
055: * - Copy the pdf file to h2/docs
056: * - Make sure the build files are removed
057: * - ant zip
058: * - Windows installer (nsis)
059: * - Test Console
060: * - Test all languages
061: * - Test the windows service
062: * - Scan for viruses
063: * - ant mavenDeployCentral
064: * - Upload to SourceForge
065: * - svn copy: /svn/trunk /svn/tags/version-1.0.x; Version 1.0.x (yyyy-mm-dd)
066: * - Newsletter: prepare, send (always send to BCC!!)
067: * - Add to freshmeat
068: * - Upload to http://code.google.com/p/h2database/downloads/list
069: * - http://en.wikipedia.org/wiki/H2_%28DBMS%29 (change version)
070: */
071: /**
072: * Constants are fixed values that are used in the whole database code.
073: */
074: public class Constants {
075:
076: public static final int BUILD_ID = 68;
077: private static final String BUILD = "2008-03-15";
078:
079: public static final int VERSION_MAJOR = 1;
080: public static final int VERSION_MINOR = 0;
081:
082: public static final int FILE_BLOCK_SIZE = 16;
083: public static final String MAGIC_FILE_HEADER_TEXT = "-- H2 0.5/T -- "
084: .substring(0, FILE_BLOCK_SIZE - 1)
085: + "\n";
086: public static final String MAGIC_FILE_HEADER = "-- H2 0.5/B -- "
087: .substring(0, FILE_BLOCK_SIZE - 1)
088: + "\n";
089: public static final int TCP_DRIVER_VERSION = 5;
090: public static final int VERSION_JDBC_MAJOR = 3;
091: public static final int VERSION_JDBC_MINOR = 0;
092:
093: public static String getVersion() {
094: return VERSION_MAJOR + "." + VERSION_MINOR + "." + BUILD_ID
095: + " (" + BUILD + ")";
096: }
097:
098: public static final int DEFAULT_SERVER_PORT = 9092; // this is also in the docs
099: public static final String START_URL = "jdbc:h2:";
100: public static final String URL_FORMAT = START_URL
101: + "{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]";
102:
103: // must stay like that, see
104: // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2682
105: public static final String PRODUCT_NAME = "H2";
106: public static final String DRIVER_NAME = "H2 JDBC Driver";
107: public static final int IO_BUFFER_SIZE = 4 * 1024;
108: public static final int IO_BUFFER_SIZE_COMPRESS = 128 * 1024;
109: public static final int DEFAULT_CACHE_SIZE_LINEAR_INDEX = 64 * 1024;
110: public static final int FILE_PAGE_SIZE = 8 * 1024;
111: public static final int FILE_MIN_SIZE = 128 * 1024;
112: public static final int FILE_MAX_INCREMENT = 32 * 1024 * 1024;
113: public static final String SUFFIX_DB_FILE = ".db";
114: public static final String SUFFIX_DATA_FILE = ".data.db";
115: public static final String SUFFIX_LOG_FILE = ".log.db";
116: public static final String SUFFIX_INDEX_FILE = ".index.db";
117: public static final String SUFFIX_HASH_FILE = ".hash.db";
118: public static final String SUFFIX_LOCK_FILE = ".lock.db";
119: public static final String SUFFIX_TEMP_FILE = ".temp.db";
120: public static final String SUFFIX_TRACE_FILE = ".trace.db";
121: public static final String SUFFIX_LOB_FILE = ".lob.db";
122: public static final String SUFFIX_TRACE_START_FILE = ".start";
123: public static final String SUFFIX_LOBS_DIRECTORY = ".lobs.db";
124: public static final String UTF8 = "UTF8";
125: public static final int DEFAULT_TABLE_TYPE = 0;
126: public static final int DEFAULT_MAX_LENGTH_INPLACE_LOB = 1024;
127: public static final int DEFAULT_MAX_LENGTH_CLIENTSIDE_LOB = 65536;
128: public static final int SALT_LEN = 8;
129: public static final int DEFAULT_DATA_PAGE_SIZE = 512;
130: public static final String PREFIX_PRIMARY_KEY = "PRIMARY_KEY_";
131: public static final String PREFIX_INDEX = "INDEX_";
132: public static final int LOCK_SLEEP = 1000;
133:
134: // TODO for testing, the lock timeout is smaller than for interactive use cases
135: // public static final int INITIAL_LOCK_TIMEOUT = 60 * 1000;
136: public static final int INITIAL_LOCK_TIMEOUT = 1000;
137: public static final char DEFAULT_ESCAPE_CHAR = '\\';
138: public static final int DEFAULT_HTTP_PORT = 8082; // also in the docs
139: public static final boolean DEFAULT_HTTP_SSL = false;
140: public static final boolean DEFAULT_HTTP_ALLOW_OTHERS = false;
141: public static final int DEFAULT_FTP_PORT = 8021;
142: public static final int DEFAULT_MAX_MEMORY_ROWS = 10000;
143: public static final int DEFAULT_WRITE_DELAY = 500;
144: public static final String SERVER_PROPERTIES_TITLE = "H2 Server Properties";
145: public static final String SERVER_PROPERTIES_FILE = ".h2.server.properties";
146: public static final long LONG_QUERY_LIMIT_MS = 100;
147: public static final String PUBLIC_ROLE_NAME = "PUBLIC";
148: public static final String TEMP_TABLE_PREFIX = "TEMP_TABLE_";
149: public static final int BIG_DECIMAL_SCALE_MAX = 100000;
150: public static final String SCHEMA_MAIN = "PUBLIC";
151: public static final String SCHEMA_INFORMATION = "INFORMATION_SCHEMA";
152: public static final String DBA_NAME = "DBA";
153: public static final String CHARACTER_SET_NAME = "Unicode";
154: public static final String CLUSTERING_DISABLED = "''";
155: public static final int LOCK_MODE_OFF = 0;
156: public static final int LOCK_MODE_TABLE = 1;
157: public static final int LOCK_MODE_TABLE_GC = 2;
158: public static final int LOCK_MODE_READ_COMMITTED = 3;
159: public static final int SELECTIVITY_DISTINCT_COUNT = 10000;
160: public static final int SELECTIVITY_DEFAULT = 50;
161: public static final int SELECTIVITY_ANALYZE_SAMPLE_ROWS = 10000;
162: public static final boolean CONVERT_TO_LONG_ROUND = true;
163:
164: // the cost is calculated on rowcount + this offset,
165: // to avoid using the wrong or no index if the table
166: // contains no rows _currently_ (when preparing the statement)
167: public static final int COST_ROW_OFFSET = 1000;
168: public static final long FLUSH_INDEX_DELAY = 0;
169: public static final int THROTTLE_DELAY = 50;
170: public static final String MANAGEMENT_DB_PREFIX = "management_db_";
171: public static final String MANAGEMENT_DB_USER = "sa";
172: public static final boolean SERIALIZE_JAVA_OBJECTS = true;
173: public static final long DEFAULT_MAX_LOG_SIZE = 32 * 1024 * 1024;
174: public static final long LOG_SIZE_DIVIDER = 10;
175: public static final int ALLOW_LITERALS_NONE = 0;
176: public static final int ALLOW_LITERALS_NUMBERS = 1;
177: public static final int ALLOW_LITERALS_ALL = 2;
178: public static final int DEFAULT_ALLOW_LITERALS = ALLOW_LITERALS_ALL;
179: public static final boolean AUTO_CONVERT_LOB_TO_FILES = true;
180: public static final boolean ALLOW_EMPTY_BTREE_PAGES = true;
181: public static final String CONN_URL_INTERNAL = "jdbc:default:connection";
182: public static final String CONN_URL_COLUMNLIST = "jdbc:columnlist:connection";
183: public static final int VIEW_INDEX_CACHE_SIZE = 64;
184: public static final int VIEW_COST_CACHE_MAX_AGE = 10000; // 10 seconds
185: public static final int MAX_PARAMETER_INDEX = 100000;
186:
187: /**
188: * The password is hashed this many times
189: * to slow down dictionary attacks.
190: */
191: public static final int ENCRYPTION_KEY_HASH_ITERATIONS = 1024;
192: public static final String SCRIPT_SQL = "script.sql";
193: public static final int CACHE_MIN_RECORDS = 16;
194:
195: /**
196: * The delay in milliseconds before an exception about
197: * a wrong user or password is thrown.
198: * This slows down dictionary attacks.
199: * An attacker can still open multiple connections.
200: */
201: public static final long DELAY_WRONG_PASSWORD = 200;
202: }
|