Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
26e617c5
提交
26e617c5
authored
11月 25, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
85bdf82a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
248 行增加
和
216 行删除
+248
-216
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+2
-2
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+2
-2
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+2
-2
Constants.java
h2/src/main/org/h2/engine/Constants.java
+3
-2
newsfeed.sql
h2/src/test/org/h2/samples/newsfeed.sql
+31
-0
Statement.java
h2/src/test/org/h2/test/trace/Statement.java
+208
-208
没有找到文件。
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
26e617c5
...
...
@@ -1154,7 +1154,7 @@ The conversion between UTF-8 and Java encoding (using the \u syntax), as well as
Downloads
@download_1001_h3
Version 1.0.6
1 (2007-11-10
, Current)
Version 1.0.6
2 (2007-11-25
, Current)
@download_1002_a
Windows Installer
...
...
@@ -3182,7 +3182,7 @@ JDBC and (partial) ODBC API; Web Client application
Download
@mainWeb_1007_td
Version 1.0.6
1 (2007-11-10
):
Version 1.0.6
2 (2007-11-25
):
@mainWeb_1008_a
Windows Installer (2.8 MB)
...
...
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
26e617c5
...
...
@@ -1156,7 +1156,7 @@ Centralリポジトリの利用
ダウンロード
@download_1001_h3
#Version 1.0.6
1 (2007-11-10
, Current)
#Version 1.0.6
2 (2007-11-25
, Current)
@download_1002_a
Windows Installer
...
...
@@ -3184,7 +3184,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード
@mainWeb_1007_td
#Version 1.0.6
1 (2007-11-10
):
#Version 1.0.6
2 (2007-11-25
):
@mainWeb_1008_a
#Windows Installer (2.8 MB)
...
...
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
26e617c5
...
...
@@ -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_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_1001_h3
=
Version 1.0.6
1 (2007-11-10
, Current)
download_1001_h3
=
Version 1.0.6
2 (2007-11-25
, Current)
download_1002_a
=
Windows Installer
download_1003_a
=
Platform-Independent Zip
download_1004_h3
=
Download Mirror
...
...
@@ -1059,7 +1059,7 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li
=
Embedded, Server and Cluster modes
mainWeb_1005_li
=
JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3
=
Download
mainWeb_1007_td
=
Version 1.0.6
1 (2007-11-10
)
\:
mainWeb_1007_td
=
Version 1.0.6
2 (2007-11-25
)
\:
mainWeb_1008_a=Windows Installer (2.8 MB)
mainWeb_1009_a
=
All platforms (zip, 3.9 MB)
mainWeb_1010_a
=
All Downloads
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
26e617c5
...
...
@@ -60,9 +60,10 @@ import org.h2.constant.SysProperties;
* - Scan for viruses
* - ant mavenDeployCentral
* - 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!!)
* - 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
*/
...
...
h2/src/test/org/h2/samples/newsfeed.sql
浏览文件 @
26e617c5
...
...
@@ -10,6 +10,37 @@ INSERT INTO CHANNEL VALUES('H2 Database Engine' ,
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
,
'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>.
...
...
h2/src/test/org/h2/test/trace/Statement.java
浏览文件 @
26e617c5
/*
* 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
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* 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 obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
h2
.
test
.
trace
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.util.ArrayList
;
/**
* Represents a statement (a single line in the log file).
*
* @author Thomas Mueller
*
*/
class
Statement
{
private
Player
player
;
private
boolean
assignment
;
private
String
assignClass
;
private
String
assignVariable
;
private
boolean
staticCall
;
private
String
staticCallClass
;
private
String
objectName
;
private
Object
object
;
private
String
methodName
;
private
Arg
[]
args
;
private
Class
[]
parameterTypes
;
private
Object
[]
parameters
;
private
Method
method
;
private
Class
returnClass
;
private
Object
returnObject
;
Statement
(
Player
player
)
{
this
.
player
=
player
;
}
private
Method
findMethod
(
Class
clazz
)
throws
Exception
{
if
((
clazz
.
getModifiers
()
&
Modifier
.
PUBLIC
)
==
0
)
{
// http://forum.java.sun.com/thread.jspa?threadID=704100&messageID=4084720
// bug 4071957
Class
[]
interfaces
=
clazz
.
getInterfaces
();
for
(
int
i
=
0
;
i
<
interfaces
.
length
;
i
++)
{
Class
c
=
interfaces
[
i
];
if
(
c
.
getName
().
startsWith
(
"javax."
))
{
try
{
return
c
.
getMethod
(
methodName
,
parameterTypes
);
}
catch
(
Exception
e
)
{
// TODO this is slow, but a workaround for a JVM bug
}
}
}
}
try
{
return
clazz
.
getMethod
(
methodName
,
parameterTypes
);
}
catch
(
NoSuchMethodException
e
)
{
Method
[]
methods
=
clazz
.
getMethods
();
methods:
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
Method
m
=
methods
[
i
];
if
(
methodName
.
equals
(
m
.
getName
()))
{
Class
[]
argClasses
=
m
.
getParameterTypes
();
for
(
int
j
=
0
;
j
<
args
.
length
;
j
++)
{
if
(!
argClasses
[
j
].
isAssignableFrom
(
args
[
j
].
getValueClass
()))
{
continue
methods
;
}
}
return
m
;
}
}
}
throw
new
Error
(
"Method with args not found: "
+
clazz
.
getName
()
+
"."
+
methodName
+
" args: "
+
args
.
length
);
}
void
execute
()
throws
Exception
{
if
(
object
==
player
)
{
// there was an exception previously
player
.
log
(
"> "
+
assignVariable
+
" not set"
);
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
player
);
}
return
;
}
Class
clazz
;
if
(
staticCall
)
{
if
(
staticCallClass
==
null
||
staticCallClass
.
length
()
==
0
)
{
player
.
log
(
"?class? "
+
staticCallClass
);
}
clazz
=
Player
.
getClass
(
staticCallClass
);
}
else
{
clazz
=
object
.
getClass
();
}
parameterTypes
=
new
Class
[
args
.
length
];
parameters
=
new
Object
[
args
.
length
];
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
Arg
arg
=
args
[
i
];
arg
.
execute
();
parameterTypes
[
i
]
=
arg
.
getValueClass
();
parameters
[
i
]
=
arg
.
getValue
();
}
method
=
findMethod
(
clazz
);
returnClass
=
method
.
getReturnType
();
try
{
Object
obj
=
method
.
invoke
(
object
,
parameters
);
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
obj
);
}
returnObject
=
obj
;
}
catch
(
IllegalArgumentException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
Throwable
t
=
e
.
getTargetException
();
player
.
log
(
"> "
+
t
.
toString
());
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
player
);
}
}
}
public
String
toString
()
{
StringBuffer
buff
=
new
StringBuffer
();
if
(
assignment
)
{
buff
.
append
(
assignClass
);
buff
.
append
(
' '
);
buff
.
append
(
assignVariable
);
buff
.
append
(
'='
);
}
if
(
staticCall
)
{
buff
.
append
(
staticCallClass
);
}
else
{
buff
.
append
(
objectName
);
}
buff
.
append
(
'.'
);
buff
.
append
(
methodName
);
buff
.
append
(
'('
);
for
(
int
i
=
0
;
args
!=
null
&&
i
<
args
.
length
;
i
++)
{
if
(
i
>
0
)
{
buff
.
append
(
", "
);
}
buff
.
append
(
args
[
i
].
toString
());
}
buff
.
append
(
");"
);
return
buff
.
toString
();
}
Class
getReturnClass
()
{
return
returnClass
;
}
Object
getReturnObject
()
{
return
returnObject
;
}
void
setAssign
(
String
className
,
String
variableName
)
{
this
.
assignment
=
true
;
this
.
assignClass
=
className
;
this
.
assignVariable
=
variableName
;
}
void
setStaticCall
(
String
className
)
{
this
.
staticCall
=
true
;
this
.
staticCallClass
=
className
;
}
void
setMethodCall
(
String
objectName
,
Object
object
,
String
methodName
)
{
this
.
objectName
=
objectName
;
this
.
object
=
object
;
this
.
methodName
=
methodName
;
}
public
void
setArgs
(
ArrayList
list
)
{
args
=
new
Arg
[
list
.
size
()];
list
.
toArray
(
args
);
}
}
/*
* 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
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* 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 obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
h2
.
test
.
trace
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.util.ArrayList
;
/**
* Represents a statement (a single line in the log file).
*
* @author Thomas Mueller
*
*/
class
Statement
{
private
Player
player
;
private
boolean
assignment
;
private
String
assignClass
;
private
String
assignVariable
;
private
boolean
staticCall
;
private
String
staticCallClass
;
private
String
objectName
;
private
Object
object
;
private
String
methodName
;
private
Arg
[]
args
;
private
Class
[]
parameterTypes
;
private
Object
[]
parameters
;
private
Method
method
;
private
Class
returnClass
;
private
Object
returnObject
;
Statement
(
Player
player
)
{
this
.
player
=
player
;
}
private
Method
findMethod
(
Class
clazz
)
throws
Exception
{
if
((
clazz
.
getModifiers
()
&
Modifier
.
PUBLIC
)
==
0
)
{
// http://forum.java.sun.com/thread.jspa?threadID=704100&messageID=4084720
// bug 4071957
Class
[]
interfaces
=
clazz
.
getInterfaces
();
for
(
int
i
=
0
;
i
<
interfaces
.
length
;
i
++)
{
Class
c
=
interfaces
[
i
];
if
(
c
.
getName
().
startsWith
(
"javax."
))
{
try
{
return
c
.
getMethod
(
methodName
,
parameterTypes
);
}
catch
(
Exception
e
)
{
// TODO this is slow, but a workaround for a JVM bug
}
}
}
}
try
{
return
clazz
.
getMethod
(
methodName
,
parameterTypes
);
}
catch
(
NoSuchMethodException
e
)
{
Method
[]
methods
=
clazz
.
getMethods
();
methods:
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
Method
m
=
methods
[
i
];
if
(
methodName
.
equals
(
m
.
getName
()))
{
Class
[]
argClasses
=
m
.
getParameterTypes
();
for
(
int
j
=
0
;
j
<
args
.
length
;
j
++)
{
if
(!
argClasses
[
j
].
isAssignableFrom
(
args
[
j
].
getValueClass
()))
{
continue
methods
;
}
}
return
m
;
}
}
}
throw
new
Error
(
"Method with args not found: "
+
clazz
.
getName
()
+
"."
+
methodName
+
" args: "
+
args
.
length
);
}
void
execute
()
throws
Exception
{
if
(
object
==
player
)
{
// there was an exception previously
player
.
log
(
"> "
+
assignVariable
+
" not set"
);
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
player
);
}
return
;
}
Class
clazz
;
if
(
staticCall
)
{
if
(
staticCallClass
==
null
||
staticCallClass
.
length
()
==
0
)
{
player
.
log
(
"?class? "
+
staticCallClass
);
}
clazz
=
Player
.
getClass
(
staticCallClass
);
}
else
{
clazz
=
object
.
getClass
();
}
parameterTypes
=
new
Class
[
args
.
length
];
parameters
=
new
Object
[
args
.
length
];
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
Arg
arg
=
args
[
i
];
arg
.
execute
();
parameterTypes
[
i
]
=
arg
.
getValueClass
();
parameters
[
i
]
=
arg
.
getValue
();
}
method
=
findMethod
(
clazz
);
returnClass
=
method
.
getReturnType
();
try
{
Object
obj
=
method
.
invoke
(
object
,
parameters
);
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
obj
);
}
returnObject
=
obj
;
}
catch
(
IllegalArgumentException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
Throwable
t
=
e
.
getTargetException
();
player
.
log
(
"> "
+
t
.
toString
());
if
(
assignment
)
{
player
.
assign
(
assignVariable
,
player
);
}
}
}
public
String
toString
()
{
StringBuffer
buff
=
new
StringBuffer
();
if
(
assignment
)
{
buff
.
append
(
assignClass
);
buff
.
append
(
' '
);
buff
.
append
(
assignVariable
);
buff
.
append
(
'='
);
}
if
(
staticCall
)
{
buff
.
append
(
staticCallClass
);
}
else
{
buff
.
append
(
objectName
);
}
buff
.
append
(
'.'
);
buff
.
append
(
methodName
);
buff
.
append
(
'('
);
for
(
int
i
=
0
;
args
!=
null
&&
i
<
args
.
length
;
i
++)
{
if
(
i
>
0
)
{
buff
.
append
(
", "
);
}
buff
.
append
(
args
[
i
].
toString
());
}
buff
.
append
(
");"
);
return
buff
.
toString
();
}
Class
getReturnClass
()
{
return
returnClass
;
}
Object
getReturnObject
()
{
return
returnObject
;
}
void
setAssign
(
String
className
,
String
variableName
)
{
this
.
assignment
=
true
;
this
.
assignClass
=
className
;
this
.
assignVariable
=
variableName
;
}
void
setStaticCall
(
String
className
)
{
this
.
staticCall
=
true
;
this
.
staticCallClass
=
className
;
}
void
setMethodCall
(
String
objectName
,
Object
object
,
String
methodName
)
{
this
.
objectName
=
objectName
;
this
.
object
=
object
;
this
.
methodName
=
methodName
;
}
public
void
setArgs
(
ArrayList
list
)
{
args
=
new
Arg
[
list
.
size
()];
list
.
toArray
(
args
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论