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

Documentation.

上级 45ebba7a
...@@ -1018,9 +1018,9 @@ SET CLUSTER '' ...@@ -1018,9 +1018,9 @@ SET CLUSTER ''
SET [ DATABASE ] COLLATION SET [ DATABASE ] COLLATION
{ OFF | collationName [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] } { OFF | collationName [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
"," ","
Sets the collation used for comparing strings. This command can only be executed Sets the collation used for comparing strings.
if there are no tables defined. See ""java.text.Collator"" for details about This command can only be executed if there are no tables defined.
STRENGTH. See ""java.text.Collator"" for details about the supported collations and the STRENGTH.
Admin rights are required to execute this command. Admin rights are required to execute this command.
This command commits an open transaction. This command commits an open transaction.
......
...@@ -438,6 +438,11 @@ Unfortunately, the standard documentation is not freely available. Another probl ...@@ -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. are not standardized. Whenever this is the case, this database tries to be compatible to other databases.
</p> </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> <h2 id="windows_service">Run as Windows Service</h2>
<p> <p>
Using a native wrapper / adapter, Java applications can be run as a Windows Service. Using a native wrapper / adapter, Java applications can be run as a Windows Service.
......
...@@ -30,7 +30,7 @@ Change Log ...@@ -30,7 +30,7 @@ Change Log
this might replace the Backup, ChangeFileEncryption, DeleteDbFiles, and Restore tools. this might replace the Backup, ChangeFileEncryption, DeleteDbFiles, and Restore tools.
</li><li>Lob in database: storing lob objects was not correctly synchronized. </li><li>Lob in database: storing lob objects was not correctly synchronized.
This was specially a problem when using Connection.createBlob() / createClob(). 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>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 </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, instead of the clean method. This has been fixed. Please note this hack is not enabled by default,
......
...@@ -43,14 +43,14 @@ Downloads ...@@ -43,14 +43,14 @@ Downloads
<a href="http://www.h2database.com/automated/h2-latest.jar">Latest Automated Build (not released)</a> <a href="http://www.h2database.com/automated/h2-latest.jar">Latest Automated Build (not released)</a>
</p> </p>
<h3>Maven Bundles (Binary, Javadoc, and Source)</h3> <h3>Maven (Binary, Javadoc, and Source)</h3>
<p> <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}.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}-javadoc.jar">Javadoc</a><br />
<a href="http://repo2.maven.org/maven2/com/h2database/h2/${version}/h2-${version}-sources.jar">Sources</a><br /> <a href="http://repo2.maven.org/maven2/com/h2database/h2/${version}/h2-${version}-sources.jar">Sources</a><br />
</p> </p>
<h3>Database Upgrade Helper Files</h3> <h3>Database Upgrade Helper File</h3>
<p> <p>
<a href="http://h2database.com/h2mig_pagestore_addon.jar">Upgrade database from 1.1 to the current version</a> <a href="http://h2database.com/h2mig_pagestore_addon.jar">Upgrade database from 1.1 to the current version</a>
</p> </p>
......
...@@ -469,14 +469,14 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -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><a href="advanced.html#ssl_tls_connections">Server mode (remote connections)<br /> using SSL/TLS</a></td>
<td class="notranslate"> <td class="notranslate">
jdbc:h2:ssl://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br /> 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> </td>
</tr> </tr>
<tr> <tr>
<td><a href="#file_encryption">Using encrypted files</a></td> <td><a href="#file_encryption">Using encrypted files</a></td>
<td class="notranslate"> <td class="notranslate">
jdbc:h2:&lt;url&gt;;CIPHER=[AES|XTEA]<br /> 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 /> jdbc:h2:file:~/secure;CIPHER=XTEA<br />
</td> </td>
</tr> </tr>
...@@ -1430,11 +1430,10 @@ For a complete sample application, see <code>src/test/org/h2/samples/Function.ja ...@@ -1430,11 +1430,10 @@ For a complete sample application, see <code>src/test/org/h2/samples/Function.ja
<p> <p>
When defining a function alias with source code, the database tries to compile 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>) 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 if the <code>tools.jar</code> is in the classpath. If not, <code>javac</code> is run as a separate process.
process. Only the source code is stored in the database; the class is compiled each time Only the source code is stored in the database; the class is compiled each time the database is re-opened.
the database is re-opened. Source code is usually passed Source code is usually passed as dollar quoted text to avoid escaping problems, however single quotes can be used as well.
as dollar quoted text to avoid escaping problems, however single quotes Example:
can be used as well. Example:
</p> </p>
<pre> <pre>
CREATE ALIAS NEXT_PRIME AS $$ CREATE ALIAS NEXT_PRIME AS $$
...@@ -1444,8 +1443,9 @@ String nextPrime(String value) { ...@@ -1444,8 +1443,9 @@ String nextPrime(String value) {
$$; $$;
</pre> </pre>
<p> <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. 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 If different import statements are required, they must be declared at the beginning
and separated with the tag <code>@CODE</code>: and separated with the tag <code>@CODE</code>:
</p> </p>
...@@ -1473,6 +1473,13 @@ public class &lt;aliasName&gt; { ...@@ -1473,6 +1473,13 @@ public class &lt;aliasName&gt; {
} }
</pre> </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> <h3>Function Data Type Mapping</h3>
<p> <p>
Functions that accept non-nullable parameters such as <code>int</code> 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: ...@@ -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://lumber-mill.co.jp">Lumber-mill, Inc., Japan</a>
</li><li><a href="http://www.stockmarketeye.com">StockMarketEye, USA</a> </li><li><a href="http://www.stockmarketeye.com">StockMarketEye, USA</a>
</li><li>Martin Wildam, Austria </li><li>Martin Wildam, Austria
</li><li>Ashwin Jayaprakash, USA
</li><li>Donald Bleyl, USA </li><li>Donald Bleyl, USA
</li><li>Frank Berger, Germany </li><li>Frank Berger, Germany
</li><li>Ashwin Jayaprakash, USA
</li><li>Florent Ramiere, France </li><li>Florent Ramiere, France
</li><li>Jun Iyama, Japan </li><li>Jun Iyama, Japan
</li><li>Antonio Casqueiro, Portugal </li><li>Antonio Casqueiro, Portugal
......
...@@ -52,11 +52,11 @@ copyright and license as the original code. The copyright of the ported source c ...@@ -52,11 +52,11 @@ copyright and license as the original code. The copyright of the ported source c
</p> </p>
<p> <p>
If you distribute a binary that includes H2, you need to add a disclaimer of liability 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 disclaimers for all open source libraries you use. (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, 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. and list all open source libraries, each one with its license and disclaimer.
The easiest solution is to copy the following below. You may also include a copy of the complete license. For H2, a simple solution is to copy the following text below. You may also include a copy of the complete license.
</p> </p>
<pre> <pre>
This software contains unmodified binary redistributions for H2 database engine (http://www.h2database.com/), This software contains unmodified binary redistributions for H2 database engine (http://www.h2database.com/),
......
...@@ -173,13 +173,11 @@ function switchBnf(x) { ...@@ -173,13 +173,11 @@ function switchBnf(x) {
for (var i = 0; i < bnfList.length; i++) { for (var i = 0; i < bnfList.length; i++) {
var bnf = bnfList[i].style; var bnf = bnfList[i].style;
bnf.display = bnf.display == '' ? 'none' : ''; bnf.display = bnf.display == '' ? 'none' : '';
bnf.visibility = bnf.display == 'none' ? 'hidden' : 'visible';
} }
var railroads = document.getElementsByName('railroad'); var railroads = document.getElementsByName('railroad');
for (var i = 0; i < railroads.length; i++) { for (var i = 0; i < railroads.length; i++) {
var railroad = railroads[i].style; var railroad = railroads[i].style;
railroad.display = railroad.display == '' ? 'none' : ''; railroad.display = railroad.display == '' ? 'none' : '';
railroad.visibility = railroad.display == 'none' ? 'hidden' : 'visible';
} }
if (x) { if (x) {
document.location = '#' + x.id; document.location = '#' + x.id;
......
...@@ -536,6 +536,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -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>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 compatible array literal syntax: ARRAY[['a', 'b'], ['c', 'd']]
</li><li>PostgreSQL compatibility: UPDATE with FROM. </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> </li></ul>
<h2>Not Planned</h2> <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 { ...@@ -62,7 +62,8 @@ abstract class PageData extends Page {
protected boolean written; 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; protected int memoryEstimated;
...@@ -217,9 +218,9 @@ abstract class PageData extends Page { ...@@ -217,9 +218,9 @@ abstract class PageData extends Page {
abstract Row getRowWithKey(long key); 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() { public int getMemory() {
// need to always return the same value for the same object (otherwise // need to always return the same value for the same object (otherwise
......
...@@ -44,8 +44,14 @@ public class PageDataIndex extends PageIndex { ...@@ -44,8 +44,14 @@ public class PageDataIndex extends PageIndex {
private HashMap<Integer, Integer> sessionRowCount; private HashMap<Integer, Integer> sessionRowCount;
private int mainIndexColumn = -1; private int mainIndexColumn = -1;
private DbException fastDuplicateKeyException; private DbException fastDuplicateKeyException;
/**
* The estimated heap memory per page, in number of double words (4 bytes
* each).
*/
private int memoryPerPage; private int memoryPerPage;
private int memoryCount; private int memoryCount;
private boolean multiVersion; private boolean multiVersion;
public PageDataIndex(RegularTable table, int id, IndexColumn[] columns, IndexType indexType, boolean create, Session session) { public PageDataIndex(RegularTable table, int id, IndexColumn[] columns, IndexType indexType, boolean create, Session session) {
......
...@@ -93,7 +93,7 @@ public class TestLob extends TestBase { ...@@ -93,7 +93,7 @@ public class TestLob extends TestBase {
IOUtils.deleteRecursive(TEMP_DIR, true); IOUtils.deleteRecursive(TEMP_DIR, true);
} }
public void testConcurrentCreate() throws Exception { private void testConcurrentCreate() throws Exception {
deleteDb("lob"); deleteDb("lob");
final JdbcConnection conn1 = (JdbcConnection) getConnection("lob"); final JdbcConnection conn1 = (JdbcConnection) getConnection("lob");
final JdbcConnection conn2 = (JdbcConnection) getConnection("lob"); final JdbcConnection conn2 = (JdbcConnection) getConnection("lob");
......
...@@ -55,14 +55,14 @@ public class TestConnectionInfo extends TestBase { ...@@ -55,14 +55,14 @@ public class TestConnectionInfo extends TestBase {
private void testConnectionInfo() throws Exception { private void testConnectionInfo() throws Exception {
Properties info = new Properties(); Properties info = new Properties();
ConnectionInfo connectionInfo = new ConnectionInfo( ConnectionInfo connectionInfo = new ConnectionInfo(
"jdbc:h2:mem:testdb" + "jdbc:h2:mem:test" +
";LOG=2" + ";LOG=2" +
";ACCESS_MODE_DATA=rws" + ";ACCESS_MODE_DATA=rws" +
";INIT=CREATE this...\\;INSERT that..." + ";INIT=CREATE this...\\;INSERT that..." +
";IFEXISTS=TRUE", ";IFEXISTS=TRUE",
info); info);
assertEquals("jdbc:h2:mem:testdb", connectionInfo.getURL()); assertEquals("jdbc:h2:mem:test", connectionInfo.getURL());
assertEquals("2", connectionInfo.getProperty("LOG", "")); assertEquals("2", connectionInfo.getProperty("LOG", ""));
assertEquals("rws", connectionInfo.getProperty("ACCESS_MODE_DATA", "")); assertEquals("rws", connectionInfo.getProperty("ACCESS_MODE_DATA", ""));
...@@ -73,8 +73,8 @@ public class TestConnectionInfo extends TestBase { ...@@ -73,8 +73,8 @@ public class TestConnectionInfo extends TestBase {
private void testName() throws Exception { private void testName() throws Exception {
char differentFileSeparator = File.separatorChar == '/' ? '\\' : '/'; char differentFileSeparator = File.separatorChar == '/' ? '\\' : '/';
ConnectionInfo connectionInfo = new ConnectionInfo("testdb" + differentFileSeparator + "subdir"); ConnectionInfo connectionInfo = new ConnectionInfo("test" + differentFileSeparator + "subDir");
File file = new File("testdb" + File.separatorChar + "subdir"); File file = new File("test" + File.separatorChar + "subDir");
assertEquals(file.getCanonicalPath(), connectionInfo.getName()); assertEquals(file.getCanonicalPath(), connectionInfo.getName());
} }
......
...@@ -26,7 +26,7 @@ public class CheckTextFiles { ...@@ -26,7 +26,7 @@ public class CheckTextFiles {
private static final String[] SUFFIX_CHECK = { "html", "jsp", "js", "css", "bat", "nsi", private static final String[] SUFFIX_CHECK = { "html", "jsp", "js", "css", "bat", "nsi",
"java", "txt", "properties", "sql", "xml", "csv", "Driver", "prefs" }; "java", "txt", "properties", "sql", "xml", "csv", "Driver", "prefs" };
private static final String[] SUFFIX_IGNORE = { "gif", "png", "odg", "ico", "sxd", 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 static final String[] SUFFIX_CRLF = { "bat" };
private boolean failOnError; private boolean failOnError;
......
...@@ -25,7 +25,7 @@ import org.h2.util.StringUtils; ...@@ -25,7 +25,7 @@ import org.h2.util.StringUtils;
public class SpellChecker { public class SpellChecker {
private static final String[] SUFFIX = { "html", "java", "sql", "txt", "xml", "jsp", "css", "bat", 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", private static final String[] IGNORE = { "dev", "nsi", "gif", "png", "odg", "ico", "sxd", "zip",
"bz2", "rc", "layout", "res", "dll", "jar", "svg", "prefs", "prop", "iml" }; "bz2", "rc", "layout", "res", "dll", "jar", "svg", "prefs", "prop", "iml" };
private static final String DELIMITERS = " \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t"; private static final String DELIMITERS = " \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t";
......
...@@ -378,7 +378,7 @@ scanner scanners scanning scans scheduler schem schema schemas schemata schmorp ...@@ -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 schoen school sciences scm scope scoped scott scratch screen screenshot script
scriptella scripts scroll scrollable scrolling sdot seam search searchable scriptella scripts scroll scrollable scrolling sdot seam search searchable
searched searcher searches searching sec second secondary seconds secret sect 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 seem seems select selectable selected selection selectivity selects self sell
selling semicolon semmle send sending sends sense sensitive sensitivity sent selling semicolon semmle send sending sends sense sensitive sensitivity sent
sentence sentinel sep sepang separate separated separately separating separator 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 ...@@ -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 task tasks tau tax tbalance tbody tcp technical technology tell teller tellers
telling temp template templated temple temporarily temporary term terminal telling temp template templated temple temporarily temporary term terminal
terminate terminated terminates terminating termination terms tertiary test testa 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 texts textual than thanks that the their them themselves then theoretical
theoretically theory there thereafter therefore thereof these theta thetasym they theoretically theory there thereafter therefore thereof these theta thetasym they
thin thing things think thinsp third this thomas thorn those thousand thousands thin thing things think thinsp third this thomas thorn those thousand thousands
...@@ -679,4 +679,4 @@ exceed identities differentiate inherited tracks strip suggestions ...@@ -679,4 +679,4 @@ exceed identities differentiate inherited tracks strip suggestions
registration sanity improperly annotate inheritance composite inspected registration sanity improperly annotate inheritance composite inspected
hurt imposes marshal policy upgrader configurations dark varray xlint executor hurt imposes marshal policy upgrader configurations dark varray xlint executor
completion inactivity exports maintains backside schwietzke rene rectangular grandin noel 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论