提交 df90fb37 authored 作者: Thomas Mueller's avatar Thomas Mueller

Improve documentation

上级 301ae834
......@@ -55,7 +55,6 @@ Newer version or compatible software works too.
</li><li>OpenOffice 3.0
</li><li>NSIS 2.38 (Nullsoft Scriptable Install System)
</li><li>Maven 2.0.9
</li><li>YourKit Java Profiler
</li></ul>
<br /><a name="building"></a>
......@@ -79,8 +78,8 @@ build jar
<h3>Switching the Source Code</h3>
<p>
By default the source code uses Java 1.6 features, however Java 1.4 and 1.5 are supported as well.
To disable Java 1.6 specific features, run:
By default the source code uses Java 1.5 features, however Java 1.4 and 1.5 are supported as well.
To switch the source code to the install version of Java, run:
</p>
<pre>
build switchSource
......@@ -91,7 +90,7 @@ build switchSource
<p>
The build system can generate smaller jar files as well. The following targets are currently supported:
</p>
<ul><li>jarClient: Create the h2client.jar. This only contains the remote JDBC implementation.
<ul><li>jarClient: Create the h2client.jar. This only contains the JDBC client.
</li><li>jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li><li>javadocImpl: Create the Javadocs of the implementation.
......@@ -152,7 +151,7 @@ The translation of this software is split into the following parts:
</li><li>Web site: src/docsrc/text/_docs_*.utf8.txt
</li></ul>
<p>
To translate the H2 Console, start it and select Options / Translate.
To translate the H2 Console, start it and select Preferences / Translate.
The conversion between UTF-8 and Java encoding (using the \u syntax), as well as the HTML entities (&amp;#..;)
is automated by running the tool PropertiesToUTF8. The web site translation is automated as well,
using <code>build docs</code>.
......@@ -164,7 +163,8 @@ using <code>build docs</code>.
If you like to provide patches, please consider the following guidelines to simplify merging them:
</p>
<ul><li>Only use Java 1.4 features (do not use Java 1.5 or 1.6) (see Environment).
</li><li>Follow the coding style used in the project, use Checkstyle (see above) to check the coding style.
</li><li>Follow the coding style used in the project, and use Checkstyle (see above) to verify.
For example, do not use tabs (use spaces instead).
The checkstyle configuration is in <code>src/installer/checkstyle.xml</code>.
</li><li>Please provide test cases and integrate them into the test suite.
For Java level tests, see <code>src/test/org/h2/test/TestAll.java</code>.
......@@ -177,7 +177,7 @@ If you like to provide patches, please consider the following guidelines to simp
</li><li>Verify the spelling using <code>build spellcheck</code>. If required
add the new words to <code>src/tools/org/h2/build/doc/dictionary.txt</code>.
</li><li>Verify the formatting using <code>build docs</code> and <code>build javadoc</code>.
</li><li>Submit patches as .patch files (compressed if big). To create a patch, use for example Eclipse Team/Create Patch.
</li><li>Submit patches as .patch files (compressed if big). To create a patch using Eclipse, use Team / Create Patch.
</li></ul>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
......
......@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Queries that are ordered by an indexed column returned no rows in certain cases
<ul><li>In-memory databases can now run inside the Google App Engine.
</li><li>Queries that are ordered by an indexed column returned no rows in certain cases
(if all rows were deleted from the table previously, and there is a low number of rows
in the table, and when not using other conditions, and when using the default b tree index).
</li><li>The wrong exception was thrown when using unquoted text for
......
......@@ -105,12 +105,12 @@ Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
<h3>Where are the Database Files Stored?</h3>
<p>
When using database URLs like jdbc:h2:~/test, the database is stored in the user directory.
For Windows, this is usually C:\Documents and Settings\&lt;userName&gt;.
For Windows, this is usually "C:\Documents and Settings\&lt;userName&gt;".
If the base directory is not set (as in jdbc:h2:test), the database files are stored in the directory where the application is started
(the current working directory). When using the H2 Console application from the start menu, this is [Installation Directory]/bin.
(the current working directory). When using the H2 Console application from the start menu, this is "&lt;Installation Directory&gt;/bin".
The base directory can be set in the database URL. A fixed or relative path can be used. When using the URL
jdbc:h2:file:data/sample, the database is stored in the directory data (relative to the current working directory).
The directory is created automatically if it does not yet exist. It is also possible to use the fully qualified directory (and for Windows, drive) name.
jdbc:h2:file:data/sample, the database is stored in the directory "data" (relative to the current working directory).
The directory is created automatically if it does not yet exist. It is also possible to use the fully qualified directory name (and for Windows, drive name).
Example: jdbc:h2:file:C:/data/test
</p>
......@@ -118,14 +118,15 @@ Example: jdbc:h2:file:C:/data/test
<h3>What is the Size Limit (Maximum Size) of a Database?</h3>
<p>
The theoretical limit is currently 256 GB for the data. This number is excluding BLOB and CLOB data:
Every CLOB or BLOB can be up to 256 GB as well. The size limit of the index data is 256 GB as well.
every CLOB or BLOB can be up to 256 GB as well. The size limit of the index data is 256 GB as well.
</p>
<p>
The maximum number of rows per table is 2'147'483'648.
</p>
<p>
The maximum file size for FAT or FAT32 file systems is 4 GB. So if you use FAT or FAT32, the
limit is 4 GB for the data.
The maximum file size for FAT or FAT32 file systems is usually 4 GB.
The database does provide a workaround for this problem, it is to use the file
name prefix 'split:'. See also Advanced / Limitations.
</p>
<p>
The larger the database, the more main memory is required. Currently the minimum main memory required for a 12 GB database
......@@ -137,33 +138,32 @@ is around 240 MB.
<p>
That is not easy to say. It is still a quite new product. A lot of tests have been written,
and the code coverage of these tests is very high. Randomized stress tests
are run regularly. But as this is a relatively new product, there are probably
some problems that have not yet been found (as with most software). Some features are known
to be dangerous by design, and some problems are hard to solve. Those are:
are run regularly. But there are probably still
bug that have not yet been found (as with most software). Some features are known
to be dangerous, they are only supported for situations where performance is more important
than reliability. Those dangerous features are:
</p>
<ul>
<li>Using SET LOG 0 to disable the transaction log file.
<li>Disabling the transaction log mechanism using SET LOG 0.
</li><li>Using the transaction isolation level READ_UNCOMMITTED (LOCK_MODE 0) while at the same time using multiple
connections may result in inconsistent transactions.
</li><li>Using FILE_LOCK=NO in the database URL.
connections.
</li><li>Disabling database file protection using FILE_LOCK=NO in the database URL.
</li><li>Disabling referential integrity using SET REFERENTIAL_INTEGRITY FALSE.
</li></ul>
<p>
In addition to that, running out of memory should be avoided.
In some versions, OutOfMemory errors while using the database could corrupt a databases.
Not all such problems may be fixed.
In older versions, OutOfMemory errors while using the database could corrupt a databases.
</p>
<p>
Areas that are not fully tested:
</p>
<ul>
<li>Platforms other than Windows XP or Linux, or JVMs other than Sun 1.4 - 1.6
<li>Platforms other than Windows XP, Linux, Mac OS X, or JVMs other than Sun 1.4 - 1.6
</li><li>The features AUTO_SERVER and AUTO_RECONNECT
</li><li>The MVCC (multi version concurrency) mode
</li><li>Cluster mode, 2-phase commit, savepoints
</li><li>24/7 operation
</li><li>Some operations on databases larger than 500 MB may be slower than expected
</li><li>Multi-threading and using multiple connections
</li><li>The optimizer may not always select the best plan
</li></ul>
......@@ -173,7 +173,6 @@ Areas considered Experimental:
<ul>
<li>The PostgreSQL server
</li><li>Compatibility modes for other databases (only some features are implemented)
</li><li>The ARRAY data type and related functionality
</li></ul>
<br /><a name="slow_open"></a>
......@@ -184,6 +183,8 @@ This is specially a problem for larger databases.
To close a database, close all connections to it before the application ends, or execute
the command SHUTDOWN. The database is also closed when the virtual machine exits normally
by using a shutdown hook. However killing a Java process or calling Runtime.halt will prevent this.
The reason why opening is slow in this situations is that indexes are re-created.
If you can not guarantee the database is closed, consider using SET LOG 2 (see SQL Grammar).
</p>
<p>
To find out what the problem is, open the database in embedded mode using the H2 Console.
......
......@@ -9,9 +9,7 @@ Initial Developer: H2 Group
<title>Fragments</title>
<!-- [search] { -->
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="navigation.js"></script>
<script type="text/javascript" src="search.js"></script>
</head><body onload="highlight();">
<table class="nav" onmousemove="return mouseMove(event)"><tr class="nav"><td class="nav" valign="top">
......@@ -88,6 +86,8 @@ Initial Developer: H2 Group
<!-- [close] { -->
</div></td></tr></table>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="search.js"></script>
<!-- } -->
</body></html>
\ No newline at end of file
......@@ -719,8 +719,8 @@ For H2, opening a connection is fast if the database is already open.
Still, using a connection pool improves performance if you open and close connections a lot.
A simple connection pool is included in H2. It is based on the
<a href="http://www.source-code.biz/snippets/java/8.htm">Mini Connection Pool Manager</a>
from Christian d'Heureuse. There are other, more complex connection pools available, for example
<a href="http://jakarta.apache.org/commons/dbcp/">DBCP</a>.
from Christian d'Heureuse. There are other, more complex, open source connection pools available,
for example the <a href="http://jakarta.apache.org/commons/dbcp/">Apache Commons DBCP</a>.
For H2, it is about twice as faster to get a connection from the built-in connection pool than to get
one using DriverManager.getConnection(). The build-in connection pool is used as follows:
</p>
......@@ -744,10 +744,12 @@ public class Test {
<br /><a name="fulltext"></a>
<h2>Fulltext Search</h2>
<p>
H2 supports Lucene full text search and native full text search implementation.
H2 includes two fulltext search implementations. One is using Apache Lucene,
and the other (the native implementation) stores the index data in special
tables in the database.
</p>
<h3>Using the Native Full Text Search</h3>
<h3>Using the Native Fulltext Search</h3>
<p>
To initialize, call:
</p>
......@@ -757,7 +759,7 @@ CALL FT_INIT();
</pre>
<p>
You need to initialize it in each database where you want to use it.
Afterwards, you can create a full text index for a table using:
Afterwards, you can create a fulltext index for a table using:
</p>
<pre>
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR);
......@@ -766,7 +768,7 @@ CALL FT_CREATE_INDEX('PUBLIC', 'TEST', NULL);
</pre>
<p>
PUBLIC is the schema, TEST is the table name. The list of column names (column separated) is optional,
in this case all columns are indexed. The index is updated in read time.
in this case all columns are indexed. The index is updated in realtime.
To search the index, use the following query:
</p>
<pre>
......@@ -783,7 +785,7 @@ To get the raw data, use <code>FT_SEARCH_DATA('Hello', 0, 0);</code>.
The result contains the columns SCHEMA (the schema name),
TABLE (the table name), COLUMNS (an array of column names), and KEYS
(an array of objects). To join a table, use a join as in:
<code>SELECT T.*FROM FT_SEARCH_DATA('Hello', 0, 0) FT, TEST T
<code>SELECT T.* FROM FT_SEARCH_DATA('Hello', 0, 0) FT, TEST T
WHERE FT.TABLE='TEST' AND T.ID= FT.KEYS[0];</code>
</p>
<p>
......@@ -797,9 +799,9 @@ org.h2.fulltext.FullText.searchData(conn, text, limit, offset);
<h3>Using the Lucene Fulltext Search</h3>
<p>
To use the Lucene full text search, you need the Lucene library in the classpath.
How his is done depends on the application; if you use the H2 Console, you can add the Lucene
How to do that depends on the application; if you use the H2 Console, you can add the Lucene
jar file to the environment variables H2DRIVERS or CLASSPATH.
To initialize the Lucene full text search in a database, call:
To initialize the Lucene fulltext search in a database, call:
</p>
<pre>
CREATE ALIAS IF NOT EXISTS FTL_INIT FOR "org.h2.fulltext.FullTextLucene.init";
......@@ -816,7 +818,7 @@ CALL FTL_CREATE_INDEX('PUBLIC', 'TEST', NULL);
</pre>
<p>
PUBLIC is the schema, TEST is the table name. The list of column names (column separated) is optional,
in this case all columns are indexed. The index is updated in read time. To search the index,
in this case all columns are indexed. The index is updated in realtime. To search the index,
use the following query:
</p>
<pre>
......@@ -829,11 +831,11 @@ This will produce a result set that contains the query needed to retrieve the da
QUERY: "PUBLIC"."TEST" WHERE "ID"=1
</p>
<p>
To get the raw data, use <code>FT_SEARCH_DATA('Hello', 0, 0);</code>.
To get the raw data, use <code>FTL_SEARCH_DATA('Hello', 0, 0);</code>.
The result contains the columns SCHEMA (the schema name),
TABLE (the table name), COLUMNS (an array of column names), and KEYS
(an array of objects). To join a table, use a join as in:
<code>SELECT T.*FROM FT_SEARCH_DATA('Hello', 0, 0) FT, TEST T
<code>SELECT T.* FROM FTL_SEARCH_DATA('Hello', 0, 0) FT, TEST T
WHERE FT.TABLE='TEST' AND T.ID= FT.KEYS[0];</code>
</p>
<p>
......@@ -848,14 +850,14 @@ org.h2.fulltext.FullTextLucene.searchData(conn, text, limit, offset);
<h2>User-Defined Variables</h2>
<p>
This database supports user-defined variables. Variables start with @ and can be used wherever
expressions or parameters are used. Variables not persisted and session scoped, that means only visible for
the session where they are defined. A value is usually assigned using the SET command:
expressions or parameters are allowed. Variables are not persisted and session scoped, that means only visible
from within the session in which they are defined. A value is usually assigned using the SET command:
</p>
<pre>
SET @USER = 'Joe';
</pre>
<p>
It is also possible to change a value using the SET() method. This is useful in queries:
The value can also be changed using the SET() method. This is useful in queries:
</p>
<pre>
SET @TOTAL = NULL;
......@@ -887,7 +889,7 @@ the database using the RUNSCRIPT command or the RunScript tool in the new time z
<br /><a name="spring"></a>
<h2>Using Spring</h2>
<p>
Use the following configuration to start and stop the H2 TCP Server using the Spring Framework:
Use the following configuration to start and stop the H2 TCP server using the Spring Framework:
</p>
<pre>
&lt;bean id="org.h2.tools.Server"
......@@ -899,7 +901,7 @@ Use the following configuration to start and stop the H2 TCP Server using the Sp
&lt;/bean&gt;
</pre>
<p>
The "destroy-method" will help prevent exceptions on hot-redeployment or when restarting server.
The "destroy-method" will help prevent exceptions on hot-redeployment or when restarting the server.
</p>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -204,12 +204,13 @@ public class Engine {
* method waits some time (to make brute force / rainbow table attacks
* harder) and then throws a 'wrong user or password' exception. The delay
* is a bit randomized to protect against timing attacks. Also the delay
* doubles after each unsuccessful logins, to make brute force attacks harder.
* doubles after each unsuccessful logins, to make brute force attacks
* harder.
*
* There is only one exception both for wrong user and for wrong password,
* to make it harder to get the list of user names. This method must only be
* called from one place, so it is not possible from the stack trace to see
* if the user name was wrong or the password.
* There is only one exception message both for wrong user and for
* wrong password, to make it harder to get the list of user names. This
* method must only be called from one place, so it is not possible from the
* stack trace to see if the user name was wrong or the password.
*
* @param correct if the user name or the password was correct
* @throws SQLException the exception 'wrong user or password'
......
......@@ -282,11 +282,13 @@ java org.h2.test.TestAll timer
/*
automated tests (status on web site)
test web site with firefox 3, internet explorer, opera, safari, google chrome
test loading time of page
documentation: rolling review at tutorial.html:701
automated tests (status on web site)
EclEmma
test web site with firefox 3, internet explorer, opera, safari, google chrome
documentation: rolling review at features.html: 612
create a short 4 pages documentation
......
......@@ -585,4 +585,4 @@ versus extracts squirrel misdirected rle looking arc addressed european
soerensen favicon glass restarts flexive fish resulted vpda mvc kotek jan
consistently springfuse grep signatures wrote symbolic parents caches readers
animate scaladoc models disadvantages vladykin sergi trims requesting
handing bonita placed euros
\ No newline at end of file
handing bonita placed euros embeds reliability singular
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论