提交 7f003899 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 886d1c5c
...@@ -243,6 +243,7 @@ ...@@ -243,6 +243,7 @@
</target> </target>
<target name="javadoc"> <target name="javadoc">
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/main" destdir="bin" debug="true" includes="org/h2/util/StringUtils.java"/>
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/test" destdir="bin" debug="true" includes="org/h2/test/bnf/*.java"/> <javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/test" destdir="bin" debug="true" includes="org/h2/test/bnf/*.java"/>
<javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/tools" destdir="bin" debug="true" includes="org/h2/tools/doclet/*.java"/> <javac target="${jdk}" source="${jdk}" executable="${javac}" srcdir="src/tools" destdir="bin" debug="true" includes="org/h2/tools/doclet/*.java"/>
<mkdir dir="docs/javadoc"/> <mkdir dir="docs/javadoc"/>
......
...@@ -50,6 +50,8 @@ Advanced Topics ...@@ -50,6 +50,8 @@ Advanced Topics
Universally Unique Identifiers (UUID)</a><br /> Universally Unique Identifiers (UUID)</a><br />
<a href="#system_properties"> <a href="#system_properties">
Settings Read from System Properties</a><br /> Settings Read from System Properties</a><br />
<a href="#server_bind_address">
Setting the Server Bind Address</a><br />
<a href="#glossary_links"> <a href="#glossary_links">
Glossary and Links</a><br /> Glossary and Links</a><br />
...@@ -927,39 +929,22 @@ Example: ...@@ -927,39 +929,22 @@ Example:
java -Dh2.serverCachedObjects=256 org.h2.tools.Server java -Dh2.serverCachedObjects=256 org.h2.tools.Server
</pre> </pre>
The current value of the settings can be read in the table The current value of the settings can be read in the table
INFORMATION_SCHEMA.SETTINGS INFORMATION_SCHEMA.SETTINGS.
</p> </p>
<table><tr> <p>
<th>Setting</th> For a complete list of settings, see
<th>Default</th> <a href="../javadoc/org/h2/constant/SysProperties.html">SysProperties</a>.
<th>Description</th></tr> </p>
<tr><td>h2.allowedClasses</td><td>*</td><td>Comma separated list of class names or prefixes</td></tr>
<tr><td>h2.check</td><td>true</td><td>Assertions in the database engine</td></tr> <br /><a name="server_bind_address"></a>
<tr><td>h2.check2</td><td>false</td><td>Additional assertions</td></tr> <h2>Setting the Server Bind Address</h2>
<tr><td>h2.clientTraceDirectory</td><td>trace.db/</td><td>Directory where the trace files of the JDBC client are stored (only for client / server)</td></tr> <p>
<tr><td>h2.emergencySpaceInitial</td><td>1048576</td><td>Size of 'reserve' file to detect disk full problems early</td></tr> Usually server sockets accept connections on any/all local addresses.
<tr><td>h2.emergencySpaceMin</td><td>131072</td><td>Minimum size of 'reserve' file</td></tr> This may be a problem on multi-homed hosts.
<tr><td>h2.lobCloseBetweenReads</td><td>false</td><td>Close LOB files between read operations</td></tr> To bind only to one address, use the system property h2.bindAddress.
<tr><td>h2.lobFilesInDirectories</td><td>false</td><td>Store LOB files in subdirectories</td></tr> This setting is used for both regular server sockets and for SSL server sockets.
<tr><td>h2.lobFilesPerDirectory</td><td>256</td><td>Maximum number of LOB files per directory</td></tr> IPv4 and IPv6 address formats are supported.
<tr><td>h2.logAllErrors</td><td>false</td><td>Write stack traces of any kind of error to a file</td></tr> </p>
<tr><td>h2.logAllErrorsFile</td><td>h2errors.txt</td><td>File name to log errors</td></tr>
<tr><td>h2.maxFileRetry</td><td>16</td><td>Number of times to retry file delete and rename</td></tr>
<tr><td>h2.objectCache</td><td>true</td><td>Cache commonly used objects (integers, strings)</td></tr>
<tr><td>h2.objectCacheMaxPerElementSize</td><td>4096</td><td>Maximum size of an object in the cache</td></tr>
<tr><td>h2.objectCacheSize</td><td>1024</td><td>Size of object cache</td></tr>
<tr><td>h2.optimizeEvaluatableSubqueries</td><td>true</td><td>Optimize subqueries that are not dependent on the outer query</td></tr>
<tr><td>h2.optimizeIn</td><td>true</td><td>Optimize IN(...) comparisons</td></tr>
<tr><td>h2.optimizeMinMax</td><td>true</td><td>Optimize MIN and MAX aggregate functions</td></tr>
<tr><td>h2.optimizeSubqueryCache</td><td>true</td><td>Cache subquery results</td></tr>
<tr><td>h2.overflowExceptions</td><td>true</td><td>Throw an exception on integer overflows</td></tr>
<tr><td>h2.recompileAlways</td><td>false</td><td>Always recompile prepared statements</td></tr>
<tr><td>h2.redoBufferSize</td><td>262144</td><td>Size of the redo buffer (used at startup when recovering)</td></tr>
<tr><td>h2.runFinalize</td><td>true</td><td>Run finalizers to detect unclosed connections</td></tr>
<tr><td>h2.scriptDirectory</td><td></td><td>Relative or absolute directory where the script files are stored to or read from</td></tr>
<tr><td>h2.serverCachedObjects</td><td>64</td><td>TCP Server: number of cached objects per session</td></tr>
<tr><td>h2.serverResultSetFetchSize</td><td>100</td><td>The default result set fetch size when using the server mode</td></tr>
</table>
<br /><a name="glossary_links"></a> <br /><a name="glossary_links"></a>
<h2>Glossary and Links</h2> <h2>Glossary and Links</h2>
......
...@@ -71,8 +71,6 @@ Features ...@@ -71,8 +71,6 @@ Features
Compacting a Database</a><br /> Compacting a Database</a><br />
<a href="#cache_settings"> <a href="#cache_settings">
Cache Settings</a><br /> Cache Settings</a><br />
<a href="#why_java">
Why Java</a><br />
<br /><a name="feature_list"></a> <br /><a name="feature_list"></a>
<h2>Feature List</h2> <h2>Feature List</h2>
...@@ -880,10 +878,6 @@ Here is the list of currently supported modes and the difference to the regular ...@@ -880,10 +878,6 @@ Here is the list of currently supported modes and the difference to the regular
Usually, the scale is converted and 0s are added if required. Usually, the scale is converted and 0s are added if required.
</td></tr> </td></tr>
</table> </table>
<p>
</p>
<br /><a name="trace_options"></a> <br /><a name="trace_options"></a>
<h2>Using the Trace Options</h2> <h2>Using the Trace Options</h2>
...@@ -1346,39 +1340,4 @@ call SELECT * FROM INFORMATION_SCHEMA.SETTINGS. The number of pages read / writt ...@@ -1346,39 +1340,4 @@ call SELECT * FROM INFORMATION_SCHEMA.SETTINGS. The number of pages read / writt
is listed for the data and index file. is listed for the data and index file.
</p> </p>
<br /><a name="why_java"></a>
<h2>Why Java</h2>
<p>
A few reasons using a Java database are:
</p>
<ul>
<li>Very simple to integrate in Java applications
</li><li>Support for many different platforms
</li><li>More secure than native applications (no buffer overflows)
</li><li>User defined functions (or triggers) run very fast
</li><li>Unicode support
</li></ul>
<p>
Some people think that Java is still too slow for low level operations,
but this is not the case (not any more). In general, the code can be written a lot faster
than using C or C++. Like that, it is possible to concentrate on improving the algorithms
(that make the application faster) rather than porting the code and dealing with low
level stuff (such as memory management or dealing with threads).
Garbage collection is now probably faster than manual memory management.
</p><p>
A lot of features are already built in (for example Unicode, network libraries).
It is very easy to write secure code because buffer overflows and such
problems can be detected very easily. Some features such as the reflection
mechanism can be used for randomized testing.
</p><p>
Java is also future proof: A lot of companies support Java,
and it is now open source.
</p><p>
This software does not rely on many Java libraries or other software, to
increase the portability and ease of use, and for performance reasons. For example,
the encryption algorithms and many library functions are implemented in the database
instead of using the existing libraries. Libraries that are not available in open source
Java implementations (such as Swing) are not used or only used for specific features.
</p>
</div></td></tr></table></body></html> </div></td></tr></table></body></html>
...@@ -14,6 +14,8 @@ History ...@@ -14,6 +14,8 @@ History
<h1>History and Roadmap</h1> <h1>History and Roadmap</h1>
<a href="#history"> <a href="#history">
History of this Database Engine</a><br /> History of this Database Engine</a><br />
<a href="#why_java">
Why Java</a><br />
<a href="#changelog"> <a href="#changelog">
Change Log</a><br /> Change Log</a><br />
<a href="#roadmap"> <a href="#roadmap">
...@@ -34,6 +36,40 @@ The name H2 stands for Hypersonic 2; however H2 does not share any code with ...@@ -34,6 +36,40 @@ The name H2 stands for Hypersonic 2; however H2 does not share any code with
Hypersonic SQL or HSQLDB. H2 is built from scratch. Hypersonic SQL or HSQLDB. H2 is built from scratch.
</p> </p>
<br /><a name="why_java"></a>
<h2>Why Java</h2>
<p>
A few reasons using a Java database are:
</p>
<ul>
<li>Very simple to integrate in Java applications
</li><li>Support for many different platforms
</li><li>More secure than native applications (no buffer overflows)
</li><li>User defined functions (or triggers) run very fast
</li><li>Unicode support
</li></ul>
<p>
Some people think that Java is still too slow for low level operations,
but this is not the case (not any more). In general, the code can be written a lot faster
than using C or C++. Like that, it is possible to concentrate on improving the algorithms
(that make the application faster) rather than porting the code and dealing with low
level stuff (such as memory management or dealing with threads).
Garbage collection is now probably faster than manual memory management.
</p><p>
A lot of features are already built in (for example Unicode, network libraries).
It is very easy to write secure code because buffer overflows can not occur.
Some features such as the reflection mechanism can be used for randomized testing.
</p><p>
Java is also future proof: A lot of companies support Java,
and it is now open source.
</p><p>
This software does not rely on many Java libraries or other software, to
increase the portability and ease of use, and for performance reasons. For example,
the encryption algorithms and many library functions are implemented in the database
instead of using the existing libraries. Libraries that are not available in open source
Java implementations (such as Swing) are not used or only used for specific features.
</p>
<br /><a name="changelog"></a> <br /><a name="changelog"></a>
<h2>Change Log</h2> <h2>Change Log</h2>
<p> <p>
......
...@@ -64,6 +64,12 @@ Package org.h2.api<br /> ...@@ -64,6 +64,12 @@ Package org.h2.api<br />
<a href="org/h2/api/Trigger.html" target="javadoc">Trigger</a><br /> <a href="org/h2/api/Trigger.html" target="javadoc">Trigger</a><br />
<br /> <br />
<b>Constants</b><br />
Package org.h2.constant<br />
<a href="org/h2/constant/ErrorCode.html" target="javadoc">ErrorCode</a><br />
<a href="org/h2/constant/SysProperties.html" target="javadoc">SysProperties</a><br />
<br />
</div> </div>
</div></td></tr></table> </div></td></tr></table>
......
...@@ -221,6 +221,11 @@ public class AlterTableAlterColumn extends SchemaCommand { ...@@ -221,6 +221,11 @@ public class AlterTableAlterColumn extends SchemaCommand {
DbObject child = (DbObject) children.get(i); DbObject child = (DbObject) children.get(i);
if (child instanceof Sequence) { if (child instanceof Sequence) {
continue; continue;
} else if (child instanceof Index) {
Index idx = (Index) child;
if (idx.getIndexType().belongsToConstraint()) {
continue;
}
} }
String createSQL = child.getCreateSQL(); String createSQL = child.getCreateSQL();
if (createSQL == null) { if (createSQL == null) {
......
...@@ -576,7 +576,7 @@ public class Select extends Query { ...@@ -576,7 +576,7 @@ public class Select extends Query {
if (index != null && (current.getIndexType().isScan() || current == index)) { if (index != null && (current.getIndexType().isScan() || current == index)) {
topTableFilter.setIndex(index); topTableFilter.setIndex(index);
if (!distinct || isDistinctQuery) { if (!distinct || isDistinctQuery) {
// sort using index wouldn't work correctly for distinct result sets // sort using index would not work correctly for distinct result sets
// because it would break too early when limit is used // because it would break too early when limit is used
sortUsingIndex = true; sortUsingIndex = true;
} }
......
...@@ -97,7 +97,11 @@ public class JdbcUtils { ...@@ -97,7 +97,11 @@ public class JdbcUtils {
DataSource ds = (DataSource) context.lookup(url); DataSource ds = (DataSource) context.lookup(url);
String user = prop.getProperty("user"); String user = prop.getProperty("user");
String password = prop.getProperty("password"); String password = prop.getProperty("password");
if (StringUtils.isNullOrEmpty(user) && StringUtils.isNullOrEmpty(password)) {
return ds.getConnection();
} else {
return ds.getConnection(user, password); return ds.getConnection(user, password);
}
} catch (InstantiationException e) { } catch (InstantiationException e) {
throw Message.convert(e); throw Message.convert(e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
......
...@@ -116,7 +116,7 @@ public class FunctionMultiReturn { ...@@ -116,7 +116,7 @@ public class FunctionMultiReturn {
* *
* @param conn the connection * @param conn the connection
* @param query the query * @param query the query
* @return a result set with the coodinates * @return a result set with the coordinates
*/ */
public static ResultSet polar2CartesianSet(Connection conn, String query) throws SQLException { public static ResultSet polar2CartesianSet(Connection conn, String query) throws SQLException {
SimpleResultSet result = new SimpleResultSet(); SimpleResultSet result = new SimpleResultSet();
......
...@@ -51,7 +51,6 @@ import org.h2.test.db.TestView; ...@@ -51,7 +51,6 @@ import org.h2.test.db.TestView;
import org.h2.test.jdbc.TestBatchUpdates; import org.h2.test.jdbc.TestBatchUpdates;
import org.h2.test.jdbc.TestCallableStatement; import org.h2.test.jdbc.TestCallableStatement;
import org.h2.test.jdbc.TestCancel; import org.h2.test.jdbc.TestCancel;
import org.h2.test.jdbc.TestDataSource;
import org.h2.test.jdbc.TestDatabaseEventListener; import org.h2.test.jdbc.TestDatabaseEventListener;
import org.h2.test.jdbc.TestManyJdbcObjects; import org.h2.test.jdbc.TestManyJdbcObjects;
import org.h2.test.jdbc.TestMetaData; import org.h2.test.jdbc.TestMetaData;
...@@ -62,7 +61,9 @@ import org.h2.test.jdbc.TestStatement; ...@@ -62,7 +61,9 @@ import org.h2.test.jdbc.TestStatement;
import org.h2.test.jdbc.TestTransactionIsolation; import org.h2.test.jdbc.TestTransactionIsolation;
import org.h2.test.jdbc.TestUpdatableResultSet; import org.h2.test.jdbc.TestUpdatableResultSet;
import org.h2.test.jdbc.TestZloty; import org.h2.test.jdbc.TestZloty;
import org.h2.test.jdbc.xa.TestXA; import org.h2.test.jdbcx.TestDataSource;
import org.h2.test.jdbcx.TestXA;
import org.h2.test.jdbcx.TestXASimple;
import org.h2.test.mvcc.TestMvcc1; import org.h2.test.mvcc.TestMvcc1;
import org.h2.test.mvcc.TestMvcc2; import org.h2.test.mvcc.TestMvcc2;
import org.h2.test.server.TestNestedLoop; import org.h2.test.server.TestNestedLoop;
...@@ -149,6 +150,21 @@ java org.h2.test.TestAll timer ...@@ -149,6 +150,21 @@ java org.h2.test.TestAll timer
/* /*
h2CallableStatementBatchTest.zip
h2-2007-12-27_test.zip
History:
The H2 Console now calls DataSource.getConnection() instead of DataSource.getConnection(user, password)
when user name and password are not specified.
The bind IP address can now be set when using multi-homed host (if multiple network adapters are available)
using the system property h2.bindAddress.
Batch update: Calling BatchUpdateException.printStackTrace() could result in out of memory. Fixed.
Indexes of unique or foreign constraints where not dropped when the constraint was dropped after
altering the table (for example dropping a column). Fixed.
Roadmap:
Automatically switch source code before compiling
staging.trace.db.gz staging.trace.db.gz
drop table logs; drop table logs;
...@@ -159,25 +175,10 @@ ANALYZE SAMPLE_SIZE 0; ...@@ -159,25 +175,10 @@ ANALYZE SAMPLE_SIZE 0;
script nodata; script nodata;
EXPLAIN SELECT id FROM Logs WHERE procid=2 AND id<100; EXPLAIN SELECT id FROM Logs WHERE procid=2 AND id<100;
h2CallableStatementBatchTest.zip
h2-2007-12-27_test.zip
docs,
History:
The bind IP address can now be set when using multi-homed host (if multiple network adapters are available)
using the system property h2.bindAddress.
Batch update: Calling BatchUpdateException.printStackTrace() could result in out of memory. Fixed.
Create system property documentation from Javadocs.
allow queries as well in batch updates allow queries as well in batch updates
CALL syntax should probably work for regular executeUpdate as well. CALL syntax should probably work for regular executeUpdate as well.
http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/getstart/callablestatement.html#1000220 http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/getstart/callablestatement.html#1000220
Automatically switch source code before compiling
[echo] Java version is 1.6 but source code is switched to 1.4.
[echo] Run ant codeswitchJdk... first.
write to the db file what version was used to create a database write to the db file what version was used to create a database
Web site: Web site:
...@@ -540,17 +541,11 @@ Features of H2 ...@@ -540,17 +541,11 @@ Features of H2
new TestTwoPhaseCommit().runTest(this); new TestTwoPhaseCommit().runTest(this);
new TestView().runTest(this); new TestView().runTest(this);
// server
new TestNestedLoop().runTest(this);
new TestWeb().runTest(this);
new TestPgServer().runTest(this);
// jdbc // jdbc
new TestBatchUpdates().runTest(this); new TestBatchUpdates().runTest(this);
new TestCallableStatement().runTest(this); new TestCallableStatement().runTest(this);
new TestCancel().runTest(this); new TestCancel().runTest(this);
new TestDatabaseEventListener().runTest(this); new TestDatabaseEventListener().runTest(this);
new TestDataSource().runTest(this);
new TestManyJdbcObjects().runTest(this); new TestManyJdbcObjects().runTest(this);
new TestMetaData().runTest(this); new TestMetaData().runTest(this);
new TestNativeSQL().runTest(this); new TestNativeSQL().runTest(this);
...@@ -559,14 +554,23 @@ Features of H2 ...@@ -559,14 +554,23 @@ Features of H2
new TestStatement().runTest(this); new TestStatement().runTest(this);
new TestTransactionIsolation().runTest(this); new TestTransactionIsolation().runTest(this);
new TestUpdatableResultSet().runTest(this); new TestUpdatableResultSet().runTest(this);
new TestXA().runTest(this);
new TestZloty().runTest(this); new TestZloty().runTest(this);
// jdbcx
new TestDataSource().runTest(this);
new TestXA().runTest(this);
new TestXASimple().runTest(this);
// server
new TestNestedLoop().runTest(this);
new TestWeb().runTest(this);
new TestPgServer().runTest(this);
// mvcc // mvcc
new TestMvcc1().runTest(this); new TestMvcc1().runTest(this);
new TestMvcc2().runTest(this); new TestMvcc2().runTest(this);
// synthetic // synth
new TestCrashAPI().runTest(this); new TestCrashAPI().runTest(this);
new TestRandomSQL().runTest(this); new TestRandomSQL().runTest(this);
new TestKillRestart().runTest(this); new TestKillRestart().runTest(this);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.jdbc; package org.h2.test.jdbcx;
import java.sql.Connection; import java.sql.Connection;
import java.sql.Statement; import java.sql.Statement;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: James Devenish * Initial Developer: James Devenish
*/ */
package org.h2.test.jdbc.xa; package org.h2.test.jdbcx;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
......
...@@ -2,20 +2,24 @@ ...@@ -2,20 +2,24 @@
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.jdbc; package org.h2.test.jdbcx;
import java.sql.Connection; import java.sql.Connection;
import javax.sql.XAConnection;
import org.h2.jdbcx.JdbcDataSource; import org.h2.jdbcx.JdbcDataSource;
import org.h2.test.TestBase;
/** /**
* A simple XA test. * A simple XA test.
*/ */
public class TestXASimple { public class TestXASimple extends TestBase {
private int notYetImplemented; public void test() throws Exception {
public static void main(String[] args) throws Exception { deleteDb("xaDb1");
deleteDb("xaDb2");
Class.forName("org.h2.Driver"); Class.forName("org.h2.Driver");
// InitialContext context = new InitialContext(); // InitialContext context = new InitialContext();
...@@ -24,20 +28,22 @@ public class TestXASimple { ...@@ -24,20 +28,22 @@ public class TestXASimple {
JdbcDataSource ds1 = new JdbcDataSource(); JdbcDataSource ds1 = new JdbcDataSource();
ds1.setPassword(""); ds1.setPassword("");
ds1.setUser("sa"); ds1.setUser("sa");
ds1.setURL("jdbc:h2:db1H2"); ds1.setURL("jdbc:h2:" + baseDir + " /xaDb1");
JdbcDataSource ds2 = new JdbcDataSource(); JdbcDataSource ds2 = new JdbcDataSource();
ds2.setPassword(""); ds2.setPassword("");
ds2.setUser("sa"); ds2.setUser("sa");
ds2.setURL("jdbc:h2:db2H2"); ds2.setURL("jdbc:h2:" + baseDir + "/xaDb2");
// UserTransaction ut = (UserTransaction) // UserTransaction ut = (UserTransaction)
// context.lookup("UserTransaction"); // context.lookup("UserTransaction");
// ut.begin(); // ut.begin();
Connection c1 = ds1.getXAConnection().getConnection(); XAConnection xa1 = ds1.getXAConnection();
Connection c1 = xa1.getConnection();
c1.setAutoCommit(false); c1.setAutoCommit(false);
Connection c2 = ds2.getXAConnection().getConnection(); XAConnection xa2 = ds2.getXAConnection();
Connection c2 = xa2.getConnection();
c2.setAutoCommit(false); c2.setAutoCommit(false);
c1.createStatement().executeUpdate("create table test(id int, test varchar(255))"); c1.createStatement().executeUpdate("create table test(id int, test varchar(255))");
...@@ -47,8 +53,13 @@ public class TestXASimple { ...@@ -47,8 +53,13 @@ public class TestXASimple {
c1.close(); c1.close();
c2.close(); c2.close();
xa1.close();
xa2.close();
// j.stop(); // j.stop();
// System.exit(0); // System.exit(0);
deleteDb("xaDb1");
deleteDb("xaDb2");
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: James Devenish * Initial Developer: James Devenish
*/ */
package org.h2.test.jdbc.xa; package org.h2.test.jdbcx;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
......
...@@ -2825,11 +2825,10 @@ script NOPASSWORDS NOSETTINGS drop; ...@@ -2825,11 +2825,10 @@ script NOPASSWORDS NOSETTINGS drop;
> CREATE SCHEMA S AUTHORIZATION SA; > CREATE SCHEMA S AUTHORIZATION SA;
> CREATE SEQUENCE S.SEQ START WITH 10; > CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints"; > CREATE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE UNIQUE INDEX S.CU_ID_INDEX_2 ON S.TEST(ID);
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP SEQUENCE IF EXISTS S.SEQ; > DROP SEQUENCE IF EXISTS S.SEQ;
> DROP TABLE IF EXISTS S.TEST; > DROP TABLE IF EXISTS S.TEST;
> rows: 10 > rows: 9
drop trigger s.test_trigger; drop trigger s.test_trigger;
> ok > ok
......
CREATE TABLE TEST(A int NOT NULL, B int NOT NULL, C int) ;
ALTER TABLE TEST ADD CONSTRAINT CON UNIQUE(A,B);
ALTER TABLE TEST DROP C;
ALTER TABLE TEST DROP CONSTRAINT CON;
ALTER TABLE TEST DROP B;
DROP TABLE TEST;
select count(d.*) from dual d group by d.x; select count(d.*) from dual d group by d.x;
> 1; > 1;
......
...@@ -15,7 +15,7 @@ import org.h2.value.Value; ...@@ -15,7 +15,7 @@ import org.h2.value.Value;
* Tests the data parsing. * Tests the data parsing.
* The problem is that some dates are not allowed because of the summer time change. * The problem is that some dates are not allowed because of the summer time change.
* Most countries change at 2 o'clock in the morning to 3 o'clock, but some * Most countries change at 2 o'clock in the morning to 3 o'clock, but some
* (for example Chile) change at midnight. Non-lenient parsing wouldn't work in this case. * (for example Chile) change at midnight. Non-lenient parsing would not work in this case.
*/ */
public class TestDate extends TestBase { public class TestDate extends TestBase {
......
...@@ -521,3 +521,5 @@ countdown paused javac analyzing accesses solving forcefully urgent originally d ...@@ -521,3 +521,5 @@ countdown paused javac analyzing accesses solving forcefully urgent originally d
camel council merges spelled adaptive pull controller abstractions workarounds driven camel council merges spelled adaptive pull controller abstractions workarounds driven
thousands ridvan incremented slots debugging inherit agar fulvio invisible biondi hundreds occupied remap retrieved involved thousands ridvan incremented slots debugging inherit agar fulvio invisible biondi hundreds occupied remap retrieved involved
turkish fulfils iapi filesync turkish fulfils iapi filesync
compares packets destroying echo homed hosts clock countries validated catches turning staging kills distance morning performs internationalization simulator constructed nicer
echo callablestatement procid homed getstart staging
\ No newline at end of file
...@@ -12,6 +12,8 @@ import java.io.PrintWriter; ...@@ -12,6 +12,8 @@ import java.io.PrintWriter;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import org.h2.util.StringUtils;
import com.sun.javadoc.ClassDoc; import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc; import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc; import com.sun.javadoc.MethodDoc;
...@@ -74,7 +76,7 @@ public class Doclet { ...@@ -74,7 +76,7 @@ public class Doclet {
.println("<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">"); .println("<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">");
writer.println("<h1>" + className + "</h1>"); writer.println("<h1>" + className + "</h1>");
writer.println(clazz.commentText() + "<br /><br />"); writer.println(formatText(clazz.commentText()) + "<br /><br />");
MethodDoc[] methods = clazz.methods(); MethodDoc[] methods = clazz.methods();
Arrays.sort(methods, new Comparator() { Arrays.sort(methods, new Comparator() {
...@@ -82,13 +84,17 @@ public class Doclet { ...@@ -82,13 +84,17 @@ public class Doclet {
return ((MethodDoc) a).name().compareTo(((MethodDoc) b).name()); return ((MethodDoc) a).name().compareTo(((MethodDoc) b).name());
} }
}); });
writer.println("<table><tr><th colspan=\"2\">Methods</th></tr>"); boolean hasMethods = false;
for (int i = 0; i < methods.length; i++) { for (int i = 0; i < methods.length; i++) {
MethodDoc method = methods[i]; MethodDoc method = methods[i];
String name = method.name(); String name = method.name();
if (skipMethod(method)) { if (skipMethod(method)) {
continue; continue;
} }
if (!hasMethods) {
writer.println("<table><tr><th colspan=\"2\">Methods</th></tr>");
hasMethods = true;
}
String type = getTypeName(method.isStatic(), method.returnType()); String type = getTypeName(method.isStatic(), method.returnType());
writer.println("<tr><td class=\"return\">" + type + "</td><td class=\"method\">"); writer.println("<tr><td class=\"return\">" + type + "</td><td class=\"method\">");
Parameter[] params = method.parameters(); Parameter[] params = method.parameters();
...@@ -109,11 +115,13 @@ public class Doclet { ...@@ -109,11 +115,13 @@ public class Doclet {
writer.println("<a href=\"#r" + i + "\">" + name + "</a>" + buff.toString()); writer.println("<a href=\"#r" + i + "\">" + name + "</a>" + buff.toString());
String firstSentence = getFirstSentence(method.firstSentenceTags()); String firstSentence = getFirstSentence(method.firstSentenceTags());
if (firstSentence != null) { if (firstSentence != null) {
writer.println("<div class=\"methodText\">" + firstSentence + "</div>"); writer.println("<div class=\"methodText\">" + formatText(firstSentence) + "</div>");
} }
writer.println("</td></tr>"); writer.println("</td></tr>");
} }
if (hasMethods) {
writer.println("</table>"); writer.println("</table>");
}
FieldDoc[] fields = clazz.fields(); FieldDoc[] fields = clazz.fields();
if (clazz.interfaces().length > 0) { if (clazz.interfaces().length > 0) {
fields = clazz.interfaces()[0].fields(); fields = clazz.interfaces()[0].fields();
...@@ -136,10 +144,15 @@ public class Doclet { ...@@ -136,10 +144,15 @@ public class Doclet {
String type = getTypeName(true, field.type()); String type = getTypeName(true, field.type());
writer.println("<tr><td class=\"return\">" + type + "</td><td class=\"method\">"); writer.println("<tr><td class=\"return\">" + type + "</td><td class=\"method\">");
// writer.println("<a href=\"#f" + fieldId + "\">" + name + "</a>"); // writer.println("<a href=\"#f" + fieldId + "\">" + name + "</a>");
writer.println(name + " = " + field.constantValueExpression()); String constant = field.constantValueExpression();
if (constant == null) {
writer.println(name);
} else {
writer.println(name + " = " + constant);
}
String text = field.commentText(); String text = field.commentText();
if (text != null) { if (text != null) {
writer.println("<div class=\"methodText\">" + text + "</div>"); writer.println("<div class=\"methodText\">" + formatText(text) + "</div>");
} }
writer.println("</td></tr>"); writer.println("</td></tr>");
fieldId++; fieldId++;
...@@ -183,7 +196,7 @@ public class Doclet { ...@@ -183,7 +196,7 @@ public class Doclet {
} }
writer.println("<h4>" + type + " <span class=\"methodName\">" + name + "</span>" + buff.toString() writer.println("<h4>" + type + " <span class=\"methodName\">" + name + "</span>" + buff.toString()
+ "</h4>"); + "</h4>");
writer.println(method.commentText()); writer.println(formatText(method.commentText()));
ParamTag[] paramTags = method.paramTags(); ParamTag[] paramTags = method.paramTags();
boolean space = false; boolean space = false;
for (int j = 0; j < paramTags.length; j++) { for (int j = 0; j < paramTags.length; j++) {
...@@ -229,6 +242,14 @@ public class Doclet { ...@@ -229,6 +242,14 @@ public class Doclet {
out.close(); out.close();
} }
private static String formatText(String text) {
if (text == null) {
return text;
}
text = StringUtils.replaceAll(text, "\n </pre>", "</pre>");
return text;
}
private static boolean skipMethod(MethodDoc method) { private static boolean skipMethod(MethodDoc method) {
ClassDoc clazz = method.containingClass(); ClassDoc clazz = method.containingClass();
if (INTERFACES_ONLY && (!clazz.isAbstract() || !method.isAbstract()) && !clazz.isInterface()) { if (INTERFACES_ONLY && (!clazz.isAbstract() || !method.isAbstract()) && !clazz.isInterface()) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.security; package org.h2.tools.security;
import java.security.Key; import java.security.Key;
import java.security.KeyStore; import java.security.KeyStore;
...@@ -13,6 +13,7 @@ import java.security.cert.Certificate; ...@@ -13,6 +13,7 @@ import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateEncodingException;
import java.util.Enumeration; import java.util.Enumeration;
import org.h2.security.SecureSocketFactory;
import org.h2.util.ByteUtils; import org.h2.util.ByteUtils;
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论