Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a4bf608a
提交
a4bf608a
authored
3月 10, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Issue 176: the JdbcDataSource now also supports a 'description' property.
上级
1d018117
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
1 行删除
+29
-1
changelog.html
h2/src/docsrc/html/changelog.html
+4
-1
JdbcDataSource.java
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
+22
-0
JdbcDataSourceFactory.java
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
+1
-0
TestDataSource.java
h2/src/test/org/h2/test/jdbcx/TestDataSource.java
+2
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
a4bf608a
...
...
@@ -18,7 +18,10 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
The Shell tool threw a IndexOutOfBoundsException after 20 statements.
<ul><li>
CREATE ALIAS ... AS: Compilation was incorrect if the source code contained
characters that are not supported by the default file encoding.
</li><li>
Issue 176: the JdbcDataSource now also supports a 'description' property.
</li><li>
The Shell tool threw a IndexOutOfBoundsException after 20 statements.
</li><li>
When using the small version of H2 ('jarClient'), the first call to
Connection.createBlob (or similar) could throw a ClassNotFoundException
because the file org.h2.store.fs.FileSystemZip is not included. This missing class
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
浏览文件 @
a4bf608a
...
...
@@ -72,6 +72,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
private
String
userName
=
""
;
private
char
[]
passwordChars
=
new
char
[
0
];
private
String
url
=
""
;
private
String
description
;
static
{
org
.
h2
.
Driver
.
load
();
...
...
@@ -258,6 +259,26 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
this
.
userName
=
user
;
}
/**
* Get the current description.
*
* @return the description
*/
public
String
getDescription
()
{
debugCodeCall
(
"getDescription"
);
return
description
;
}
/**
* Set the description.
*
* @param description the new description
*/
public
void
setDescription
(
String
description
)
{
debugCodeCall
(
"getDescription"
,
description
);
this
.
description
=
description
;
}
/**
* Get a new reference for this object, using the current settings.
*
...
...
@@ -272,6 +293,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
ref
.
add
(
new
StringRefAddr
(
"user"
,
userName
));
ref
.
add
(
new
StringRefAddr
(
"password"
,
convertToString
(
passwordChars
)));
ref
.
add
(
new
StringRefAddr
(
"loginTimeout"
,
String
.
valueOf
(
loginTimeout
)));
ref
.
add
(
new
StringRefAddr
(
"description"
,
description
));
return
ref
;
}
//## Java 1.4 end ##
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
浏览文件 @
a4bf608a
...
...
@@ -68,6 +68,7 @@ implements ObjectFactory
dataSource
.
setURL
((
String
)
ref
.
get
(
"url"
).
getContent
());
dataSource
.
setUser
((
String
)
ref
.
get
(
"user"
).
getContent
());
dataSource
.
setPassword
((
String
)
ref
.
get
(
"password"
).
getContent
());
dataSource
.
setDescription
((
String
)
ref
.
get
(
"description"
).
getContent
());
String
s
=
(
String
)
ref
.
get
(
"loginTimeout"
).
getContent
();
dataSource
.
setLoginTimeout
(
Integer
.
parseInt
(
s
));
return
dataSource
;
...
...
h2/src/test/org/h2/test/jdbcx/TestDataSource.java
浏览文件 @
a4bf608a
...
...
@@ -79,6 +79,7 @@ public class TestDataSource extends TestBase {
ref
.
add
(
new
StringRefAddr
(
"user"
,
"u"
));
ref
.
add
(
new
StringRefAddr
(
"password"
,
"p"
));
ref
.
add
(
new
StringRefAddr
(
"loginTimeout"
,
"1"
));
ref
.
add
(
new
StringRefAddr
(
"description"
,
"test"
));
JdbcDataSource
ds
=
(
JdbcDataSource
)
factory
.
getObjectInstance
(
ref
,
null
,
null
,
null
);
assertEquals
(
1
,
ds
.
getLoginTimeout
());
assertEquals
(
"jdbc:h2:mem:"
,
ds
.
getURL
());
...
...
@@ -90,6 +91,7 @@ public class TestDataSource extends TestBase {
assertEquals
(
ref
.
get
(
"user"
).
getContent
().
toString
(),
ref2
.
get
(
"user"
).
getContent
().
toString
());
assertEquals
(
ref
.
get
(
"password"
).
getContent
().
toString
(),
ref2
.
get
(
"password"
).
getContent
().
toString
());
assertEquals
(
ref
.
get
(
"loginTimeout"
).
getContent
().
toString
(),
ref2
.
get
(
"loginTimeout"
).
getContent
().
toString
());
assertEquals
(
ref
.
get
(
"description"
).
getContent
().
toString
(),
ref2
.
get
(
"description"
).
getContent
().
toString
());
ds
.
setPasswordChars
(
"abc"
.
toCharArray
());
assertEquals
(
"abc"
,
ds
.
getPassword
());
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论