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

--no commit message

--no commit message
上级 3c46ac75
......@@ -20,6 +20,8 @@ Build
Environment</a><br />
<a href="#building">
Building the Software</a><br />
<a href="#build_targets">
Build Targets</a><br />
<a href="#maven2">
Using Maven 2</a><br />
<a href="#translating">
......@@ -57,7 +59,7 @@ Newer version or compatible software works too.
<br /><a name="building"></a>
<h2>Building the Software</h2>
<p>
On the command line, go to the directory src and execute the following command:
On the command line, go to the directory h2 and execute the following command:
</p>
<pre>
build -?
......@@ -68,16 +70,22 @@ You will get a list of targets. If you want to build the jar file, execute:
<pre>
build jar
</pre>
<br /><a name="build_targets"></a>
<h2>Build Targets</h2>
<p>
The build system can generate smaller jar files as well. The following targets are currently supported:
</p>
<ul><li>jarClient: Create the h2client.jar. This only contains the remote JDBC implementation.
</li><li>jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li></ul>
<p>
To create a jar file with the JDBC API and the classes required to connect to a server only,
use the target jarClient:
To create the h2client.jar file, go to the directory h2 and execute the following command:
</p>
<pre>
build jarClient
</pre>
<p>
The other targets may be used as well.
</p>
<br /><a name="maven2"></a>
<h2>Using Maven 2</h2>
......
......@@ -408,7 +408,7 @@ or on the number of open connections.
<h3>Remote Mode</h3>
<p>
When using the remote mode (sometimes called client/server mode), an application opens a
When using the remote mode (sometimes called server mode or client/server mode), an application opens a
database remotely using the JDBC or ODBC API. A server needs to be started within the same
or another virtual machine (or on another computer).
Many applications can connect to the same database at the same time.
......@@ -426,7 +426,9 @@ or on the number of open connections.
The mixed mode is a combination of the embedded and the remote mode.
The main application connects to a database in embedded mode, but also starts
a server so that other applications (running in different virtual machines) can
concurrently access the same data.
concurrently access the same data. The embedded connections are as fast as if
the database is used in just the embedded mode, while the remote
connections are a bit slower.
</p>
<img src="images/connection-mode-mixed.png"
alt="The database and the server is running inside the application; another application connects remotely" />
......
......@@ -169,6 +169,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>ROW_NUMBER (not the same as ROWNUM)
</li><li>Partial indexing (see PostgreSQL)
</li><li>The build should fail if the test fails
</li><li>Add GUI to build a custom version (embedded, fulltext,...) using build flags
</li><li>http://rubyforge.org/projects/hypersonic/
</li><li>DbVisualizer profile for H2
</li><li>Add comparator (x === y) : (x = y or (x is null and y is null))
......@@ -226,7 +227,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Dynamic length numbers / special methods for DataPage.writeByte / writeShort / Ronni Nielsen
</li><li>Pluggable ThreadPool, (AvalonDB / deebee / Paul Hammant)
</li><li>Recursive Queries (see details)
</li><li>Add GUI to build a custom version (embedded, fulltext,...)
</li><li>Release locks (shared or exclusive) on demand
</li><li>Support OUTER UNION
</li><li>Support Parameterized Views (similar to CSVREAD, but using just SQL for the definition)
......
......@@ -160,6 +160,7 @@
90136=Unsupported outer join condition\: {0}
90137=Can only assign to a variable, not to\: {0}
90138=Invalid database name\: {0}
90139=The public static Java method was not found\: {0}
HY000=General error\: {0}
HY004=Unknown data type\: {0}
HYC00=Feature not supported
......
......@@ -320,7 +320,15 @@ public abstract class Prepared {
Expression e = (Expression) parameters.get(i);
Value v = e.getValue(session);
try {
buff.append(v.getSQL());
// if (v.getPrecision() > SysProperties.MAX_TRACE_DATA_LENGTH) {
//
// }
String s = v.getSQL();
int test;
// if (s.length() > SysProperties.MAX_TRACE_DATA_LENGTH) {
// s = s.substring(0, SysProperties.MAX_TRACE_DATA_LENGTH) + " /* len: " + s.length() + " */";
// }
buff.append(s);
} catch (Exception t) {
buff.append("? /*");
buff.append(StringUtils.quoteJavaString(t.getMessage()));
......
......@@ -1281,7 +1281,8 @@ public class ErrorCode {
* the specified method was not found in the class.
* Example:
* <pre>
* CREATE ALIAS TEST FOR "java.lang.Math.test";
* CREATE ALIAS TO_BINARY FOR "java.lang.Long.toBinaryString(long)";
* CALL TO_BINARY(10, 2);
* </pre>
*/
public static final int METHOD_NOT_FOUND_1 = 90087;
......@@ -1837,8 +1838,18 @@ public class ErrorCode {
* </pre>
*/
public static final int INVALID_DATABASE_NAME_1 = 90138;
/**
* The error with code <code>90139</code> is thrown when
* the specified public static Java method was not found in the class.
* Example:
* <pre>
* CREATE ALIAS TEST FOR "java.lang.Math.test";
* </pre>
*/
public static final int PUBLIC_STATIC_JAVA_METHOD_NOT_FOUND_1 = 90139;
// next is 90139
// next is 90140
private ErrorCode() {
// utility class
......
......@@ -84,7 +84,7 @@ public class FunctionAlias extends DbObjectBase {
}
}
if (list.size() == 0) {
throw Message.getSQLException(ErrorCode.METHOD_NOT_FOUND_1, methodName + " (" + className + ")");
throw Message.getSQLException(ErrorCode.PUBLIC_STATIC_JAVA_METHOD_NOT_FOUND_1, methodName + " (" + className + ")");
}
javaMethods = new JavaMethod[list.size()];
list.toArray(javaMethods);
......@@ -153,12 +153,13 @@ public class FunctionAlias extends DbObjectBase {
*/
public JavaMethod findJavaMethod(Expression[] args) throws SQLException {
load();
int parameterCount = args.length;
for (int i = 0; i < javaMethods.length; i++) {
if (javaMethods[i].getParameterCount() == args.length) {
if (javaMethods[i].getParameterCount() == parameterCount) {
return javaMethods[i];
}
}
throw Message.getSQLException(ErrorCode.METHOD_NOT_FOUND_1, methodName + " (" + className + ")");
throw Message.getSQLException(ErrorCode.METHOD_NOT_FOUND_1, methodName + " (" + className + ", parameter count: " + parameterCount + ")");
}
public String getJavaClassName() {
......
......@@ -185,12 +185,11 @@ public class SessionRemote implements SessionInterface, DataHandler {
}
}
private String getTraceFilePrefix(String dbName) {
String dir = SysProperties.CLIENT_TRACE_DIRECTORY;
private String getFilePrefix(String dir) {
StringBuffer buff = new StringBuffer();
buff.append(dir);
for (int i = 0; i < dbName.length(); i++) {
char ch = dbName.charAt(i);
for (int i = 0; i < databaseName.length(); i++) {
char ch = databaseName.charAt(i);
if (Character.isLetterOrDigit(ch)) {
buff.append(ch);
} else {
......@@ -229,7 +228,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
String traceLevelFile = ci.getProperty(SetTypes.TRACE_LEVEL_FILE, null);
if (traceLevelFile != null) {
int level = Integer.parseInt(traceLevelFile);
String prefix = getTraceFilePrefix(databaseName);
String prefix = getFilePrefix(SysProperties.CLIENT_TRACE_DIRECTORY);
String file = FileUtils.createTempFile(prefix, Constants.SUFFIX_TRACE_FILE, false, false);
traceSystem.setFileName(file);
traceSystem.setLevelFile(level);
......@@ -454,7 +453,10 @@ public class SessionRemote implements SessionInterface, DataHandler {
public String createTempFile() throws SQLException {
try {
return FileUtils.createTempFile(databaseName, Constants.SUFFIX_TEMP_FILE, true, false);
String prefix = getFilePrefix(System.getProperty("java.io.tmpdir"));
int test;
// return FileUtils.createTempFile(databaseName, Constants.SUFFIX_TEMP_FILE, true, false);
return FileUtils.createTempFile(prefix, Constants.SUFFIX_TEMP_FILE, true, false);
} catch (IOException e) {
throw Message.convertIOException(e, databaseName);
}
......
......@@ -160,6 +160,7 @@
90136=Diese Outer Join Bedingung wird nicht unterst\u00FCtzt\: {0}
90137=Werte k\u00F6nnen nur einer Variablen zugewiesen werden, nicht an\: {0}
90138=Ung\u00FCltiger Datenbank Name\: {0}
90139=Die (public static) Java Funktion wurde nicht gefunden\: {0}
HY000=Allgemeiner Fehler\: {0}
HY004=Unbekannter Datentyp\: {0}
HYC00=Dieses Feature wird unterst\u00FCtzt
......
......@@ -160,6 +160,7 @@
90136=Unsupported outer join condition\: {0}
90137=Can only assign to a variable, not to\: {0}
90138=Invalid database name\: {0}
90139=The public static Java method was not found\: {0}
HY000=General error\: {0}
HY004=Unknown data type\: {0}
HYC00=Feature not supported
......
......@@ -160,6 +160,7 @@
90136=\u672A\u30B5\u30DD\u30FC\u30C8\u306E\u5916\u90E8\u7D50\u5408\u6761\u4EF6\: {0}
90137=\u5272\u308A\u5F53\u3066\u306F\u5909\u6570\u306B\u306E\u307F\u53EF\u80FD\u3067\u3059\u3002{0} \u306B\u306F\u3067\u304D\u307E\u305B\u3093
90138=\#Invalid database name\: {0}
90139=\#The public static Java method was not found\: {0}
HY000=\u4E00\u822C\u30A8\u30E9\u30FC\: {0}
HY004=\u4E0D\u660E\u306A\u30C7\u30FC\u30BF\u578B\: {0}
HYC00=\u6A5F\u80FD\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
......
......@@ -160,6 +160,7 @@
90136=\#Unsupported outer join condition\: {0}
90137=\#Can only assign to a variable, not to\: {0}
90138=\#Invalid database name\: {0}
90139=\#The public static Java method was not found\: {0}
HY000=Blad ogolny\: {0}
HY004=Nieznany typ danyche\: {0}
HYC00=Cecha nie jest wspierana
......
......@@ -160,6 +160,7 @@
90136=\#Unsupported outer join condition\: {0}
90137=\#Can only assign to a variable, not to\: {0}
90138=\#Invalid database name\: {0}
90139=\#The public static Java method was not found\: {0}
HY000=Erro geral\: {0}
HY004=Tipo de dados desconhecido\: {0}
HYC00=Recurso n\u00E3o suportado
......
......@@ -358,7 +358,8 @@ CREATE AGGREGATE MEDIAN FOR ""com.acme.db.Median""
CREATE ALIAS [IF NOT EXISTS] newFunctionAliasName FOR classAndMethodName
","
Creates a new function alias. The method name must be the full qualified class and method name,
and may optionally include the parameter classes as in ""java.lang.Integer.parseInt(java.lang.String, int)"")
and may optionally include the parameter classes as in ""java.lang.Integer.parseInt(java.lang.String, int)"").
The class and the method must both be public, and the method must be static.
Admin rights are required to execute this command.
If the first parameter of the Java function is a java.sql.Connection, then
the current to the database is provided. This connection must not be closed.
......
......@@ -150,7 +150,7 @@ public class TcpServer implements Service {
public void init(String[] args) {
port = DEFAULT_PORT;
for (int i = 0; i < args.length; i++) {
for (int i = 0; args != null && i < args.length; i++) {
String a = args[i];
if ("-trace".equals(a)) {
trace = true;
......
......@@ -49,7 +49,7 @@ public class PgServer implements Service {
public void init(String[] args) {
port = DEFAULT_PORT;
for (int i = 0; i < args.length; i++) {
for (int i = 0; args != null && i < args.length; i++) {
String a = args[i];
if ("-trace".equals(a)) {
trace = true;
......
......@@ -654,6 +654,7 @@ public class ValueLob extends Value {
}
public String toString() {
int tst;
if (small == null) {
return getClass().getName() + " file: " + fileName + " type: " + type + " precision: " + precision;
}
......
......@@ -238,6 +238,7 @@ public class Build extends BuildBase {
/**
* Create the file h2small.jar. This only contains the embedded database.
* Debug information is disabled.
*/
public void jarSmall() {
compile(false, false);
......@@ -259,7 +260,7 @@ public class Build extends BuildBase {
/**
* Create the file h2jaqu.jar. This only contains the JaQu (Java Query)
* implementation.
* implementation. All other jar files do not include JaQu.
*/
public void jarJaqu() {
compile(true, false);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论