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

Documentation: add 'notranslate' tags

上级 78fbd315
......@@ -137,8 +137,8 @@ CREATE LINKED TABLE LINK('org.postgresql.Driver', 'jdbc:postgresql:test', 'sa',
<p>
You can then access the table in the usual way.
Whenever the linked table is accessed, the database issues specific queries over JDBC.
Using the example above, if you issue the query <code>SELECT * FROM LINK WHERE ID=1</code>,
then the following query is run against the PostgreSQL database: <code>SELECT * FROM TEST WHERE ID=?</code>.
Using the example above, if you issue the query <code class="notranslate">SELECT * FROM LINK WHERE ID=1</code>,
then the following query is run against the PostgreSQL database: <code class="notranslate">SELECT * FROM TEST WHERE ID=?</code>.
The same happens for insert and update statements. Only simple statements are executed against the
target database, that means no joins. Prepared statements are used where possible.
</p>
......@@ -169,16 +169,16 @@ This database supports the following transaction isolation levels:
This is the default level.
Read locks are released immediately.
Higher concurrency is possible when using this level.<br />
To enable, execute the SQL statement 'SET LOCK_MODE 3'<br />
or append ;LOCK_MODE=3 to the database URL: jdbc:h2:~/test;LOCK_MODE=3
To enable, execute the SQL statement <code class="notranslate">SET LOCK_MODE 3</code><br />
or append <code class="notranslate">;LOCK_MODE=3</code> to the database URL: <code class="notranslate">jdbc:h2:~/test;LOCK_MODE=3</code>
</li><li>
<b>Serializable</b><br />
To enable, execute the SQL statement 'SET LOCK_MODE 1'<br />
or append ;LOCK_MODE=1 to the database URL: jdbc:h2:~/test;LOCK_MODE=1
To enable, execute the SQL statement <code class="notranslate">SET LOCK_MODE 1</code><br />
or append <code class="notranslate">;LOCK_MODE=1</code> to the database URL: <code class="notranslate">jdbc:h2:~/test;LOCK_MODE=1</code>
</li><li><b>Read Uncommitted</b><br />
This level means that transaction isolation is disabled.<br />
To enable, execute the SQL statement 'SET LOCK_MODE 0'<br />
or append ;LOCK_MODE=0 to the database URL: jdbc:h2:~/test;LOCK_MODE=0
To enable, execute the SQL statement <code class="notranslate">SET LOCK_MODE 0</code><br />
or append <code class="notranslate">;LOCK_MODE=0</code> to the database URL: <code class="notranslate">jdbc:h2:~/test;LOCK_MODE=0</code>
</li>
</ul>
<p>
......@@ -304,7 +304,7 @@ java org.h2.tools.Server
</li><li>Use the CreateCluster tool to initialize clustering.
This will automatically create a new, empty database if it does not exist.
Run the tool on the command line:
<pre>
<pre class="notranslate">
java org.h2.tools.CreateCluster
-urlSource jdbc:h2:tcp://localhost:9101/~/test
-urlTarget jdbc:h2:tcp://localhost:9102/~/test
......@@ -342,15 +342,15 @@ The two phase commit protocol is supported. 2-phase-commit works as follows:
<li>Autocommit needs to be switched off
</li><li>A transaction is started, for example by inserting a row
</li><li>The transaction is marked 'prepared' by executing the SQL statement
<code>PREPARE COMMIT transactionName</code>
<code class="notranslate">PREPARE COMMIT transactionName</code>
</li><li>The transaction can now be committed or rolled back
</li><li>If a problem occurs before the transaction was successfully committed or rolled back
(for example because a network problem occurred), the transaction is in the state 'in-doubt'
</li><li>When re-connecting to the database, the in-doubt transactions can be listed
with <code>SELECT * FROM INFORMATION_SCHEMA.IN_DOUBT</code>
with <code class="notranslate">SELECT * FROM INFORMATION_SCHEMA.IN_DOUBT</code>
</li><li>Each transaction in this list must now be committed or rolled back by executing
<code>COMMIT TRANSACTION transactionName</code> or
<code>ROLLBACK TRANSACTION transactionName</code>
<code class="notranslate">COMMIT TRANSACTION transactionName</code> or
<code class="notranslate">ROLLBACK TRANSACTION transactionName</code>
</li><li>The database needs to be closed and re-opened to apply the changes
</li></ul>
......@@ -445,7 +445,7 @@ as experimental. It should not be used for production applications.
</p>
<p>
To use the PostgreSQL ODBC driver on 64 bit versions of Windows,
first run <code>c:/windows/syswow64/odbcad32.exe</code>.
first run <code class="notranslate">c:/windows/syswow64/odbcad32.exe</code>.
At this point you set up your DSN just like you would on any other system.
See also:
<a href="http://archives.postgresql.org/pgsql-odbc/2005-09/msg00125.php">Re: ODBC Driver on Windows 64 bit</a>
......@@ -485,13 +485,13 @@ server.stop();
</pre>
<p>
By default, only connections from localhost are allowed. To allow remote connections, use
<code>-pgAllowOthers</code> when starting the server.
<code class="notranslate">-pgAllowOthers</code> when starting the server.
</p>
<h3>ODBC Configuration</h3>
<p>
After installing the driver, a new Data Source must be added. In Windows,
run <code>odbcad32.exe</code> to open the Data Source Administrator. Then click on 'Add...'
run <code class="notranslate">odbcad32.exe</code> to open the Data Source Administrator. Then click on 'Add...'
and select the PostgreSQL Unicode driver. Then click 'Finish'.
You will be able to change the connection properties:
</p>
......@@ -560,12 +560,12 @@ An implementation of the ADO.NET interface is available in the open source proje
</li><li>Install <a href="http://www.ikvm.net">IKVM.NET</a>.
</li><li>Copy the h2*.jar file to ikvm/bin
</li><li>Run the H2 Console using:
<code>ikvm -jar h2*.jar</code>
<code class="notranslate">ikvm -jar h2*.jar</code>
</li><li>Convert the H2 Console to an .exe file using:
<code>ikvmc -target:winexe h2*.jar</code>.
<code class="notranslate">ikvmc -target:winexe h2*.jar</code>.
You may ignore the warnings.
</li><li>Create a .dll file using (change the version accordingly):
<code>ikvmc.exe -target:library -version:1.0.69.0 h2*.jar</code>
<code class="notranslate">ikvmc.exe -target:library -version:1.0.69.0 h2*.jar</code>
</li></ul>
<p>
If you want your C# application use H2, you need to add the h2.dll and the
......@@ -726,7 +726,7 @@ java -cp h2*.jar org.h2.tools.Recover
For each database in the current directory, a text file will be created.
This file contains raw insert statements (for the data) and data definition (DDL) statements to recreate
the schema of the database. This file can be executed using the RunScript tool or a
<code>RUNSCRIPT FROM</code> SQL statement. The script includes at least one
<code class="notranslate">RUNSCRIPT FROM</code> SQL statement. The script includes at least one
CREATE USER statement. If you run the script against a database that was created with the same
user, or if there are conflicting users, running the script will fail. Consider running the script
against a database that was created with a user name that is not in the script.
......@@ -796,7 +796,7 @@ to the user if it cannot open a database, and not try again in a (fast) loop.
<h3>File Locking Method 'Socket'</h3>
<p>
There is a second locking mechanism implemented, but disabled by default.
To use it, append <code>;FILE_LOCK=SOCKET</code> to the database URL.
To use it, append <code class="notranslate">;FILE_LOCK=SOCKET</code> to the database URL.
The algorithm is:
</p>
<ul>
......@@ -1055,17 +1055,17 @@ custom certificates are supported as well.
<p>
Remote SSL/TLS connections are supported using the Java Secure Socket Extension
(SSLServerSocket / SSLSocket). By default, anonymous SSL is enabled.
The default cipher suite is <code>SSL_DH_anon_WITH_RC4_128_MD5</code>.
The default cipher suite is <code class="notranslate">SSL_DH_anon_WITH_RC4_128_MD5</code>.
</p>
<p>
To use your own keystore, set the system properties <code>javax.net.ssl.keyStore</code> and
<code>javax.net.ssl.keyStorePassword</code> before starting the H2 server and client.
To use your own keystore, set the system properties <code class="notranslate">javax.net.ssl.keyStore</code> and
<code class="notranslate">javax.net.ssl.keyStorePassword</code> before starting the H2 server and client.
See also <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores">
Customizing the Default Key and Trust Stores, Store Types, and Store Passwords</a>
for more information.
</p>
<p>
To disable anonymous SSL, set the system property <code>h2.enableAnonymousSSL</code> to false.
To disable anonymous SSL, set the system property <code class="notranslate">h2.enableAnonymousSSL</code> to false.
</p>
<br />
......@@ -1154,7 +1154,7 @@ is selected using a file name prefix. The following file systems are included:
</li></ul>
<p>
As an example, to use the the <b>nio</b> file system, use the following database URL:
<code>jdbc:h2:nio:~/test</code>.
<code class="notranslate">jdbc:h2:nio:~/test</code>.
</p>
<p>
To register a new file system, extend the classes org.h2.store.fs.FileSystem and FileObject,
......@@ -1175,7 +1175,7 @@ This database has the following known limitations:
the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a
workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into
files of 1 GB by default. An example database URL is:
<code>jdbc:h2:split:~/test</code>.
<code class="notranslate">jdbc:h2:split:~/test</code>.
</li><li>The maximum number of rows per table is 2'147'483'648.
</li><li>Main memory requirements: The larger the database, the more main memory is required.
With the default storage mechanism, the minimum main memory required for a 12 GB database is around 240 MB.
......
......@@ -71,16 +71,16 @@ Ensure that Java binary directory is included in the PATH environment variable,
the environment variable JAVA_HOME points to your Java installation.
On the command line, go to the directory h2 and execute the following command:
</p>
<pre>
<pre class="notranslate">
build -?
</pre>
<p>
For Linux and OS X, use <code>./build.sh</code> instead of <code>build</code>.
For Linux and OS X, use <code class="notranslate">./build.sh</code> instead of <code class="notranslate">build</code>.
</p>
<p>
You will get a list of targets. If you want to build the jar file, execute (Windows):
</p>
<pre>
<pre class="notranslate">
build jar
</pre>
......@@ -89,7 +89,7 @@ build jar
By default the source code uses Java 1.5 features, however Java 1.6 is supported as well.
To switch the source code to the install version of Java, run:
</p>
<pre>
<pre class="notranslate">
build switchSource
</pre>
......@@ -106,7 +106,7 @@ The build system can generate smaller jar files as well. The following targets a
<p>
To create the h2client.jar file, go to the directory h2 and execute the following command:
</p>
<pre>
<pre class="notranslate">
build jarClient
</pre>
......@@ -117,7 +117,7 @@ build jarClient
You can include the database in your Maven 2 project as a dependency.
Example:
</p>
<pre>
<pre class="notranslate">
&lt;dependency&gt;
&lt;groupId&gt;com.h2database&lt;/groupId&gt;
&lt;artifactId&gt;h2&lt;/artifactId&gt;
......@@ -134,13 +134,13 @@ they are available there.
<p>
To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command:
</p>
<pre>
<pre class="notranslate">
build mavenInstallLocal
</pre>
<p>
Afterwards, you can include the database in your Maven 2 project as a dependency:
</p>
<pre>
<pre class="notranslate">
&lt;dependency&gt;
&lt;groupId&gt;com.h2database&lt;/groupId&gt;
&lt;artifactId&gt;h2&lt;/artifactId&gt;
......@@ -162,7 +162,7 @@ The translation of this software is split into the following parts:
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>.
using <code class="notranslate">build docs</code>.
</p>
<br />
......@@ -173,20 +173,20 @@ If you like to provide patches, please consider the following guidelines to simp
<ul><li>Only use Java 1.5 features (do not use Java 1.6) (see Environment).
</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>.
The checkstyle configuration is in <code class="notranslate">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>.
For SQL level tests, see <code>src/test/org/h2/test/test.in.txt</code> or <code>testSimple.in.txt</code>.
For Java level tests, see <code class="notranslate">src/test/org/h2/test/TestAll.java</code>.
For SQL level tests, see <code class="notranslate">src/test/org/h2/test/test.in.txt</code> or <code class="notranslate">testSimple.in.txt</code>.
</li><li>The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above).
or use the build target 'coverage'.
</li><li>Verify that you did not break other features: run the test cases by executing <code>build test</code>.
</li><li>Provide end user documentation if required (<code>src/docsrc/html/*</code>).
</li><li>Document grammar changes in <code>src/main/org/h2/res/help.csv</code>
</li><li>Provide a change log entry (<code>src/docsrc/html/changelog.html</code>).
</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 that you did not break other features: run the test cases by executing <code class="notranslate">build test</code>.
</li><li>Provide end user documentation if required (<code class="notranslate">src/docsrc/html/*</code>).
</li><li>Document grammar changes in <code class="notranslate">src/main/org/h2/res/help.csv</code>
</li><li>Provide a change log entry (<code class="notranslate">src/docsrc/html/changelog.html</code>).
</li><li>Verify the spelling using <code class="notranslate">build spellcheck</code>. If required
add the new words to <code class="notranslate">src/tools/org/h2/build/doc/dictionary.txt</code>.
</li><li>Run the src/installer/buildRelease to find and fix formatting errors.
</li><li>Verify the formatting using <code>build docs</code> and <code>build javadoc</code>.
</li><li>Verify the formatting using <code class="notranslate">build docs</code> and <code class="notranslate">build javadoc</code>.
</li><li>Submit patches as .patch files (compressed if big). To create a patch using Eclipse, use Team / Create Patch.
</li></ul>
<p>
......@@ -195,18 +195,18 @@ For legal reasons, patches need to be public in the form of an email to the
of an <a href="http://code.google.com/p/h2database/issues/list">issue report or attachment</a>.
Significant contributions need to include the following statement:
</p>
<pre>
<p>
"I wrote the code, it's mine, and I'm contributing it to H2 for distribution
multiple-licensed under the H2 License, version 1.0, and under the
Eclipse Public License, version 1.0 (http://h2database.com/html/license.html)."
</pre>
</p>
<br />
<h2 id="automated">Automated Build</h2>
<p>
This build process is automated and runs regularly.
The build process includes running the tests and code coverage, using the command line
<code>./build.sh clean jar coverage -Dh2.ftpPassword=... uploadBuild</code>.
<code class="notranslate">./build.sh clean jar coverage -Dh2.ftpPassword=... uploadBuild</code>.
The last results are available here:
</p>
<ul><li><a href="http://h2database.com/html/testOutput.html">Test Output</a>
......
......@@ -16,22 +16,21 @@ Data Types
<!-- } -->
<h1>Data Types</h1>
<p class="notranslate">
<c:forEach var="item" items="dataTypes">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<c:forEach var="item" items="dataTypes">
<br />
<h3 id="${item.link}">${item.topic}</h3>
<pre>
<h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<pre class="notranslate">
${item.syntax}
</pre>
<p>
${item.text}
</p>
<b>Example:</b><br />
${item.example}
<br />
<p>${item.text}</p>
<b>Example:</b>
<p class="notranslate">${item.example}</p>
</c:forEach>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
......
......@@ -52,7 +52,7 @@ Here is the list of known and confirmed issues:
run into this issue. In Tomcat >= 6.0 this behavior can be disabled by setting the
system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES
to false, however Tomcat may then run out of memory. A known workaround is to
put the h2.jar file in a shared <code>lib</code> directory (common/lib).
put the h2.jar file in a shared <code class="notranslate">lib</code> directory (common/lib).
</li><li>Some problems have been found with right outer join. Internally, it is converted
to left outer join, which does not always produce the same results as other databases
when used in combination with other joins.
......@@ -92,11 +92,11 @@ By default, a new database is automatically created if it does not yet exist.
<br />
<h3 id="connect">How to Connect to a Database?</h3>
<p>
The database driver is <code>org.h2.Driver</code>,
and the database URL starts with <code>jdbc:h2:</code>.
The database driver is <code class="notranslate">org.h2.Driver</code>,
and the database URL starts with <code class="notranslate">jdbc:h2:</code>.
To connect to a database using JDBC, use the following code:
</p>
<pre>
<pre class="notranslate">
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
</pre>
......@@ -104,14 +104,14 @@ Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
<br />
<h3 id="database_files">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;".
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
When using database URLs like <code class="notranslate">jdbc:h2:~/test</code>, the database is stored in the user directory.
For Windows, this is usually C:\Documents and Settings\&lt;userName&gt;".
If the base directory is not set (as in <code class="notranslate">jdbc:h2:test</code>), 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 "&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 name (and for Windows, drive name).
Example: jdbc:h2:file:C:/data/test
Example: <code class="notranslate">jdbc:h2:file:C:/data/test</code>
</p>
<br />
......
......@@ -75,6 +75,15 @@ Initial Developer: H2 Group
<a href="faq.html"> FAQ </a><br />
<a href="license.html"> License </a><br />
<br />
<div id = "google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
</div>
</td>
......
......@@ -18,42 +18,49 @@ Functions
<h1>Functions</h1>
<h2>Aggregate Functions</h2>
<p class="notranslate">
<c:forEach var="item" items="functionsAggregate">
<a href="#${item.link}">${item.topic}</a><br />
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</p>
<h2>Numeric Functions</h2>
<p class="notranslate">
<c:forEach var="item" items="functionsNumeric">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>String Functions</h2>
<p class="notranslate">
<c:forEach var="item" items="functionsString">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>Time and Date Functions</h2>
<p class="notranslate">
<c:forEach var="item" items="functionsTimeDate">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>System Functions</h2>
<p class="notranslate">
<c:forEach var="item" items="functionsSystem">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<c:forEach var="item" items="functionsAll">
<br />
<h3 id="${item.link}">${item.topic}</h3>
<pre>
<h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<pre class="notranslate">
${item.syntax}
</pre>
<p>
${item.text}
</p>
<b>Example:</b><br />
${item.example}
<br />
<p>${item.text}</p>
<b>Example:</b>
<p class="notranslate">${item.example}</p>
</c:forEach>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
......
......@@ -17,73 +17,84 @@ SQL Grammar
<h1>SQL Grammar</h1>
<h2>Commands (Data Manipulation)</h2>
<p class="notranslate">
<c:forEach var="item" items="commandsDML">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>Commands (Data Definition)</h2>
<p class="notranslate">
<c:forEach var="item" items="commandsDDL">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>Commands (Other)</h2>
<p class="notranslate">
<c:forEach var="item" items="commandsOther">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</p>
<h2>Other Grammar</h2>
<p class="notranslate">
<c:forEach var="item" items="otherGrammar">
<a href="#${item.link}">${item.topic}</a><br />
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</p>
<h2>System Tables</h2>
<p class="notranslate">
<a href="#information_schema">Information Schema</a><br />
<a href="#range_table">Range Table</a><br />
</p>
<c:forEach var="item" items="commands">
<br />
<h3 id="${item.link}">${item.topic}</h3>
<pre>
<h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<pre class="notranslate">
${item.syntax}
</pre>
<p>
${item.text}
</p>
<b>Example:</b><br />
${item.example}
<br />
<p>${item.text}</p>
<b>Example:</b>
<p class="notranslate">${item.example}</p>
</c:forEach>
<c:forEach var="item" items="otherGrammar">
<br />
<h3 id="${item.link}">${item.topic}</h3>
<pre>
<h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<pre class="notranslate">
${item.syntax}
</pre>
<p>
${item.text}
</p>
<b>Example:</b><br />
${item.example}
<br />
<p>${item.text}</p>
<b>Example:</b>
<p class="notranslate">${item.example}</p>
</c:forEach>
<br />
<h3 id="information_schema">Information Schema</h3>
<h3 id="information_schema" class="notranslate">Information Schema</h3>
<p>
The system tables in the schema 'INFORMATION_SCHEMA' contain the meta data
of all tables in the database as well as the current settings.
</p>
<table><tr><th>Table</th><th>Columns</th></tr>
<c:forEach var="item" items="informationSchema">
<tr><td>${item.topic}</td><td>${item.syntax}</td></tr>
<tr class="notranslate">
<td>${item.topic}</td>
<td>${item.syntax}</td>
</tr>
</c:forEach>
</table>
<br />
<h3 id="range_table">Range Table</h3>
<h3 id="range_table" class="notranslate">Range Table</h3>
<p>
The range table is a dynamic system table that contains all values from a start to an end value.
The table contains one column called X. Both the start and end values are included in the result.
The table is used as follows:
</p>
<pre>
<pre class="notranslate">
SELECT X FROM SYSTEM_RANGE(1, 10);
</pre>
......
......@@ -25,7 +25,7 @@ JaQu replaces SQL, JDBC, and persistence frameworks such as Hibernate.
JaQu is something like LINQ for Java (LINQ stands for "language integrated query" and is a
Microsoft .NET technology). The following JaQu code:
</p>
<pre>
<pre class="notranslate">
Product p = new Product();
List&lt;Product&gt; soldOutProducts =
db.from(p).where(p.unitsInStock).is(0).select();
......@@ -33,7 +33,7 @@ List&lt;Product&gt; soldOutProducts =
<p>
stands for the SQL statement:
</p>
<pre>
<pre class="notranslate">
SELECT * FROM PRODUCTS P
WHERE P.UNITS_IN_STOCK = 0
</pre>
......@@ -77,7 +77,7 @@ JaQu is not part of the h2 jar file, however the source code is included in H2,
<h2>Building the JaQu library</h2>
<p>
To create the JaQu jar file, run: <code>build jarJaqu</code>. This will create the file <code>bin/h2jaqu.jar</code>.
To create the JaQu jar file, run: <code class="notranslate">build jarJaqu</code>. This will create the file <code class="notranslate">bin/h2jaqu.jar</code>.
</p>
<h2>Requirements</h2>
......@@ -88,7 +88,7 @@ work with any database that supports the JDBC API.
</p>
<h2>Example Code</h2>
<pre>
<pre class="notranslate">
package org.h2.test.jaqu;
import java.math.BigDecimal;
import java.util.List;
......@@ -229,7 +229,7 @@ To define table indices, or if you want to map a class to a table with a differe
or a field to a column with another name, create a function called 'define' in the data class.
Example:
</p>
<pre>
<pre class="notranslate">
public class Product implements Table {
public Integer productId;
......@@ -262,7 +262,7 @@ To do that, the condition class is de-compiled to a SQL condition.
A proof of concept decompiler is included (but it doesn't work yet).
The planned syntax is:
</p>
<pre>
<pre class="notranslate">
long count = db.from(co).
where(new Filter() { public boolean where() {
return co.id == x
......@@ -287,7 +287,7 @@ Some ideas for what to implement are:
</li></ul>
<h2>Related Projects</h2>
<p>
<p class="notranslate">
<a href="http://code.google.com/p/dreamsource-orm">Dreamsource ORM</a><br />
<a href="http://incubator.apache.org/empire-db/empiredb/empiredb.htm">Empire-db</a><br />
<a href="http://www.jequel.de">JEQUEL: Java Embedded QUEry Language</a><br />
......
......@@ -79,7 +79,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;">
<h3>Features</h3>
<table style="width: 425px;"><tr>
<table style="width: 425px;"><tr class="notranslate">
<th></th>
<th>H2</th>
<th><a href="http://db.apache.org/derby">Derby</a></th>
......
......@@ -107,7 +107,7 @@ HSQLDB is fast when using simple operations.
HSQLDB is very slow in the last test (BenchC: Transactions), probably because is has a bad query optimizer.
One query where HSQLDB is slow is a two-table join:
</p>
<pre>
<pre class="notranslate">
SELECT COUNT(DISTINCT S_I_ID) FROM ORDER_LINE, STOCK
WHERE OL_W_ID=? AND OL_D_ID=? AND OL_O_ID&lt;? AND OL_O_ID&gt;=?
AND S_W_ID=? AND S_I_ID=OL_I_ID AND S_QUANTITY&lt;?
......@@ -178,7 +178,7 @@ SQLite was not tested because the JDBC driver doesn't support transactions.
<p>
This test was executed as follows:
</p>
<pre>
<pre class="notranslate">
build benchmark
</pre>
......@@ -310,7 +310,7 @@ poleposition-0.20/lib/hsqldb.jar with a newer version (for example hsqldb-1.8.0.
and then use the setting
hsqldb.connecturl=jdbc:hsqldb:file:data/hsqldb/dbbench2;hsqldb.default_table_type=cached;sql.enforce_size=true in Jdbc.properties.
</li><li>HSQLDB keeps the database open between tests, while H2 closes the database (losing all the cache).
To change that, use the database URL jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1
To change that, use the database URL <code class="notranslate">jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1</code>
</li><li>The amount of cache memory is quite important, specially for the PolePosition test.
Unfortunately, the PolePosition test does not take this into account.
</li></ul>
......@@ -332,13 +332,13 @@ A good tool to measure both memory usage and performance is the
<p>
A simple way to profile an application is to use the built-in profiling tool of java. Example:
</p>
<pre>
<pre class="notranslate">
java -Xrunhprof:cpu=samples,depth=16 com.acme.Test
</pre>
<p>
Unfortunately, it is only possible to profile the application from start to end. Another solution is to create
a number of full thread dumps. To do that, first run <code>jps -l</code> to get the process id, and then
run <code>jstack &lt;pid&gt;</code> or <code>kill -QUIT &lt;pid&gt;</code> (Linux) or press
a number of full thread dumps. To do that, first run <code class="notranslate">jps -l</code> to get the process id, and then
run <code class="notranslate">jstack &lt;pid&gt;</code> or <code class="notranslate">kill -QUIT &lt;pid&gt;</code> (Linux) or press
Ctrl+C (Windows).
</p>
......@@ -349,7 +349,7 @@ The ConvertTraceFile tool generates SQL statement statistics at the end of the S
The format used is similar to the profiling data generated when using java -Xrunhprof.
As an example, execute the the following script using the H2 Console:
</p>
<pre>
<pre class="notranslate">
SET TRACE_LEVEL_FILE 3;
DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));
......@@ -359,15 +359,15 @@ SET TRACE_LEVEL_FILE 0;
<p>
Now convert the .trace.db file using the ConvertTraceFile tool:
</p>
<pre>
<pre class="notranslate">
java -cp h2*.jar org.h2.tools.ConvertTraceFile
-traceFile "~/test.trace.db" -script "~/test.sql"
</pre>
<p>
The generated file <code>test.sql</code> will contain the SQL statements as well as the
The generated file <code class="notranslate">test.sql</code> will contain the SQL statements as well as the
following profiling data (results vary):
</p>
<pre>
<pre class="notranslate">
-----------------------------------------
-- SQL Statement Statistics
-- time: total time in milliseconds (accumulated)
......@@ -387,7 +387,7 @@ following profiling data (results vary):
<h3>Use a Modern JVM</h3>
<p>
Newer JVMs are faster. Upgrading to the latest version of your JVM can provide a "free" boost to performance.
Switching from the default Client JVM to the Server JVM using the <code>-server</code> command-line
Switching from the default Client JVM to the Server JVM using the <code class="notranslate">-server</code> command-line
option improves performance at the cost of a slight increase in start-up time.
</p>
......@@ -475,7 +475,7 @@ queries and data manipulation.
</p>
<p>In-memory indexes are automatically used
for in-memory databases, but can also be created for persistent databases
using <code>CREATE MEMORY TABLE</code>. In many cases,
using <code class="notranslate">CREATE MEMORY TABLE</code>. In many cases,
the rows itself will also be kept in-memory. Please note this may cause memory
problems for large tables.
</p>
......@@ -483,13 +483,13 @@ problems for large tables.
In-memory hash indexes are backed by a hash table and are usually faster than
regular indexes. However, hash indexes only supports direct lookup (WHERE ID = ?)
but not range scan (WHERE ID &lt; ?). To use hash indexes, use HASH as in:
<code>CREATE UNIQUE HASH INDEX</code> and
<code>CREATE TABLE ...(ID INT PRIMARY KEY HASH,...)</code>.
<code class="notranslate">CREATE UNIQUE HASH INDEX</code> and
<code class="notranslate">CREATE TABLE ...(ID INT PRIMARY KEY HASH,...)</code>.
</p>
<h3>Optimization Examples</h3>
<p>
See <code>src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries
See <code class="notranslate">src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries
that benefit from special optimizations built into the database.
</p>
......@@ -522,7 +522,7 @@ To speed up large imports, consider using the following options temporarily:
</li></ul>
<p>
These options can be set in the database URL:
<code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code>.
<code class="notranslate">jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code>.
Most of those options are not recommended for regular use, that means you need to reset them after use.
</p>
......
......@@ -27,9 +27,9 @@ Quickstart
This database can be used in embedded mode, or in server mode. To use it in embedded mode, you need to:
</p>
<ul>
<li>Add the <code>h2*.jar</code> to the classpath (H2 does not have any dependencies)
</li><li>Use the JDBC driver class: <code>org.h2.Driver</code>
</li><li>The database URL <code>jdbc:h2:~/test</code> opens the database 'test' in your user home directory
<li>Add the <code class="notranslate">h2*.jar</code> to the classpath (H2 does not have any dependencies)
</li><li>Use the JDBC driver class: <code class="notranslate">org.h2.Driver</code>
</li><li>The database URL <code class="notranslate">jdbc:h2:~/test</code> opens the database 'test' in your user home directory
</li><li>A new database is automatically created
</li></ul>
......
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.
......@@ -297,6 +297,9 @@ java org.h2.test.TestAll timer
/*
disable translation in download
<span class="notranslate"></span>
mvcc merge problem
System.setProperty("h2.optimizeInList", "true");
......
......@@ -128,10 +128,11 @@ public class GenerateDoc {
for (int i = 0; i < meta.getColumnCount(); i++) {
String k = StringUtils.toLowerEnglish(meta.getColumnLabel(i + 1));
String value = rs.getString(i + 1);
value = value.trim();
map.put(k, PageParser.escapeHtml(value));
}
String topic = rs.getString("TOPIC");
String syntax = rs.getString("SYNTAX");
String syntax = rs.getString("SYNTAX").trim();
syntax = PageParser.escapeHtml(syntax);
// if enabled, HTML docs get very wide
// syntax = StringUtils.replaceAll(syntax, "<br />", " ");
......@@ -141,7 +142,6 @@ public class GenerateDoc {
// remove newlines in the regular text
String text = map.get("text");
if (text != null) {
text = text.trim();
// text is enclosed in <p> .. </p> so this works.
text = StringUtils.replaceAll(text, "<br /><br />", "</p><p>");
text = StringUtils.replaceAll(text, "<br />", " ");
......@@ -153,6 +153,7 @@ public class GenerateDoc {
// link = StringUtils.replaceAll(link, "_", "");
link = StringUtils.replaceAll(link, "@", "_");
map.put("link", StringUtils.urlEncode(link));
list.add(map);
}
session.put(key, list);
......
......@@ -614,3 +614,4 @@ approach risky getters suxxess gmb delegate delegating delegates collisions
linkage superfluous disallow scoop moebius inputs copilot dmoebius leod jenkov
jakob poker docware peter unstable measurable scramble reissued recreation
scrambling distinguish official unofficial distinguishable overwrites lastval
notranslate
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论