提交 26e617c5 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 85bdf82a
...@@ -1154,7 +1154,7 @@ The conversion between UTF-8 and Java encoding (using the \u syntax), as well as ...@@ -1154,7 +1154,7 @@ The conversion between UTF-8 and Java encoding (using the \u syntax), as well as
Downloads Downloads
@download_1001_h3 @download_1001_h3
Version 1.0.61 (2007-11-10, Current) Version 1.0.62 (2007-11-25, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3182,7 +3182,7 @@ JDBC and (partial) ODBC API; Web Client application ...@@ -3182,7 +3182,7 @@ JDBC and (partial) ODBC API; Web Client application
Download Download
@mainWeb_1007_td @mainWeb_1007_td
Version 1.0.61 (2007-11-10): Version 1.0.62 (2007-11-25):
@mainWeb_1008_a @mainWeb_1008_a
Windows Installer (2.8 MB) Windows Installer (2.8 MB)
......
...@@ -1156,7 +1156,7 @@ Centralリポジトリの利用 ...@@ -1156,7 +1156,7 @@ Centralリポジトリの利用
ダウンロード ダウンロード
@download_1001_h3 @download_1001_h3
#Version 1.0.61 (2007-11-10, Current) #Version 1.0.62 (2007-11-25, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3184,7 +3184,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション ...@@ -3184,7 +3184,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード ダウンロード
@mainWeb_1007_td @mainWeb_1007_td
#Version 1.0.61 (2007-11-10): #Version 1.0.62 (2007-11-25):
@mainWeb_1008_a @mainWeb_1008_a
#Windows Installer (2.8 MB) #Windows Installer (2.8 MB)
......
...@@ -383,7 +383,7 @@ build_1032_li=Error messages\: src/main/org/h2/res/_messages_*.properties ...@@ -383,7 +383,7 @@ build_1032_li=Error messages\: src/main/org/h2/res/_messages_*.properties
build_1033_li=Web site\: src/docsrc/text/_docs_*.utf8.txt build_1033_li=Web site\: src/docsrc/text/_docs_*.utf8.txt
build_1034_p=The conversion between UTF-8 and Java encoding (using the \\u syntax), as well as the HTML entities (&\#..;) is automated by running the tool PropertiesToUTF8. The web site translation is automated as well, using <code>ant docs</code> . build_1034_p=The conversion between UTF-8 and Java encoding (using the \\u syntax), as well as the HTML entities (&\#..;) is automated by running the tool PropertiesToUTF8. The web site translation is automated as well, using <code>ant docs</code> .
download_1000_h1=Downloads download_1000_h1=Downloads
download_1001_h3=Version 1.0.61 (2007-11-10, Current) download_1001_h3=Version 1.0.62 (2007-11-25, Current)
download_1002_a=Windows Installer download_1002_a=Windows Installer
download_1003_a=Platform-Independent Zip download_1003_a=Platform-Independent Zip
download_1004_h3=Download Mirror download_1004_h3=Download Mirror
...@@ -1059,7 +1059,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux) ...@@ -1059,7 +1059,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li=Embedded, Server and Cluster modes mainWeb_1004_li=Embedded, Server and Cluster modes
mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3=Download mainWeb_1006_h3=Download
mainWeb_1007_td=Version 1.0.61 (2007-11-10)\: mainWeb_1007_td=Version 1.0.62 (2007-11-25)\:
mainWeb_1008_a=Windows Installer (2.8 MB) mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1009_a=All platforms (zip, 3.9 MB) mainWeb_1009_a=All platforms (zip, 3.9 MB)
mainWeb_1010_a=All Downloads mainWeb_1010_a=All Downloads
......
...@@ -60,9 +60,10 @@ import org.h2.constant.SysProperties; ...@@ -60,9 +60,10 @@ import org.h2.constant.SysProperties;
* - Scan for viruses * - Scan for viruses
* - ant mavenDeployCentral * - ant mavenDeployCentral
* - Upload to SourceForge * - Upload to SourceForge
* - Newsletter: send without 'to unsubscribe...' to h2database-news@googlegroups.com, but * - Newsletter: send without 'to unsubscribe...' to h2database-news@googlegroups.com
* - Newsletter: prepare, send (always send to BCC!!) * - Newsletter: prepare, send (always send to BCC!!)
* - Add to freshmeat, http://code.google.com/p/h2database/downloads/list * - Add to freshmeat
* - Upload to http://code.google.com/p/h2database/downloads/list
* *
* @author Thomas * @author Thomas
*/ */
......
...@@ -10,6 +10,37 @@ INSERT INTO CHANNEL VALUES('H2 Database Engine' , ...@@ -10,6 +10,37 @@ INSERT INTO CHANNEL VALUES('H2 Database Engine' ,
CREATE TABLE ITEM(ID INT PRIMARY KEY, TITLE VARCHAR, ISSUED TIMESTAMP, DESC VARCHAR); CREATE TABLE ITEM(ID INT PRIMARY KEY, TITLE VARCHAR, ISSUED TIMESTAMP, DESC VARCHAR);
INSERT INTO ITEM VALUES(32,
'New version available: 1.0.62 (2007-11-25)', '2007-11-25 12:00:00',
'A new version of H2 is available for <a href="http://www.h2database.com">download</a>.
(You may have to click ''Refresh'').
<br />
<b>Changes and new functionality:</b>
<ul><li>Large updates and deletes are now supported.
</li><li>Google Android is supported.
</li><li>Large CSV operations are now faster.
</li><li>A patch for Apache DDL Utils is available.
</li><li>Eduardo Velasques has translated H2 to Brazilian Portuguese.
</li><li>Now using custom toString() for JDBC objects.
</li><li>The setting h2.emergencySpaceInitial is now 256 KB.
</li></ul>
<b>Bugfixes:</b>
<ul><li>Creating a table from GROUP_CONCAT didn''t always work.
</li><li>CSV: Using an empty field delimiter didn''t work.
</li><li>Nested temporary views with parameters didn''t always work.
</li><li>Cluster mode: could not connect if only one server was running.
</li><li>ARRAY values are now sorted as in PostgreSQL.
</li><li>The console did not display multiple spaces correctly.
</li><li>Duplicate column names were not detected when renaming columns.
</li><li>The H2 Console now also supports -ifExists.
</li><li>Changing a user with a schema made the schema inaccessible.
</li><li>Referential integrity checks didn''t lock the referenced table.
</li><li>Now changing MVCC too late throws an Exception.
</li></ul>
For future plans, see the ''Roadmap'' page at
http://groups.google.com/group/h2-database/web/roadmap
');
INSERT INTO ITEM VALUES(31, INSERT INTO ITEM VALUES(31,
'New version available: 1.0.61 (2007-11-10)', '2007-11-10 12:00:00', 'New version available: 1.0.61 (2007-11-10)', '2007-11-10 12:00:00',
'A new version of H2 is available for <a href="http://www.h2database.com">download</a>. 'A new version of H2 is available for <a href="http://www.h2database.com">download</a>.
......
/* /*
* 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).
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.h2.test.trace; package org.h2.test.trace;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* Represents a statement (a single line in the log file). * Represents a statement (a single line in the log file).
* *
* @author Thomas Mueller * @author Thomas Mueller
* *
*/ */
class Statement { class Statement {
private Player player; private Player player;
private boolean assignment; private boolean assignment;
private String assignClass; private String assignClass;
private String assignVariable; private String assignVariable;
private boolean staticCall; private boolean staticCall;
private String staticCallClass; private String staticCallClass;
private String objectName; private String objectName;
private Object object; private Object object;
private String methodName; private String methodName;
private Arg[] args; private Arg[] args;
private Class[] parameterTypes; private Class[] parameterTypes;
private Object[] parameters; private Object[] parameters;
private Method method; private Method method;
private Class returnClass; private Class returnClass;
private Object returnObject; private Object returnObject;
Statement(Player player) { Statement(Player player) {
this.player = player; this.player = player;
} }
private Method findMethod(Class clazz) throws Exception { private Method findMethod(Class clazz) throws Exception {
if ((clazz.getModifiers() & Modifier.PUBLIC) == 0) { if ((clazz.getModifiers() & Modifier.PUBLIC) == 0) {
// http://forum.java.sun.com/thread.jspa?threadID=704100&messageID=4084720 // http://forum.java.sun.com/thread.jspa?threadID=704100&messageID=4084720
// bug 4071957 // bug 4071957
Class[] interfaces = clazz.getInterfaces(); Class[] interfaces = clazz.getInterfaces();
for (int i = 0; i < interfaces.length; i++) { for (int i = 0; i < interfaces.length; i++) {
Class c = interfaces[i]; Class c = interfaces[i];
if (c.getName().startsWith("javax.")) { if (c.getName().startsWith("javax.")) {
try { try {
return c.getMethod(methodName, parameterTypes); return c.getMethod(methodName, parameterTypes);
} catch (Exception e) { } catch (Exception e) {
// TODO this is slow, but a workaround for a JVM bug // TODO this is slow, but a workaround for a JVM bug
} }
} }
} }
} }
try { try {
return clazz.getMethod(methodName, parameterTypes); return clazz.getMethod(methodName, parameterTypes);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
Method[] methods = clazz.getMethods(); Method[] methods = clazz.getMethods();
methods: methods:
for (int i = 0; i < methods.length; i++) { for (int i = 0; i < methods.length; i++) {
Method m = methods[i]; Method m = methods[i];
if (methodName.equals(m.getName())) { if (methodName.equals(m.getName())) {
Class[] argClasses = m.getParameterTypes(); Class[] argClasses = m.getParameterTypes();
for (int j = 0; j < args.length; j++) { for (int j = 0; j < args.length; j++) {
if (!argClasses[j].isAssignableFrom(args[j].getValueClass())) { if (!argClasses[j].isAssignableFrom(args[j].getValueClass())) {
continue methods; continue methods;
} }
} }
return m; return m;
} }
} }
} }
throw new Error("Method with args not found: " + clazz.getName() + "." throw new Error("Method with args not found: " + clazz.getName() + "."
+ methodName + " args: " + args.length); + methodName + " args: " + args.length);
} }
void execute() throws Exception { void execute() throws Exception {
if (object == player) { if (object == player) {
// there was an exception previously // there was an exception previously
player.log("> " + assignVariable + " not set"); player.log("> " + assignVariable + " not set");
if (assignment) { if (assignment) {
player.assign(assignVariable, player); player.assign(assignVariable, player);
} }
return; return;
} }
Class clazz; Class clazz;
if (staticCall) { if (staticCall) {
if (staticCallClass == null || staticCallClass.length() == 0) { if (staticCallClass == null || staticCallClass.length() == 0) {
player.log("?class? " + staticCallClass); player.log("?class? " + staticCallClass);
} }
clazz = Player.getClass(staticCallClass); clazz = Player.getClass(staticCallClass);
} else { } else {
clazz = object.getClass(); clazz = object.getClass();
} }
parameterTypes = new Class[args.length]; parameterTypes = new Class[args.length];
parameters = new Object[args.length]; parameters = new Object[args.length];
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
Arg arg = args[i]; Arg arg = args[i];
arg.execute(); arg.execute();
parameterTypes[i] = arg.getValueClass(); parameterTypes[i] = arg.getValueClass();
parameters[i] = arg.getValue(); parameters[i] = arg.getValue();
} }
method = findMethod(clazz); method = findMethod(clazz);
returnClass = method.getReturnType(); returnClass = method.getReturnType();
try { try {
Object obj = method.invoke(object, parameters); Object obj = method.invoke(object, parameters);
if (assignment) { if (assignment) {
player.assign(assignVariable, obj); player.assign(assignVariable, obj);
} }
returnObject = obj; returnObject = obj;
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
Throwable t = e.getTargetException(); Throwable t = e.getTargetException();
player.log("> " + t.toString()); player.log("> " + t.toString());
if (assignment) { if (assignment) {
player.assign(assignVariable, player); player.assign(assignVariable, player);
} }
} }
} }
public String toString() { public String toString() {
StringBuffer buff = new StringBuffer(); StringBuffer buff = new StringBuffer();
if (assignment) { if (assignment) {
buff.append(assignClass); buff.append(assignClass);
buff.append(' '); buff.append(' ');
buff.append(assignVariable); buff.append(assignVariable);
buff.append('='); buff.append('=');
} }
if (staticCall) { if (staticCall) {
buff.append(staticCallClass); buff.append(staticCallClass);
} else { } else {
buff.append(objectName); buff.append(objectName);
} }
buff.append('.'); buff.append('.');
buff.append(methodName); buff.append(methodName);
buff.append('('); buff.append('(');
for (int i = 0; args != null && i < args.length; i++) { for (int i = 0; args != null && i < args.length; i++) {
if (i > 0) { if (i > 0) {
buff.append(", "); buff.append(", ");
} }
buff.append(args[i].toString()); buff.append(args[i].toString());
} }
buff.append(");"); buff.append(");");
return buff.toString(); return buff.toString();
} }
Class getReturnClass() { Class getReturnClass() {
return returnClass; return returnClass;
} }
Object getReturnObject() { Object getReturnObject() {
return returnObject; return returnObject;
} }
void setAssign(String className, String variableName) { void setAssign(String className, String variableName) {
this.assignment = true; this.assignment = true;
this.assignClass = className; this.assignClass = className;
this.assignVariable = variableName; this.assignVariable = variableName;
} }
void setStaticCall(String className) { void setStaticCall(String className) {
this.staticCall = true; this.staticCall = true;
this.staticCallClass = className; this.staticCallClass = className;
} }
void setMethodCall(String objectName, Object object, String methodName) { void setMethodCall(String objectName, Object object, String methodName) {
this.objectName = objectName; this.objectName = objectName;
this.object = object; this.object = object;
this.methodName = methodName; this.methodName = methodName;
} }
public void setArgs(ArrayList list) { public void setArgs(ArrayList list) {
args = new Arg[list.size()]; args = new Arg[list.size()];
list.toArray(args); list.toArray(args);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论