Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b4232f24
提交
b4232f24
authored
4月 18, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved documentation
上级
e584183b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
213 行增加
和
178 行删除
+213
-178
features.html
h2/src/docsrc/html/features.html
+156
-162
Mode.java
h2/src/main/org/h2/engine/Mode.java
+10
-10
Compact.java
h2/src/test/org/h2/samples/Compact.java
+2
-1
Function.java
h2/src/test/org/h2/samples/Function.java
+38
-3
TaskProcess.java
h2/src/test/org/h2/test/db/TaskProcess.java
+5
-0
TestSampleApps.java
h2/src/test/org/h2/test/unit/TestSampleApps.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/features.html
浏览文件 @
b4232f24
差异被折叠。
点击展开。
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
b4232f24
...
@@ -44,31 +44,31 @@ public class Mode {
...
@@ -44,31 +44,31 @@ public class Mode {
/**
/**
* When converting the scale of decimal data, the number is only converted
* When converting the scale of decimal data, the number is only converted
* if the new scale is smaller th
en
current scale. Usually, the scale is
* if the new scale is smaller th
an the
current scale. Usually, the scale is
* converted and 0s are added if required.
* converted and 0s are added if required.
*/
*/
public
boolean
convertOnlyToSmallerScale
;
public
boolean
convertOnlyToSmallerScale
;
/**
/**
* Creating indexes in the CREATE TABLE statement
should be support
ed.
* Creating indexes in the CREATE TABLE statement
is allow
ed.
*/
*/
public
boolean
indexDefinitionInCreateTable
;
public
boolean
indexDefinitionInCreateTable
;
/**
/**
*
The identifiers should be returned
in lower case.
*
Meta data calls return identifiers
in lower case.
*/
*/
public
boolean
lowerCaseIdentifiers
;
public
boolean
lowerCaseIdentifiers
;
/**
/**
* Concatenation
of a NULL with another value results in NULL. Usually, the
* Concatenation
with NULL results in NULL. Usually, NULL is treated as an
*
NULL is treated as an empty string if only one of the operators is NULL,
*
empty string if only one of the operands is NULL, and NULL is only
*
and NULL is only returned if both value
s are NULL.
*
returned if both operand
s are NULL.
*/
*/
public
boolean
nullConcatIsNull
;
public
boolean
nullConcatIsNull
;
/**
/**
* When converting a floating point number to a integer, the fractional
* When converting a floating point number to a
n
integer, the fractional
* digits
should not be truncated, but the value should be
rounded.
* digits
are not truncated, but the value is
rounded.
*/
*/
public
boolean
roundWhenConvertToLong
;
public
boolean
roundWhenConvertToLong
;
...
@@ -79,12 +79,12 @@ public class Mode {
...
@@ -79,12 +79,12 @@ public class Mode {
/**
/**
* Support for the syntax [OFFSET .. ROW] [FETCH ... ONLY]
* Support for the syntax [OFFSET .. ROW] [FETCH ... ONLY]
* as an alternative
syntax
for LIMIT .. OFFSET.
* as an alternative for LIMIT .. OFFSET.
*/
*/
public
boolean
supportOffsetFetch
;
public
boolean
supportOffsetFetch
;
/**
/**
* The system columns 'CTID' and 'OID'
should b
e supported.
* The system columns 'CTID' and 'OID'
ar
e supported.
*/
*/
public
boolean
systemColumns
;
public
boolean
systemColumns
;
...
...
h2/src/test/org/h2/samples/Compact.java
浏览文件 @
b4232f24
...
@@ -49,7 +49,8 @@ public class Compact {
...
@@ -49,7 +49,8 @@ public class Compact {
* @param user the user name
* @param user the user name
* @param password the password
* @param password the password
*/
*/
public
static
void
compact
(
String
dir
,
String
dbName
,
String
user
,
String
password
)
throws
SQLException
{
public
static
void
compact
(
String
dir
,
String
dbName
,
String
user
,
String
password
)
throws
SQLException
{
String
url
=
"jdbc:h2:"
+
dir
+
"/"
+
dbName
;
String
url
=
"jdbc:h2:"
+
dir
+
"/"
+
dbName
;
String
file
=
"data/test.sql"
;
String
file
=
"data/test.sql"
;
Script
.
execute
(
url
,
user
,
password
,
file
);
Script
.
execute
(
url
,
user
,
password
,
file
);
...
...
h2/src/test/org/h2/samples/Function.java
浏览文件 @
b4232f24
...
@@ -55,9 +55,19 @@ public class Function {
...
@@ -55,9 +55,19 @@ public class Function {
new
Integer
[]
{
new
Integer
(
30
),
new
Integer
(
20
)
});
new
Integer
[]
{
new
Integer
(
30
),
new
Integer
(
20
)
});
prep
.
setObject
(
2
,
prep
.
setObject
(
2
,
new
Integer
[]
{
new
Integer
(
1
),
new
Integer
(
2
)
});
new
Integer
[]
{
new
Integer
(
1
),
new
Integer
(
2
)
});
ResultSet
rs2
=
prep
.
executeQuery
();
rs
=
prep
.
executeQuery
();
while
(
rs2
.
next
())
{
while
(
rs
.
next
())
{
System
.
out
.
println
(
rs2
.
getInt
(
1
));
System
.
out
.
println
(
rs
.
getInt
(
1
));
}
// Using a custom function like table
stat
.
execute
(
"CREATE ALIAS MATRIX FOR \"org.h2.samples.Function.getMatrix\" "
);
prep
=
conn
.
prepareStatement
(
"SELECT * FROM MATRIX(?) "
+
"ORDER BY X, Y"
);
prep
.
setInt
(
1
,
2
);
rs
=
prep
.
executeQuery
();
while
(
rs
.
next
())
{
System
.
out
.
println
(
rs
.
getInt
(
1
)
+
"/"
+
rs
.
getInt
(
2
));
}
}
conn
.
close
();
conn
.
close
();
...
@@ -97,4 +107,29 @@ public class Function {
...
@@ -97,4 +107,29 @@ public class Function {
return
rs
;
return
rs
;
}
}
/**
* Creates a simple result set with two columns.
*
* @param conn the connection
* @param size the number of x and y values
* @return the result set with two columns
*/
public
static
ResultSet
getMatrix
(
Connection
conn
,
Integer
size
)
throws
SQLException
{
SimpleResultSet
rs
=
new
SimpleResultSet
();
rs
.
addColumn
(
"X"
,
Types
.
INTEGER
,
10
,
0
);
rs
.
addColumn
(
"Y"
,
Types
.
INTEGER
,
10
,
0
);
String
url
=
conn
.
getMetaData
().
getURL
();
if
(
url
.
equals
(
"jdbc:columnlist:connection"
))
{
return
rs
;
}
for
(
int
s
=
size
.
intValue
(),
x
=
0
;
x
<
s
;
x
++)
{
for
(
int
y
=
0
;
y
<
s
;
y
++)
{
rs
.
addRow
(
new
Object
[]
{
new
Integer
(
x
),
new
Integer
(
y
)
});
}
}
return
rs
;
}
}
}
h2/src/test/org/h2/test/db/TaskProcess.java
浏览文件 @
b4232f24
...
@@ -131,6 +131,11 @@ public class TaskProcess {
...
@@ -131,6 +131,11 @@ public class TaskProcess {
process
.
destroy
();
process
.
destroy
();
}
}
/**
* Trace the operation. Tracing is disabled by default.
*
* @param s the string to print
*/
private
void
traceOperation
(
String
s
)
{
private
void
traceOperation
(
String
s
)
{
// ignore
// ignore
}
}
...
...
h2/src/test/org/h2/test/unit/TestSampleApps.java
浏览文件 @
b4232f24
...
@@ -46,7 +46,7 @@ public class TestSampleApps extends TestBase {
...
@@ -46,7 +46,7 @@ public class TestSampleApps extends TestBase {
+
"PHONE: +41123456789\n\n"
+
"NAME: John Jones\n"
+
"EMAIL: john.jones@abcde.abc\n"
+
"PHONE: +41123456789\n\n"
+
"NAME: John Jones\n"
+
"EMAIL: john.jones@abcde.abc\n"
+
"PHONE: +41976543210\n"
);
+
"PHONE: +41976543210\n"
);
testApp
(
org
.
h2
.
samples
.
Function
.
class
,
null
,
testApp
(
org
.
h2
.
samples
.
Function
.
class
,
null
,
"2 is prime\n3 is prime\n5 is prime\n7 is prime\n11 is prime\n13 is prime\n17 is prime\n19 is prime\n30\n20"
);
"2 is prime\n3 is prime\n5 is prime\n7 is prime\n11 is prime\n13 is prime\n17 is prime\n19 is prime\n30\n20
\n0/0\n0/1\n1/0\n1/1
"
);
// Not compatible with PostgreSQL JDBC driver (throws a NullPointerException)
// Not compatible with PostgreSQL JDBC driver (throws a NullPointerException)
//testApp(org.h2.samples.SecurePassword.class, null, "Joe");
//testApp(org.h2.samples.SecurePassword.class, null, "Joe");
// TODO test ShowProgress (percent numbers are hardware specific)
// TODO test ShowProgress (percent numbers are hardware specific)
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
b4232f24
...
@@ -586,4 +586,4 @@ soerensen favicon glass restarts flexive fish resulted vpda mvc kotek jan
...
@@ -586,4 +586,4 @@ soerensen favicon glass restarts flexive fish resulted vpda mvc kotek jan
consistently springfuse grep signatures wrote symbolic parents caches readers
consistently springfuse grep signatures wrote symbolic parents caches readers
animate scaladoc models disadvantages vladykin sergi trims requesting
animate scaladoc models disadvantages vladykin sergi trims requesting
handing bonita placed euros embeds reliability singular unregister quotas
handing bonita placed euros embeds reliability singular unregister quotas
overall httpdocs tigris eclemma
overall httpdocs tigris eclemma separates
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论