提交 815d6b6f authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 45ebba7a
......@@ -18,7 +18,7 @@ ORDER BY sorts the result by the given column(s) or expression(s).
UNION combines the result of this query with the results of another query.
LIMIT limits the number of rows returned by the query (no limit if null or smaller than zero).
OFFSET specified how many rows to skip.
OFFSET specified how many rows to skip.
SAMPLE_SIZE limits the number of rows read for aggregate queries.
Multiple set operators (UNION, INTERSECT, MINUS, EXPECT) are evaluated
......@@ -1018,9 +1018,9 @@ SET CLUSTER ''
SET [ DATABASE ] COLLATION
{ OFF | collationName [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
","
Sets the collation used for comparing strings. This command can only be executed
if there are no tables defined. See ""java.text.Collator"" for details about
STRENGTH.
Sets the collation used for comparing strings.
This command can only be executed if there are no tables defined.
See ""java.text.Collator"" for details about the supported collations and the STRENGTH.
Admin rights are required to execute this command.
This command commits an open transaction.
......
......@@ -438,6 +438,11 @@ Unfortunately, the standard documentation is not freely available. Another probl
are not standardized. Whenever this is the case, this database tries to be compatible to other databases.
</p>
<h3>Supported Character Sets, Character Encoding, and Unicode</h3>
<p>
H2 internally uses Unicode, and supports all character encoding systems and character sets supported by the virtual machine you use.
</p>
<h2 id="windows_service">Run as Windows Service</h2>
<p>
Using a native wrapper / adapter, Java applications can be run as a Windows Service.
......
......@@ -20,7 +20,7 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul><li>Issue 294: The Maven source bundle now contains a manifest file that allows Eclipse to automatically
attach the source code (if Maven is used).
</li><li>A query with an explicit LIMIT 0 will now return no rows (so far it meant no limit),
</li><li>A query with an explicit LIMIT 0 will now return no rows (so far it meant no limit),
which is compatible with PostgreSQL and MySQL.
A negative limit value, (as well as LIMIT NULL) mean no limit (so far a negative limit meant a limit of one row).
There were similar problems with OFFSET.
......@@ -30,7 +30,7 @@ Change Log
this might replace the Backup, ChangeFileEncryption, DeleteDbFiles, and Restore tools.
</li><li>Lob in database: storing lob objects was not correctly synchronized.
This was specially a problem when using Connection.createBlob() / createClob().
</li><li>Updated the licence page (thanks a lot to Abe to help me with this).
</li><li>Updated the license page (thanks a lot to Abe to help me with this).
</li><li>Support for database paths with '\' on non-Windows systems.
</li><li>The NIO cleaner hack wasn't working as expected, because the clear method was called
instead of the clean method. This has been fixed. Please note this hack is not enabled by default,
......
......@@ -43,14 +43,14 @@ Downloads
<a href="http://www.h2database.com/automated/h2-latest.jar">Latest Automated Build (not released)</a>
</p>
<h3>Maven Bundles (Binary, Javadoc, and Source)</h3>
<h3>Maven (Binary, Javadoc, and Source)</h3>
<p>
<a href="http://repo2.maven.org/maven2/com/h2database/h2/${version}/h2-${version}.jar">Binary</a><br />
<a href="http://repo2.maven.org/maven2/com/h2database/h2/${version}/h2-${version}-javadoc.jar">Javadoc</a><br />
<a href="http://repo2.maven.org/maven2/com/h2database/h2/${version}/h2-${version}-sources.jar">Sources</a><br />
</p>
<h3>Database Upgrade Helper Files</h3>
<h3>Database Upgrade Helper File</h3>
<p>
<a href="http://h2database.com/h2mig_pagestore_addon.jar">Upgrade database from 1.1 to the current version</a>
</p>
......
......@@ -469,14 +469,14 @@ This is achieved using different database URLs. Settings in the URLs are not cas
<td><a href="advanced.html#ssl_tls_connections">Server mode (remote connections)<br /> using SSL/TLS</a></td>
<td class="notranslate">
jdbc:h2:ssl://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br />
jdbc:h2:ssl://secureserv:8085/~/sample;
jdbc:h2:ssl://localhost:8085/~/sample;
</td>
</tr>
<tr>
<td><a href="#file_encryption">Using encrypted files</a></td>
<td class="notranslate">
jdbc:h2:&lt;url&gt;;CIPHER=[AES|XTEA]<br />
jdbc:h2:ssl://secureserv/~/testdb;CIPHER=AES<br />
jdbc:h2:ssl://localhost/~/test;CIPHER=AES<br />
jdbc:h2:file:~/secure;CIPHER=XTEA<br />
</td>
</tr>
......@@ -1430,11 +1430,10 @@ For a complete sample application, see <code>src/test/org/h2/samples/Function.ja
<p>
When defining a function alias with source code, the database tries to compile
the source code using the Sun Java compiler (the class <code>com.sun.tools.javac.Main</code>)
if the <code>tools.jar</code> is in the classpath. If not, <code>javac</code> is run as a separate
process. Only the source code is stored in the database; the class is compiled each time
the database is re-opened. Source code is usually passed
as dollar quoted text to avoid escaping problems, however single quotes
can be used as well. Example:
if the <code>tools.jar</code> is in the classpath. If not, <code>javac</code> is run as a separate process.
Only the source code is stored in the database; the class is compiled each time the database is re-opened.
Source code is usually passed as dollar quoted text to avoid escaping problems, however single quotes can be used as well.
Example:
</p>
<pre>
CREATE ALIAS NEXT_PRIME AS $$
......@@ -1444,8 +1443,9 @@ String nextPrime(String value) {
$$;
</pre>
<p>
The method name (<code>nextPrime</code> in the example above) is ignored.
By default, the three packages <code>java.util, java.math, java.sql</code> are imported.
The method name (<code>nextPrime</code> in the example above) is ignored.
Method overloading is not supported when declaring functions as source code, that means only one method may be declared for an alias.
If different import statements are required, they must be declared at the beginning
and separated with the tag <code>@CODE</code>:
</p>
......@@ -1473,6 +1473,13 @@ public class &lt;aliasName&gt; {
}
</pre>
<h3>Method Overloading</h3>
<p>
Multiple methods may be bound to a SQL function if the class is already compiled and included in the classpath.
Each Java method must have a different number of arguments.
Method overloading is not supported when declaring functions as source code.
</p>
<h3>Function Data Type Mapping</h3>
<p>
Functions that accept non-nullable parameters such as <code>int</code>
......
......@@ -98,9 +98,9 @@ spread the word, and translated this project. Also many thanks to the donors:
</li><li><a href="http://lumber-mill.co.jp">Lumber-mill, Inc., Japan</a>
</li><li><a href="http://www.stockmarketeye.com">StockMarketEye, USA</a>
</li><li>Martin Wildam, Austria
</li><li>Ashwin Jayaprakash, USA
</li><li>Donald Bleyl, USA
</li><li>Frank Berger, Germany
</li><li>Ashwin Jayaprakash, USA
</li><li>Florent Ramiere, France
</li><li>Jun Iyama, Japan
</li><li>Antonio Casqueiro, Portugal
......
......@@ -52,15 +52,15 @@ copyright and license as the original code. The copyright of the ported source c
</p>
<p>
If you distribute a binary that includes H2, you need to add a disclaimer of liability
(as you should do for your own code). You should add disclaimers for all open source libraries you use.
If you distribute a binary that includes H2, you need to add the license and a disclaimer of liability
(as you should do for your own code). You should add a disclaimer for each open source libraries you use.
For example, add a file <code>3rdparty_license.txt</code> in the directory where the jar files are,
where you list all licenses and disclaimers for all included open source libraries.
The easiest solution is to copy the following below. You may also include a copy of the complete license.
and list all open source libraries, each one with its license and disclaimer.
For H2, a simple solution is to copy the following text below. You may also include a copy of the complete license.
</p>
<pre>
This software contains unmodified binary redistributions for H2 database engine (http://www.h2database.com/),
which is dual licensed and available under a modified version of the MPL 1.1 (Mozilla Public License)
This software contains unmodified binary redistributions for H2 database engine (http://www.h2database.com/),
which is dual licensed and available under a modified version of the MPL 1.1 (Mozilla Public License)
or under the (unmodified) EPL 1.0 (Eclipse Public License).
An original copy of the license agreement can be found at: http://www.h2database.com/html/license.html
</pre>
......
......@@ -173,13 +173,11 @@ function switchBnf(x) {
for (var i = 0; i < bnfList.length; i++) {
var bnf = bnfList[i].style;
bnf.display = bnf.display == '' ? 'none' : '';
bnf.visibility = bnf.display == 'none' ? 'hidden' : 'visible';
}
var railroads = document.getElementsByName('railroad');
for (var i = 0; i < railroads.length; i++) {
var railroad = railroads[i].style;
railroad.display = railroad.display == '' ? 'none' : '';
railroad.visibility = railroad.display == 'none' ? 'hidden' : 'visible';
}
if (x) {
document.location = '#' + x.id;
......
......@@ -536,6 +536,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Compatibility for ARRAY data type (Oracle: VARRAY(n) of VARCHAR(m); HSQLDB: VARCHAR(n) ARRAY; Postgres: VARCHAR(n)[]).
</li><li>PostgreSQL compatible array literal syntax: ARRAY[['a', 'b'], ['c', 'd']]
</li><li>PostgreSQL compatibility: UPDATE with FROM.
</li><li>Issue 297: Oracle compatibility for "at time zone".
</li><li>IBM DB2 compatibility: IDENTITY_VAL_LOCAL().
</li></ul>
<h2>Not Planned</h2>
......
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.
......@@ -62,7 +62,8 @@ abstract class PageData extends Page {
protected boolean written;
/**
* The estimated memory used by this object.
* The estimated heap memory used by this object, in number of double words
* (4 bytes each).
*/
protected int memoryEstimated;
......@@ -217,9 +218,9 @@ abstract class PageData extends Page {
abstract Row getRowWithKey(long key);
/**
* Get the estimated memory size.
* Get the estimated heap memory size.
*
* @return number of double words (4 bytes)
* @return number of double words (4 bytes each)
*/
public int getMemory() {
// need to always return the same value for the same object (otherwise
......
......@@ -44,8 +44,14 @@ public class PageDataIndex extends PageIndex {
private HashMap<Integer, Integer> sessionRowCount;
private int mainIndexColumn = -1;
private DbException fastDuplicateKeyException;
/**
* The estimated heap memory per page, in number of double words (4 bytes
* each).
*/
private int memoryPerPage;
private int memoryCount;
private boolean multiVersion;
public PageDataIndex(RegularTable table, int id, IndexColumn[] columns, IndexType indexType, boolean create, Session session) {
......
......@@ -93,7 +93,7 @@ public class TestLob extends TestBase {
IOUtils.deleteRecursive(TEMP_DIR, true);
}
public void testConcurrentCreate() throws Exception {
private void testConcurrentCreate() throws Exception {
deleteDb("lob");
final JdbcConnection conn1 = (JdbcConnection) getConnection("lob");
final JdbcConnection conn2 = (JdbcConnection) getConnection("lob");
......
......@@ -55,14 +55,14 @@ public class TestConnectionInfo extends TestBase {
private void testConnectionInfo() throws Exception {
Properties info = new Properties();
ConnectionInfo connectionInfo = new ConnectionInfo(
"jdbc:h2:mem:testdb" +
"jdbc:h2:mem:test" +
";LOG=2" +
";ACCESS_MODE_DATA=rws" +
";INIT=CREATE this...\\;INSERT that..." +
";IFEXISTS=TRUE",
info);
assertEquals("jdbc:h2:mem:testdb", connectionInfo.getURL());
assertEquals("jdbc:h2:mem:test", connectionInfo.getURL());
assertEquals("2", connectionInfo.getProperty("LOG", ""));
assertEquals("rws", connectionInfo.getProperty("ACCESS_MODE_DATA", ""));
......@@ -70,11 +70,11 @@ public class TestConnectionInfo extends TestBase {
assertEquals("TRUE", connectionInfo.getProperty("IFEXISTS", ""));
assertEquals("undefined", connectionInfo.getProperty("CACHE_TYPE", "undefined"));
}
private void testName() throws Exception {
char differentFileSeparator = File.separatorChar == '/' ? '\\' : '/';
ConnectionInfo connectionInfo = new ConnectionInfo("testdb" + differentFileSeparator + "subdir");
File file = new File("testdb" + File.separatorChar + "subdir");
ConnectionInfo connectionInfo = new ConnectionInfo("test" + differentFileSeparator + "subDir");
File file = new File("test" + File.separatorChar + "subDir");
assertEquals(file.getCanonicalPath(), connectionInfo.getName());
}
......
......@@ -26,7 +26,7 @@ public class CheckTextFiles {
private static final String[] SUFFIX_CHECK = { "html", "jsp", "js", "css", "bat", "nsi",
"java", "txt", "properties", "sql", "xml", "csv", "Driver", "prefs" };
private static final String[] SUFFIX_IGNORE = { "gif", "png", "odg", "ico", "sxd",
"layout", "res", "win", "jar", "task", "svg", "MF", "sh", "DS_Store", "prop" };
"layout", "res", "win", "jar", "task", "svg", "MF", "mf", "sh", "DS_Store", "prop" };
private static final String[] SUFFIX_CRLF = { "bat" };
private boolean failOnError;
......
......@@ -25,7 +25,7 @@ import org.h2.util.StringUtils;
public class SpellChecker {
private static final String[] SUFFIX = { "html", "java", "sql", "txt", "xml", "jsp", "css", "bat",
"csv", "xml", "js", "Driver", "properties", "task", "MF", "sh", "" };
"csv", "xml", "js", "Driver", "properties", "task", "MF", "mf", "sh", "" };
private static final String[] IGNORE = { "dev", "nsi", "gif", "png", "odg", "ico", "sxd", "zip",
"bz2", "rc", "layout", "res", "dll", "jar", "svg", "prefs", "prop", "iml" };
private static final String DELIMITERS = " \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t";
......
......@@ -378,7 +378,7 @@ scanner scanners scanning scans scheduler schem schema schemas schemata schmorp
schoen school sciences scm scope scoped scott scratch screen screenshot script
scriptella scripts scroll scrollable scrolling sdot seam search searchable
searched searcher searches searching sec second secondary seconds secret sect
section sections secure secureserv securing security see seed seeded seeds seek
section sections secure securing security see seed seeded seeds seek
seem seems select selectable selected selection selectivity selects self sell
selling semicolon semmle send sending sends sense sensitive sensitivity sent
sentence sentinel sep sepang separate separated separately separating separator
......@@ -427,7 +427,7 @@ takes taking tamava tan tanh tanuki tanukisoftware tape tapes tar target targets
task tasks tau tax tbalance tbody tcp technical technology tell teller tellers
telling temp template templated temple temporarily temporary term terminal
terminate terminated terminates terminating termination terms tertiary test testa
testb testdb tested testid testing testlob tests testtab text textarea textbase
testb tested testid testing testlob tests testtab text textarea textbase
texts textual than thanks that the their them themselves then theoretical
theoretically theory there thereafter therefore thereof these theta thetasym they
thin thing things think thinsp third this thomas thorn those thousand thousands
......@@ -679,4 +679,4 @@ exceed identities differentiate inherited tracks strip suggestions
registration sanity improperly annotate inheritance composite inspected
hurt imposes marshal policy upgrader configurations dark varray xlint executor
completion inactivity exports maintains backside schwietzke rene rectangular grandin noel
sine cosine tangent cotangent trigonometric hyperbolic lte
sine cosine tangent cotangent trigonometric hyperbolic lte abe alphabetical killer
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论