Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e98c67c8
提交
e98c67c8
authored
11月 27, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Android API support (work in progress).
上级
c4bbfa8f
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
142 行增加
和
0 行删除
+142
-0
Uri.java
h2/src/tools/android/net/Uri.java
+15
-0
package.html
h2/src/tools/android/net/package.html
+15
-0
Bundle.java
h2/src/tools/android/os/Bundle.java
+15
-0
package.html
h2/src/tools/android/os/package.html
+15
-0
Test.java
h2/src/tools/android/test/Test.java
+67
-0
package.html
h2/src/tools/android/test/package.html
+15
-0
没有找到文件。
h2/src/tools/android/net/Uri.java
0 → 100644
浏览文件 @
e98c67c8
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
android
.
net
;
/**
* TODO
*/
public
class
Uri
{
// empty
}
h2/src/tools/android/net/package.html
0 → 100644
浏览文件 @
e98c67c8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
><p>
This package contains classes that are needed to compile the H2 Android database API.
</p></body></html>
\ No newline at end of file
h2/src/tools/android/os/Bundle.java
0 → 100644
浏览文件 @
e98c67c8
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
android
.
os
;
/**
* TODO
*/
public
class
Bundle
{
// empty
}
h2/src/tools/android/os/package.html
0 → 100644
浏览文件 @
e98c67c8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
><p>
This package contains classes that are needed to compile the H2 Android database API.
</p></body></html>
\ No newline at end of file
h2/src/tools/android/test/Test.java
0 → 100644
浏览文件 @
e98c67c8
/*
* Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
android
.
test
;
import
org.h2.android.H2Database
;
import
org.h2.android.H2Utils
;
import
android.app.Activity
;
import
android.database.Cursor
;
/**
* Tests the Android API.
*/
public
class
Test
extends
Activity
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
H2Database
db
=
H2Utils
.
openOrCreateDatabase
(
"helloWorld.db"
,
MODE_PRIVATE
,
null
);
log
(
"opened ps="
+
db
.
getPageSize
());
try
{
// db.execSQL("DROP TABLE IF EXISTS test");
// log("dropped");
db
.
execSQL
(
"CREATE TABLE if not exists test(ID INTEGER PRIMARY KEY, NAME VARCHAR)"
);
log
(
"created"
);
for
(
int
j
=
0
;
j
<
10
;
j
++)
{
Cursor
c
=
db
.
rawQuery
(
"select * from test"
,
new
String
[
0
]);
int
count
=
c
.
getCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
c
.
move
(
1
);
c
.
getInt
(
0
);
c
.
getString
(
1
);
}
c
.
close
();
}
// log("select " + count);
db
.
execSQL
(
"delete from test"
);
log
(
"delete"
);
db
.
beginTransaction
();
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
db
.
execSQL
(
"INSERT INTO TEST VALUES(?, 'Hello')"
,
new
Object
[]
{
i
});
}
db
.
setTransactionSuccessful
();
db
.
endTransaction
();
log
(
"inserted"
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
Cursor
c
=
db
.
rawQuery
(
"select * from test where id=?"
,
new
String
[]
{
""
+
i
});
int
count
=
c
.
getCount
();
if
(
count
>
0
)
{
c
.
move
(
1
);
c
.
getInt
(
0
);
c
.
getString
(
1
);
}
c
.
close
();
}
log
(
"select"
);
}
finally
{
db
.
close
();
log
(
"closed"
);
}
}
private
static
void
log
(
String
s
)
{
System
.
out
.
println
(
s
);
}
}
h2/src/tools/android/test/package.html
0 → 100644
浏览文件 @
e98c67c8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2010 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
><p>
This package contains tests.
</p></body></html>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论