提交 2ceb8a1f authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 275f182a
......@@ -139,6 +139,8 @@
<java classname="org.h2.tools.doc.LinkChecker" classpath="bin">
<arg line="-dir docs"/>
</java>
<java classname="org.h2.tools.doc.XMLChecker" classpath="bin">
</java>
</target>
<target name="gcj" depends="compileResources">
......
......@@ -13,20 +13,20 @@ Build
<h1>Build</h1>
<a href="#portability">
Portability</a><br />
Portability</a><br>
<a href="#environment">
Environment</a><br />
Environment</a><br>
<a href="#building">
Building the Software</a><br />
Building the Software</a><br>
<a href="#maven2">
Using Maven 2</a><br />
Using Maven 2</a><br>
<br /><a name="portability"></a>
<br><a name="portability"></a>
<h2>Portability</h2>
This database is written in Java and therefore works on many platforms.
It is also possible to compile it to a native executable using GCJ.
<br /><a name="environment"></a>
<br><a name="environment"></a>
<h2>Environment</h2>
To build the database executables, the following software stack was used.
In most cases, newer version or compatible software works too, but this was not tested.
......@@ -39,7 +39,7 @@ In most cases, newer version or compatible software works too, but this was not
<li>YourKit Java Profiler
</ul>
<br /><a name="building"></a>
<br><a name="building"></a>
<h2>Building the Software</h2>
On the command line, go to the directory src and execute the following command:
<pre>
......@@ -56,7 +56,7 @@ ant jarClient
</pre>
The other targets may be used as well.
<br /><a name="maven2"></a>
<br><a name="maven2"></a>
<h2>Using Maven 2</h2>
<h3>Using a Central Repository</h3>
You can include the database in your Maven 2 project as a dependency.
......
......@@ -21,8 +21,9 @@ Data Types
<pre>
${item.syntax}
</pre>
${item.text}
<p>
${item.text}
</p>
<b>Example:</b><br>
${item.example}
<br>
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). -->
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><title>
H2 Database Engine
</title><link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="alternate" type="application/atom+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-atom.xml">
<link rel="alternate" type="application/rss+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-rss.xml">
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="frameMe();">
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<h1>Downloads</h1>
<h3>Version 1.0 / 2007-01-02 (Current)</h3>
<p>
<a href="http://www.h2database.com/h2-setup-2007-01-02.exe">Windows Installer (2.7 MB)</a><br>
<a href="http://www.h2database.com/h2-2007-01-02.zip">Platform-Independent Zip (3.6 MB)</a><br>
</p>
<h3>Version 1.0 / 2006-08-31 (Last Stable)</h3>
<p>
<a href="http://www.h2database.com/h2-setup-2006-08-31.exe">Windows Installer (2.4 MB)</a><br>
<a href="http://www.h2database.com/h2-2006-08-31.zip">Platform-Independent Zip (3.1 MB)</a><br>
</p>
<p>
For details about changes, see the <a href="history.html">Change Log</a>.
</p>
</div></td></tr></table></body></html>
\ No newline at end of file
......@@ -9,8 +9,8 @@ Initial Developer: H2 Group
<title>H2 Database Engine</title>
<script type="text/javascript" src="navigation.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="alternate" type="application/atom+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-atom.xml" />
<link rel="alternate" type="application/rss+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-rss.xml" />
<link rel="alternate" type="application/atom+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-atom.xml">
<link rel="alternate" type="application/rss+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-rss.xml">
</head>
<frameset cols="180,*" rows="*" frameborder="2" framespacing="4" border="4" onLoad="loadFrameset()">
<frame frameborder="0" marginheight="0" marginwidth="0" src="search.html" name="menu">
......
......@@ -43,8 +43,9 @@ Functions
<pre>
${item.syntax}
</pre>
${item.text}
<p>
${item.text}
</p>
<b>Example:</b><br>
${item.example}
<br>
......
......@@ -34,8 +34,9 @@ SQL Grammar
<pre>
${item.syntax}
</pre>
${item.text}
<p>
${item.text}
</p>
<b>Example:</b><br>
${item.example}
<br>
......@@ -47,8 +48,9 @@ ${item.example}
<pre>
${item.syntax}
</pre>
${item.text}
<p>
${item.text}
</p>
<b>Example:</b><br>
${item.example}
<br>
......
......@@ -12,13 +12,13 @@ History
<h1>History and Roadmap</h1>
<a href="#history">
History of this Database Engine</a><br />
History of this Database Engine</a><br>
<a href="#changelog">
Change Log</a><br />
Change Log</a><br>
<a href="#roadmap">
Roadmap</a><br />
Roadmap</a><br>
<br /><a name="history"></a>
<br><a name="history"></a>
<h2>History of this Database Engine</h2>
The development of H2 was started in May 2004,
but it was first published on December 14th 2005.
......@@ -29,21 +29,21 @@ to continued to work on the Hypersonic SQL codebase.
The name H2 stands for Hypersonic 2; however H2 does not share any code with
Hypersonic SQL or HSQLDB. H2 is built from scratch.
<br /><a name="changelog"></a>
<br><a name="changelog"></a>
<h2>Change Log</h2>
<h3>Version 1.0 (Current)</h3>
<h3>Version 1.0 / TODO</h3><ul>
<li>Can now parse timestamps with timezone information (Z or +/-hh:mm) and dates before year 1.
However dates before year 1 are not formatted correctly (this is a Java problem).
However dates before year 1 are not formatted correctly (this is a Java problem).
<li>When stopping the TCP server from an application and immediately afterwards staring it again
using a different TCP password, an exception was thrown sometimes.
using a different TCP password, an exception was thrown sometimes.
<li>Now PreparedStatement.setBigDecimal(..) can only be called with an object
of type java.math.BigDecimal. Derived classes are not allowed any more. Many thanks to
Maciej Wegorkiewicz for finding this problem.
of type java.math.BigDecimal. Derived classes are not allowed any more. Many thanks to
Maciej Wegorkiewicz for finding this problem.
<li>It was possible to manipulate values in the byte array after calling PreparedStatement.setBytes, and this
could lead to problems if the same byte array was used again. Now the byte array is copied if required.
could lead to problems if the same byte array was used again. Now the byte array is copied if required.
<li>Date, time and timestamp objects were cloned in cases where it was not required. Fixed.
</ul>
......@@ -1349,7 +1349,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
First public release.
</ul>
<br /><a name="roadmap"></a>
<br><a name="roadmap"></a>
<h2>Roadmap</h2>
<h3>Highest Priority</h3>
......
......@@ -13,15 +13,15 @@ Installation
<h1>Installation</h1>
<a href="#requirements">
Requirements</a><br />
Requirements</a><br>
<a href="#supported_platforms">
Supported Platforms</a><br />
Supported Platforms</a><br>
<a href="#installing">
Installing the Software</a><br />
Installing the Software</a><br>
<a href="#directory_structure">
Directory Structure</a><br />
Directory Structure</a><br>
<br /><a name="requirements"></a>
<br><a name="requirements"></a>
<h2>Requirements</h2>
To run the database, the following software stack is known to work.
Compatible software works too, but this was not tested.
......@@ -31,7 +31,7 @@ Compatible software works too, but this was not tested.
<li>Mozilla Firefox 1.5
</ul>
<br /><a name="supported_platforms"></a>
<br><a name="supported_platforms"></a>
<h2>Supported Platforms</h2>
As this database is written in Java, it can be run on many different platforms.
It is tested with Java 1.4 and 1.5, but can also be compiled to native code using GCJ.
......@@ -39,11 +39,11 @@ The source code does not use features of Java 1.5. Currently, the database is
developed and tested on Windows XP using the Sun JDKs, but probably it also
works in many other operating systems and using other Java runtime environments.
<br /><a name="installing"></a>
<br><a name="installing"></a>
<h2>Installing the Software</h2>
To install the software, run the installer or unzip it to a directory of your choice.
<br /><a name="directory_structure"></a>
<br><a name="directory_structure"></a>
<h2>Directory Structure</h2>
<p>
After installing, you should get the following directory structure:
......@@ -52,6 +52,7 @@ After installing, you should get the following directory structure:
<tr>
<th>Directory</th>
<th>Contents</th>
</tr>
<tr>
<td>bin</td>
<td>Executables and JAR files</td>
......
......@@ -11,10 +11,10 @@ H2 Database Engine
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<h1>H2 Database Engine</h1>
<p>
Welcome to H2, the free SQL database engine.
</p>
<p>
<a href="quickstartText.html" style="font-size: 16px; font-weight: bold">Quickstart</a>
<br>
Click here to get a fast overview.
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). -->
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><title>
H2 Database Engine
</title><link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="alternate" type="application/atom+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-atom.xml">
<link rel="alternate" type="application/rss+xml" title="H2 Newsfeed" href="http://www.h2database.com/html/newsfeed-rss.xml">
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="frameMe();">
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<h1>H2 Database Engine</h1>
<p>
Welcome to H2, the free SQL database. The main feature of H2 are:
</p>
<ul>
<li>Very fast, free for everybody, source code is included
<li>Written Java; can be compiled with GCJ (Linux)
<li>Embedded, Server and Cluster modes
<li>JDBC and (partial) ODBC API; Web Client application
</ul>
<table style="border: 0px;">
<tr><td style="background-color: #eee;">
<table style="border: 0px; margin: 5px; background-color: #eee;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3>Download</h3>
Version 1.0 / 2007-01-02:
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-01-02.exe"><img border="1" src="images/download.png" alt="download"></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-01-02.exe">Windows Installer (2.7 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-01-02.zip"><img border="1" src="images/download.png" alt="download"></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-01-02.zip">Platform-Independent Zip (3.6 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<a href="download.html">All Downloads</a>
</td></tr>
</table>
</td><td style="border: 0px;">&nbsp;&nbsp;&nbsp;</td>
<td style="background-color: #eee;">
<table style="border: 0px; margin: 5px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3>Support</h3>
<p>
<a href="http://www.h2database.com/ipowerb" target="_top">Forums: Help and Open Discussion</a><br><br>
Or send an e-mail to: <br>
<script type="text/javascript">
<!--
var a = '-support.png';
var b = 'mail';
var c = 'support ';
var d = 'db';
var e = 'at ';
var f = '.com';
var g = 'h2database';
var alt = 'mail address: ' + d + c + e + g + f + '(without spaces)';
document.write('<' + ' a h'+'ref="em' + 'ail:' + d + c + e + g + f +'">' + d + c + e + g + f);
//-->
</script>
<!--
The forum doesn't work at the moment, sorry. <br>
But you can send an e-mail to: <p>
<script type="text/javascript">
var a = '-support.png';
var b = 'mail';
var c = 'support ';
var d = 'db';
var e = 'at ';
var f = '.com';
var g = 'h2database';
var alt = 'mail address: ' + d + c + e + g + f + '(without spaces)';
document.write('<'+'a h' + 'ref="em' + 'ail:' + d + c + e + g + f +'">' + d + c + e + g + f);
</script>
-->
</p>
</td></tr>
</table>
</td></tr>
<tr><td colspan="3" style="border: 0px">&nbsp;</td></tr>
<tr><td colspan="3" style="border: 0px">
<table style="border: 0px; margin: 5px; width: 100%;">
<tr><td style="border: 0px;" >
<h3>Performance</h3>
<img border="0" src="images/performance.png" alt="Performance comparison"><br>
Operations/second (higher is better) - <a href="performance.html">More information about this test</a>
</td></tr>
</table>
</td></tr>
<tr><td colspan="3" style="border: 0px">&nbsp;</td></tr>
<tr><td colspan="3" style="background-color: #eee;">
<table style="border: 0px; margin: 5px; background-color: #eee;">
<tr><td style="border: 0px; background-color: #eee;">
<h3>News</h3>
<p>
<b>Email Subscription</b>: If you like to get informed by email about new releases, <br>
subscribe here. The email addresses of members are only used in this context.<br>
Usually, only one mail every few weeks will be sent.
</p>
<form name="newsletter" method="post" action="php/newsletter.php">
Email: <input type="email" name="email" size="30" onKeyDown="newsletter.spam.value='false';">
<input type="hidden" name="spam" value="true" size="30">
<input type="hidden" name="text" value="subscribe">
<input type="submit" value="Submit">
<br><br>
<b>Newsfeeds:</b> Two are available:
<a href="http://www.h2database.com/html/newsfeed-atom.xml" target="_blank">Full text (Atom)</a>
and <a href="http://www.h2database.com/html/newsfeed-rss.xml" target="_blank">Header only (RSS)</a>.<br>
If you need a newsreader: <a href="http://rssowl.sf.net">RSSOwl</a>.
</form>
</td></tr>
</table>
</td></tr>
<tr><td colspan="3" style="border: 0px">&nbsp;</td></tr>
<tr><td colspan="3" style="background-color: #eee;">
<table style="border: 0px; margin: 5px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3>Feedback</h3>
You may also send questions, feature requests, or feedback of any kind here:
<form method="post" action="php/sendMail.php">
<p>
Email (optional):<br>
<input name="email" size="73" type="email">
</p><p>
Message:<br>
<textarea name="text" cols="70" rows="5"></textarea>
<br>
<input value="Submit" type="submit">
</p>
</form>
</td></tr>
</table>
</td></tr>
<tr><td colspan="3" style="border: 0px">&nbsp;</td></tr>
<tr><td colspan="3" style="background-color: #eee;">
<table style="border: 0px; margin: 5px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3>Donations</h3>
Click on one of the PayPal buttons below to donate money to H2.
You will be listed as a supporter.
Other ways to contribute to the development of H2 is sending feedback
and bug reports, or translate the H2 Console application
(files h2/src/main/org/h2/server/web/res/_text_*.properties).
</td></tr>
</table>
</td></tr>
</table>
</div></td></tr></table></body></html>
\ No newline at end of file
......@@ -12,13 +12,13 @@ Performance
<h1>Performance</h1>
<a href="#performance_comparison">
Performance Comparison</a><br />
Performance Comparison</a><br>
<a href="#application_profiling">
Application Profiling</a><br />
Application Profiling</a><br>
<a href="#database_performance_tuning">
Performance Tuning</a><br />
Performance Tuning</a><br>
<br /><a name="performance_comparison"></a>
<br><a name="performance_comparison"></a>
<h2>Performance Comparison</h2>
In most cases H2 is a lot faster than all other
......@@ -218,7 +218,7 @@ and for each step a new connection is opened and then closed.
That means the Open/Close time listed is for opening a connection
if the database is already in use.
<br /><a name="application_profiling"></a>
<br><a name="application_profiling"></a>
<h2>Application Profiling</h2>
<h3>Analyze First</h3>
......@@ -232,7 +232,7 @@ A very good tool to measure both the memory and the CPU is the
<a href="http://www.yourkit.com">YourKit Java Profiler</a>. This tool is also used
to optimize the performance and memory footprint of this database engine.
<br /><a name="database_performance_tuning"></a>
<br><a name="database_performance_tuning"></a>
<h2>Database Performance Tuning</h2>
<h3>Virus Scanners</h3>
......@@ -280,11 +280,12 @@ However, this is only possible if no WHERE clause is used, that means it only wo
queries of the form SELECT COUNT(*) FROM table.
<h3>Updating Optimizer Statistics / Column Selectivity</h3>
<p>
When executing a query, at most one index per joined table can be used.
If the same table is joined multiple times, for each join only one index is used.
Example: for the query SELECT * FROM TEST T1, TEST T2 WHERE T1.NAME='A' AND T2.ID=T1.ID,
two index can be used, in this case the index on NAME for T1 and the index on ID for T2.
<p>
</p><p>
If a table has multiple indexes, sometimes more than one index could be used.
Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index on each column,
then two indexes could be used for the query SELECT * FROM TEST WHERE NAME='A' AND FIRSTNAME='B',
......@@ -293,8 +294,9 @@ Which index is used depends on the selectivity of the column. The selectivity de
values in a column. A selectivity of 100 means each value appears only once, and a selectivity of 1 means
the same value appears in many or most rows. For the query above, the index on NAME should be used
if the table contains more distinct names than first names.
<p>
</p><p>
The SQL statement ANALYZE can be used to automatically estimate the selectivity of the columns in the tables.
This command should be run from time to time to improve the query plans generated by the optimizer.
</p>
</div></td></tr></table></body></html>
\ No newline at end of file
......@@ -3,10 +3,10 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Search</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="search.js"></script>
<script type="text/javascript" src="navigation.js"></script>
......@@ -14,7 +14,7 @@ Initial Developer: H2 Group
<body style="margin: 10px 0px 0px 0px;" onload="frameMe('menu');">
<div class="menu">
<img border="0" src="h2-logo.png" alt="H2 Logo" onclick="document.location='main.html'"/>
<img border="0" src="h2-logo.png" alt="H2 Logo" onclick="document.location='main.html'">
</div>
<form name="searchForm" action="submit" onsubmit="return goFirst();">
......@@ -67,4 +67,4 @@ Initial Developer: H2 Group
<br>
</div>
</body>
</body></html>
......@@ -41,7 +41,6 @@ h2 {
h3 {
font-size: 10pt;
margin-bottom: 5px;
}
h4 {
......
......@@ -41,7 +41,6 @@ h2 {
h3 {
font-size: 10pt;
margin-bottom: 5px;
}
h4 {
......
......@@ -12,43 +12,44 @@ Tutorial
<h1>Tutorial</h1>
<a href="#tutorial_starting_h2_console">
Starting and Using the H2 Console</a><br />
Starting and Using the H2 Console</a><br>
<a href="#connecting_using_jdbc">
Connecting to a Database using JDBC</a><br />
Connecting to a Database using JDBC</a><br>
<a href="#creating_new_databases">
Creating New Databases</a><br />
Creating New Databases</a><br>
<a href="#using_server">
Using the Server</a><br />
Using the Server</a><br>
<a href="#using_hibernate">
Using Hibernate</a><br />
Using Hibernate</a><br>
<a href="#web_applications">
Using Databases in Web Applications</a><br />
Using Databases in Web Applications</a><br>
<a href="#csv">
CSV (Comma Separated Values) Support</a><br />
CSV (Comma Separated Values) Support</a><br>
<a href="#upgrade_backup_restore">
Upgrade, Backup, and Restore</a><br />
Upgrade, Backup, and Restore</a><br>
<a href="#openoffice">
Using OpenOffice Base</a><br />
Using OpenOffice Base</a><br>
<br /><a name="tutorial_starting_h2_console"></a>
<br><a name="tutorial_starting_h2_console"></a>
<h2>Starting and Using the H2 Console</h2>
<p>
This application lets you access a SQL database using a browser interface.
This can be a H2 database, or another database that supports the JDBC API.
<br>
</p>
<img src="console.png" alt="Web Browser - H2 Console Server - H2 Database">
<br>
This is a client / server application, so both a server and a client are required to run it.
<p>
This is a client / server application, so both a server and a client are required to run it.
</p><p>
Depending on your platform and environment, there are multiple ways to start the application:
<table><tr><th>OS</th><th>Java</th><th>Start</th>
</p>
<table><tr><th>OS</th><th>Java</th><th>Start</th></tr>
<tr>
<td>Windows</td>
<td>1.4 or 1.5</td>
<td>
Click [Start], [All Programs], [H2], and [H2 Console]<br>
If this worked correctly, an icon will be added to the system tray:
<img src="h2.png" alt="[H2 icon]"/><br>
<img src="h2.png" alt="[H2 icon]"><br>
If you don't get the system tray icon, then maybe Java is not installed correctly (in this case, try another way to start the application).
A browser window should open
and point to the Login page (URL: <a href="http://localhost:8082" target="_blank">http://localhost:8082</a>).
......@@ -78,15 +79,17 @@ java -cp h2.jar org.h2.tools.Server
</table>
<h3>Firewall</h3>
<p>
If you start the server, you may get a security warning from the firewall (if you have installed one).
If you don't want other computers in the network to access the database on your machine, you can
let the firewall block those connections. The connection from the local machine will still work.
Only if you want other computers to access the database on this computer, you need allow remote connections
in the firewall.
<p>
</p><p>
Please not that a small firewall is already built into the server. This mechanism by default does not
allow other computer to connect to the server. This can be changed in the Preferences
(Allow connections from other computers).
</p>
<h3>Native Version</h3>
The native version does not require Java, because it is compiled using GCJ.
......@@ -139,26 +142,31 @@ For Windows installations, this file will be in the directory <code>C:\Documents
This file contains the settings of the application.
<h3>Login</h3>
<p>
At the login page, you need to provide connection information to connect to a database.
Set the JDBC driver class of your database, the JDBC URL, user name and password.
If you are done, click [Connect].
<p>
</p><p>
You can save and reuse previously saved settings. The settings are stored in the
Application Properties file.
</p>
<h3>Error Messages</h3>
Error messages in are shown in red. You can show/hide the stack trace of the exception
by clicking on the message.
<h3>Adding Database Drivers</h3>
<p>
Additional database drivers can be registered by adding the Jar file location of the driver to the environment
variables H2DRIVERS or CLASSPATH. Example (Windows): To add the database driver library
C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to
C:\Programs\hsqldb\lib\hsqldb.jar.<p>
C:\Programs\hsqldb\lib\hsqldb.jar.
</p><p>
Multiple drivers can be set; each entry needs to be separated with a ';' (Windows) or ':' (other operating systems).
Spaces in the path names are supported. The settings must not be quoted.
<p>
</p><p>
Only the Java version supports additional drivers (this feature is not supported by the Native version).
</p>
<h3>Using the Application</h3>
The application has three main panels, the toolbar on top, the tree on the left and the query / result panel on the right.
......@@ -172,14 +180,17 @@ While typing a query, the table that was used is automatically expanded in the t
For, example if you type 'SELECT * FROM TEST T WHERE T.' then the table TEST is automatically expanded in the tree.
<h3>Disconnecting and Stopping the Application</h3>
<p>
On the browser, click 'Disconnect' on the toolbar panel. You will be logged out of the database.
However, the server is still running and ready to accept new sessions.<p>
However, the server is still running and ready to accept new sessions.
</p><p>
To stop the server, right click on the system tray icon and select [Exit].
If you don't have the icon (because you started it in another way),
press [Ctrl]+[C] on the console where the server was started (Windows),
or close the console window.
</p>
<br /><a name="connecting_using_jdbc"></a>
<br><a name="connecting_using_jdbc"></a>
<h2>Connecting to a Database using JDBC</h2>
To connect to a database, a Java application first needs to load the database driver,
and then get a connection. A simple way to do that is using the following code:
......@@ -203,12 +214,12 @@ to be recognized by this database. The second parameter in the <code>getConnecti
is the user name ('sa' for System Administrator in this example). The third parameter is the password.
Please note that in this database, user names are not case sensitive, but passwords are case sensitive.
<br /><a name="creating_new_databases"></a>
<br><a name="creating_new_databases"></a>
<h2>Creating New Databases</h2>
By default, if the database specified in the URL does not yet exist, a new (empty)
database is created automatically.
<br /><a name="using_server"></a>
<br><a name="using_server"></a>
<h2>Using the Server</h2>
H2 currently supports three servers: a Web Server, a TCP Server and an ODBC Server.
The servers can be started in different ways.
......@@ -267,14 +278,14 @@ This function should be called after all connection to the databases are closed
to avoid recovery when the databases are opened the next time.
To stop remote server, remote connections must be enabled on the server.
<br /><a name="using_hibernate"></a>
<br><a name="using_hibernate"></a>
<h2>Using Hibernate</h2>
This database supports Hibernate version 3.1 and newer. You can use the HSQLDB Dialect,
or the native H2 Dialect that is available in the file src/tools/org/h2/tools/hibernate/H2Dialect.txt.
This dialect will be integrated into Hibernate, but until this is done you need to copy the file
into the folder src\org\hibernate\dialect (Hibernate 3.1), rename it to H2Dialect.java and re-compile hibernate.
<br /><a name="web_applications"></a>
<br><a name="web_applications"></a>
<h2>Using Databases in Web Applications</h2>
There are multiple ways to access a database from within web
applications. Here are some examples if you use Tomcat or JBoss.
......@@ -345,7 +356,7 @@ public class DbStarter implements ServletContextListener {
}
</pre>
<br /><a name="csv"></a>
<br><a name="csv"></a>
<h2>CSV (Comma Separated Values) Support</h2>
The CSV file support can be used inside the database using the functions CSVREAD and CSVWRITE,
and the CSV library can be used outside the database as a standalone tool.
......@@ -393,7 +404,7 @@ while(rs.next()) {
rs.close();
</pre>
<br /><a name="upgrade_backup_restore"></a>
<br><a name="upgrade_backup_restore"></a>
<h2>Upgrade, Backup, and Restore</h2>
<h3>Database Upgrade</h3>
......@@ -427,7 +438,7 @@ SQL script files may contain references to other script files, in the form of
RUNSCRIPT commands. However, when using the server mode, the references script files
need to be available on the server side.
<br /><a name="openoffice"></a>
<br><a name="openoffice"></a>
<h2>Using OpenOffice Base</h2>
OpenOffice.org Base supports database access over the JDBC API. To connect to a H2 database
using OpenOffice Base, you first need to add the JDBC driver to OpenOffice.
......
......@@ -2,7 +2,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>H2 Database Engine</title>
<link rel="stylesheet" type="text/css" href="html/stylesheet.css">
......@@ -15,6 +15,7 @@ Initial Developer: H2 Group
<h1>H2 Database Engine</h1>
<p>
Welcome to H2, the free SQL database. The main feature of H2 are:
</p>
<ul>
<li>It is free to use for everybody, source code is included
<li>Written in Java, but also available as native executable
......@@ -23,15 +24,15 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<li>Clustering is supported
<li>A web client is included
</ul>
</p>
<h2>No Javascript</h2>
<p>
If you are not automatically redirected to the main page, then
Javascript is currently disabled or your browser does not support Javascript.
Some features (for example the integrated search) require Javascript.
<p>
</p><p>
Please enable Javascript, or go ahead without it:
<p>
<a href="html/frame.html" style="font-size: 16px; font-weight: bold">H2 Database Engine</a>
</p>
</body>
</body></html>
......@@ -5,9 +5,9 @@ Initial Developer: H2 Group
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>H2 Documentation</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
......@@ -36,7 +36,7 @@ Initial Developer: H2 Group
<a href="org/h2/jdbc/JdbcStatement.html" target="javadoc">Statement</a><br>
<br>
<b>Tools</b></br>
<b>Tools</b><br>
Package org.h2.tools<br>
<a href="org/h2/tools/Backup.html" target="javadoc">Backup</a><br>
<a href="org/h2/tools/ChangePassword.html" target="javadoc">ChangePassword</a><br>
......@@ -53,7 +53,7 @@ Package org.h2.tools<br>
<a href="org/h2/tools/SimpleRowSource.html" target="javadoc">SimpleRowSource</a><br>
<br>
<b>Interfaces</b></br>
<b>Interfaces</b><br>
Package org.h2.api<br>
<a href="org/h2/api/DatabaseEventListener.html" target="javadoc">DatabaseEventListener</a><br>
<a href="org/h2/api/Trigger.html" target="javadoc">Trigger</a><br>
......@@ -62,4 +62,4 @@ Package org.h2.api<br>
</div>
</div></td></tr></table>
</body>
</body></html>
......@@ -5,9 +5,9 @@ Initial Developer: H2 Group
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>API Overview</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<table style="width: 100%; height: 100%; border: 0px;">
......
......@@ -32,7 +32,6 @@ h2 {
h3 {
font-size: 11pt;
margin-bottom: 5px;
}
h4 {
......
......@@ -564,10 +564,10 @@ public class AppThread extends WebServerThread {
int level = Integer.parseInt(s);
conn.setTransactionIsolation(level);
}
result = "Transaction Isolation: " + conn.getTransactionIsolation() + "<br />";
result += Connection.TRANSACTION_READ_UNCOMMITTED + ": READ_UNCOMMITTED<br />";
result += Connection.TRANSACTION_READ_COMMITTED + ": READ_COMMITTED<br />";
result += Connection.TRANSACTION_REPEATABLE_READ + ": REPEATABLE_READ<br />";
result = "Transaction Isolation: " + conn.getTransactionIsolation() + "<br>";
result += Connection.TRANSACTION_READ_UNCOMMITTED + ": READ_UNCOMMITTED<br>";
result += Connection.TRANSACTION_READ_COMMITTED + ": READ_COMMITTED<br>";
result += Connection.TRANSACTION_REPEATABLE_READ + ": REPEATABLE_READ<br>";
result += Connection.TRANSACTION_SERIALIZABLE + ": SERIALIZABLE";
} else if(sql.startsWith("@SET MAXROWS ")) {
int maxrows = Integer.parseInt(sql.substring("@SET MAXROWS ".length()));
......@@ -588,10 +588,10 @@ public class AppThread extends WebServerThread {
String s = (String) list.get(i);
if(!s.startsWith("@")) {
buff.append(PageParser.escapeHtml(s+";"));
buff.append("<br />");
buff.append("<br>");
}
buff.append(getResult(conn, i+1, s, list.size()==1));
buff.append("<br />");
buff.append("<br>");
}
result = buff.toString();
}
......
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -30,41 +30,41 @@ Initial Developer: H2 Group
${text.adminAllow}
</h3>
<p>
<c:if test="allowOthers=='false'">
<input type="radio" name="allowOthers" value="false" checked="checked">
</c:if>
<c:if test="allowOthers=='true'">
<input type="radio" name="allowOthers" value="false">
</c:if>
${text.adminLocal}<br>
<c:if test="allowOthers=='true'">
<input type="radio" name="allowOthers" value="true" checked="checked">
</c:if>
<c:if test="allowOthers=='false'">
<input type="radio" name="allowOthers" value="true">
</c:if>
<c:if test="allowOthers=='false'">
<input type="radio" name="allowOthers" value="false" checked="checked">
</c:if>
<c:if test="allowOthers=='true'">
<input type="radio" name="allowOthers" value="false">
</c:if>
${text.adminLocal}<br>
<c:if test="allowOthers=='true'">
<input type="radio" name="allowOthers" value="true" checked="checked">
</c:if>
<c:if test="allowOthers=='false'">
<input type="radio" name="allowOthers" value="true">
</c:if>
${text.adminOthers}<br>
</p>
<h3>
${text.adminConnection}
</h3>
<p>
<c:if test="ssl=='false'">
<input type="radio" name="ssl" value="false" checked="checked">
</c:if>
<c:if test="ssl=='true'">
<input type="radio" name="ssl" value="false">
</c:if>
${text.adminHttp}<br>
<c:if test="ssl=='false'">
<input type="radio" name="ssl" value="false" checked="checked">
</c:if>
<c:if test="ssl=='true'">
<input type="radio" name="ssl" value="false">
</c:if>
${text.adminHttp}<br>
<c:if test="ssl=='true'">
<input type="radio" name="ssl" value="true" checked="checked">
</c:if>
<c:if test="ssl=='false'">
<input type="radio" name="ssl" value="true">
</c:if>
${text.adminHttps}<br>
<c:if test="ssl=='true'">
<input type="radio" name="ssl" value="true" checked="checked">
</c:if>
<c:if test="ssl=='false'">
<input type="radio" name="ssl" value="true">
</c:if>
${text.adminHttps}<br>
</p>
<h3>
Port number
......@@ -120,4 +120,4 @@ Initial Developer: H2 Group
</p>
</form>
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -49,4 +49,4 @@ Initial Developer: H2 Group
//-->
</script>
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -12,4 +12,4 @@ Initial Developer: H2 Group
<p class="error">
${error}
</p>
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -16,15 +16,15 @@ Initial Developer: H2 Group
><img src="icon_disconnect.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.disconnect}" title="${text.toolbar.disconnect}" border="1"/></a
class="icon" alt="${text.toolbar.disconnect}" title="${text.toolbar.disconnect}" border="1"></a
><img src="icon_line.gif" class="iconLine" alt=""
/><a href="tables.do?jsessionid=${sessionId}" target="h2menu"
><a href="tables.do?jsessionid=${sessionId}" target="h2menu"
><img src="icon_refresh.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.refresh}" title="${text.toolbar.refresh}" border="1"/></a
class="icon" alt="${text.toolbar.refresh}" title="${text.toolbar.refresh}" border="1"></a
><img src="icon_line.gif" class="iconLine" alt=""
/></td><td class="toolbar"><input type="checkbox" name="autocommit" value="autocommit"
></td><td class="toolbar"><input type="checkbox" name="autocommit" value="autocommit"
onclick="javascript:if(document.header.autocommit.checked)
top.frames['h2result'].document.location='query.do?jsessionid=${sessionId}&amp;sql=@AUTOCOMMIT+TRUE';
else
......@@ -35,40 +35,40 @@ Initial Developer: H2 Group
><img src="icon_rollback.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.rollback}" title="${text.toolbar.rollback}" border="1"/></a
class="icon" alt="${text.toolbar.rollback}" title="${text.toolbar.rollback}" border="1"></a
><a href="query.do?jsessionid=${sessionId}&amp;sql=COMMIT" target="h2result"
><img src="icon_commit.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.commit}" title="${text.toolbar.commit}" border="1"/></a
class="icon" alt="${text.toolbar.commit}" title="${text.toolbar.commit}" border="1"></a
><img src="icon_line.gif" class="iconLine" alt=""
/></td><td class="toolbar">&nbsp;${text.toolbar.maxRows}:&nbsp;</td><td class="toolbar"
></td><td class="toolbar">&nbsp;${text.toolbar.maxRows}:&nbsp;</td><td class="toolbar"
><select name="rowcount" size="1"
onchange="javascript:top.frames['h2result'].document.location='query.do?jsessionid=${sessionId}&amp;sql=@SET+MAXROWS+'+header.rowcount.value;"
><option value="0">${text.toolbar.all}</option>
<option value="10000">10000</option>
<option selected="selected" value="1000">1000</option>
<option value="100">100</option>
<option value="10">10</option>
<option value="10000">10000</option>
<option selected="selected" value="1000">1000</option>
<option value="100">100</option>
<option value="10">10</option>
</select
>&nbsp;</td><td class="toolbar"><a href="javascript:top.frames['h2query'].document.forms['h2query'].submit();"
><img src="icon_run.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.run}" title="${text.toolbar.run}" border="1"/></a
class="icon" alt="${text.toolbar.run}" title="${text.toolbar.run}" border="1"></a
></td><td class="toolbar"><a href="query.do?jsessionid=${sessionId}&amp;sql=@CANCEL" target="h2result"
><img src="icon_stop.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.cancelStatement}" title="${text.toolbar.cancelStatement}" border="1"/></a
class="icon" alt="${text.toolbar.cancelStatement}" title="${text.toolbar.cancelStatement}" border="1"></a
><img src="icon_line.gif" class="iconLine" alt=""
/><a href="query.do?jsessionid=${sessionId}&amp;sql=@HISTORY" target="h2result"
><a href="query.do?jsessionid=${sessionId}&amp;sql=@HISTORY" target="h2result"
><img src="icon_history.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.toolbar.history}" title="${text.toolbar.history}" border="1"/></a
class="icon" alt="${text.toolbar.history}" title="${text.toolbar.history}" border="1"></a
><img src="icon_line.gif" class="iconLine" alt=""
/></td><td class="toolbar">${text.toolbar.autocomplete}&nbsp;<select name="autocomplete" size="1"
></td><td class="toolbar">${text.toolbar.autocomplete}&nbsp;<select name="autocomplete" size="1"
onchange="javascript:top.frames['h2query'].setAutocomplete(this.value)"
><option value="0">${text.toolbar.autocomplete.off}</option>
<option selected="selected" value="1">${text.toolbar.autocomplete.normal}</option>
......@@ -80,12 +80,12 @@ Initial Developer: H2 Group
><img src="icon_help.gif"
onmouseover = "this.className ='icon_hover'"
onmouseout = "this.className ='icon'"
class="icon" alt="${text.a.help}" title="${text.a.help}" border="1"/></a
class="icon" alt="${text.a.help}" title="${text.a.help}" border="1"></a
></td></tr></table>
</form>
<script type="text/javascript">
<!--
document.header.autocommit.checked = '${autocommit}' != '';
document.header.autocommit.checked = '${autocommit}' != '';
//-->
</script>
</body>
......
......@@ -72,9 +72,11 @@ function set(s) {
</td></tr>
</table>
<h3>${text.helpAddDrivers}</h3>
${text.helpAddDriversText}
<p>
${text.helpAddDriversText}
</p><p>
${text.helpAddDriversOnlyJava}
</p>
</div>
......
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -20,4 +20,4 @@ Javascript is currently disabled or your browser does not support Javascript.
For this application to work, Javascript is essential.
Please enable Javascript now, or use another web browser that supports it.
</body>
</body></html>
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.login.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -83,4 +83,4 @@ Initial Developer: H2 Group
<br>
<p class="error">${error}</p>
</form>
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
......@@ -26,4 +26,4 @@ Initial Developer: H2 Group
<h2><a href="admin.jsp">Preferences</a></h2>
Allows to you to view and change server settings.
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -3,7 +3,7 @@
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<head>
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
</head>
......@@ -12,4 +12,4 @@ Initial Developer: H2 Group
<p>
${text.a.remoteConnectionsDisabled}
</p>
</body>
\ No newline at end of file
</body></html>
\ No newline at end of file
......@@ -5,9 +5,9 @@ Initial Developer: H2 Group
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type="text/javascript">
//<!--
......
......@@ -48,7 +48,7 @@ public class Newsfeed {
s = StringUtils.replaceAll(s, "<a href=\"", "( ");
s = StringUtils.replaceAll(s, "\">", " ) ");
s = StringUtils.replaceAll(s, "</a>", "");
s = StringUtils.replaceAll(s, "<br/>", "");
s = StringUtils.replaceAll(s, "<br>", "");
if(s.indexOf('<') >= 0 || s.indexOf('>') >= 0) {
throw new Error("Unsupported HTML Tag: < or > in " + s);
}
......
......@@ -16,38 +16,38 @@ INSERT INTO ITEM VALUES(19,
<br/>
<b>Changes and new functionality:</b>
<ul>
<li>H2 is now available in Maven. The groupId is com.h2database, the
artifactId is h2 and the version 1.0.20061217 (the new version will be
available in a few days). To create the maven artifacts yourself, use
''ant mavenUploadLocal'' and ''ant mavenBuildCentral''.
<li>H2 is now available in Maven. The groupId is com.h2database, the
artifactId is h2 and the version 1.0.20061217 (the new version will be
available in a few days). To create the maven artifacts yourself, use
''ant mavenUploadLocal'' and ''ant mavenBuildCentral''.
<li>Many settings are now initialized from system properties and can be
changed on the command line without having recompile the database.
See Advances / Settings Read from System Properties.
changed on the command line without having recompile the database.
See Advances / Settings Read from System Properties.
<li>The (relative or absolute) directory where the script files are stored
or read can now be changed using the system property h2.scriptDirectory
or read can now be changed using the system property h2.scriptDirectory
<li>Client trace files now created in the directory ''trace.db'' and no
longer the application directory. This can be changed using the system
property h2.clientTraceDirectory.
longer the application directory. This can be changed using the system
property h2.clientTraceDirectory.
<li>Build: Now using ant-build.properties. The JDK is automatically updated
when using ant codeswitch_...
when using ant codeswitch_...
<li>Cluster: Now the server can detect if a query is read-only, and in this
case the result is only read from the first cluster node. However, there
is currently no load balancing made to avoid problems with transactions
/ locking.
case the result is only read from the first cluster node. However, there
is currently no load balancing made to avoid problems with transactions
/ locking.
</ul>
<b>Bugfixes:</b>
<ul>
<li>If a CLOB or BLOB was deleted in a transaction and the database crashed
before the transaction was committed or rolled back, the object was lost if
it was large. Fixed.
before the transaction was committed or rolled back, the object was lost if
it was large. Fixed.
<li>Prepared statements with non-constant functions such as
CURRENT_TIMESTAMP() did not get re-evaluated if the result of the
function changed. Fixed.
CURRENT_TIMESTAMP() did not get re-evaluated if the result of the
function changed. Fixed.
<li>In some situations the log file got corrupt if the process was terminated
while the database was opening.
while the database was opening.
<li>Using ;RECOVER=1 in the database URL threw a syntax exception. Fixed.
<li>It was possible to drop the sequence of a temporary tables with DROP
ALL OBJECTS, resulting in a null pointer exception afterwards.
ALL OBJECTS, resulting in a null pointer exception afterwards.
</ul>
For future plans, see the new ''Roadmap'' page on the web site.
</ul>
......
......@@ -93,7 +93,7 @@ public class GenerateDoc {
String topic = rs.getString("TOPIC");
String syntax = rs.getString("SYNTAX");
syntax = bnf.getSyntax(topic, syntax);
map.put("syntax", syntax);
map.put("syntax", PageParser.escapeHtml(syntax));
list.add(map);
}
session.put(key, list);
......
......@@ -85,7 +85,7 @@ public class LinkChecker {
}
void process(String path) throws Exception {
if(path.endsWith("/CVS")) {
if(path.endsWith("/CVS") || path.endsWith("/.svn")) {
return;
}
File file = new File(path);
......
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.tools.doc;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.util.Stack;
public class XMLChecker {
public static void main(String[] args) throws Exception {
new XMLChecker().run(args);
}
private void run(String[] args) throws Exception {
String dir = ".";
for(int i=0; i<args.length; i++) {
if("-dir".equals(args[i])) {
dir = args[++i];
}
}
process(dir+"/src");
process(dir+"/docs");
}
void process(String path) throws Exception {
if(path.endsWith("/CVS") || path.endsWith("/.svn")) {
return;
}
File file = new File(path);
if(file.isDirectory()) {
String[] list = file.list();
for(int i=0; i<list.length; i++) {
process(path + "/" + list[i]);
}
} else {
processFile(path);
}
}
void processFile(String fileName) throws Exception {
int idx = fileName.lastIndexOf('.');
if(idx < 0) {
return;
}
String suffix = fileName.substring(idx + 1);
if(!suffix.equals("html") && !suffix.equals("xml") && !suffix.equals("jsp")) {
return;
}
System.out.println("Checking file:" + fileName);
FileReader reader = new FileReader(fileName);
String s = readStringAndClose(reader, -1);
Exception last = null;
try {
checkXML(s, !suffix.equals("xml"));
} catch(Exception e) {
last = e;
System.out.println("ERROR: " + e.toString());
}
if(last != null) {
last.printStackTrace();
}
}
public static String readStringAndClose(Reader in, int length) throws IOException {
if(length <= 0) {
length = Integer.MAX_VALUE;
}
int block = Math.min(4096, length);
StringWriter out=new StringWriter(length == Integer.MAX_VALUE ? block : length);
char[] buff=new char[block];
while(length > 0) {
int len = Math.min(block, length);
len = in.read(buff, 0, len);
if(len < 0) {
break;
}
out.write(buff, 0, len);
length -= len;
}
in.close();
return out.toString();
}
private static void checkXML(String xml, boolean html) throws Exception {
String lastElement = null;
String[] noclose = new String[]{
"li", "link", "meta", "br", "img", "input", "hr", "frame"
};
XMLParser parser = new XMLParser(xml);
Stack stack = new Stack();
boolean rootElement = false;
while(true) {
int event = parser.next();
if(event == XMLParser.END_DOCUMENT) {
break;
} else if(event == XMLParser.START_ELEMENT) {
if(stack.size() == 0) {
if(rootElement) {
throw new Exception("Second root element at " + parser.getRemaining());
}
rootElement = true;
}
String name = parser.getName();
if(html && name.equals("table") && lastElement.trim().length() > 0) {
throw new Exception("Test before table: " + lastElement);
}
for(int i=0; html && i<noclose.length; i++) {
if(name.equals(noclose[i])) {
name = null;
break;
}
}
if(name != null) {
stack.add(name);
}
} else if(event == XMLParser.END_ELEMENT) {
String name = parser.getName();
for(int i=0; html && i<noclose.length; i++) {
if(name.equals(noclose[i])) {
throw new Exception("Unnecessary closing element " + name + " at " + parser.getRemaining());
}
}
while(true) {
String pop = (String) stack.pop();
if(pop.equals(name)) {
break;
}
throw new Exception("Unclosed element " + pop + " at " + parser.getRemaining());
}
} else if(event == XMLParser.CHARACTERS) {
lastElement = parser.getText();
} else if(event == XMLParser.DTD) {
} else if(event == XMLParser.COMMENT) {
} else {
int eventType = parser.getEventType();
throw new Exception("Unexpected event " + eventType + " at " + parser.getRemaining());
}
}
if(stack.size() != 0) {
throw new Exception("Unclosed root element");
}
}
}
差异被折叠。
......@@ -61,7 +61,7 @@ public class Doclet {
writer.println("<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">");
writer.println("<h1>"+className+"</h1>");
writer.println(clazz.commentText()+"<br /><br />");
writer.println(clazz.commentText()+"<br><br>");
MethodDoc[] methods = clazz.methods();
Arrays.sort(methods, new Comparator() {
......@@ -117,7 +117,7 @@ public class Doclet {
continue;
}
if(fieldId==0) {
writer.println("<br /><table><tr><th colspan=\"2\">Fields</th></tr>");
writer.println("<br><table><tr><th colspan=\"2\">Fields</th></tr>");
}
String name = field.name();
String type = getTypeName(true, field.type());
......@@ -174,7 +174,7 @@ public class Doclet {
boolean space = false;
for(int j=0; j<paramTags.length; j++) {
if(!space) {
writer.println("<br /><br >");
writer.println("<br><br >");
space = true;
}
String p = paramTags[j].parameterName() + " - " + paramTags[j].parameterComment();
......@@ -186,7 +186,7 @@ public class Doclet {
Tag[] returnTags = method.tags("return");
if(returnTags != null && returnTags.length>0) {
if(!space) {
writer.println("<br /><br >");
writer.println("<br><br >");
space = true;
}
writer.println("<div class=\"itemTitle\">Returns:</div>");
......@@ -195,7 +195,7 @@ public class Doclet {
ThrowsTag[] throwsTags = method.throwsTags();
if(throwsTags != null && throwsTags.length > 0) {
if(!space) {
writer.println("<br /><br >");
writer.println("<br><br >");
space = true;
}
writer.println("<div class=\"itemTitle\">Throws:</div>");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论