Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f24001c8
提交
f24001c8
authored
11月 19, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
9d04c1e4
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
69 行增加
和
46 行删除
+69
-46
history.html
h2/src/docsrc/html/history.html
+1
-0
_docs_de.utf8.txt
h2/src/docsrc/text/_docs_de.utf8.txt
+2
-2
_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
SecureSocketFactory.java
h2/src/main/org/h2/security/SecureSocketFactory.java
+15
-11
NetUtils.java
h2/src/main/org/h2/util/NetUtils.java
+10
-18
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+15
-10
TestCluster.java
h2/src/test/org/h2/test/db/TestCluster.java
+22
-1
没有找到文件。
h2/src/docsrc/html/history.html
浏览文件 @
f24001c8
...
...
@@ -71,6 +71,7 @@ via PayPal:
</li><li>
Jun Iyama, Japan
</li><li>
Antonio Casqueiro, Portugal
</li><li>
lumber-mill.co.jp, Japan
</li><li>
Oliver Computing LLC, USA
</li></ul>
</div></td></tr></table></body></html>
h2/src/docsrc/text/_docs_de.utf8.txt
浏览文件 @
f24001c8
...
...
@@ -1130,7 +1130,7 @@ Mit Maven 2
#Downloads
@download_1001_h3
#Version 1.0.61 (2007-11-
09
, Current)
#Version 1.0.61 (2007-11-
10
, Current)
@download_1002_a
#Windows Installer
...
...
@@ -3122,7 +3122,7 @@ Mit Maven 2
#Download
@mainWeb_1007_td
#Version 1.0.61 (2007-11-
09
):
#Version 1.0.61 (2007-11-
10
):
@mainWeb_1008_a
#Windows Installer (2.8 MB)
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
f24001c8
...
...
@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
Downloads
@download_1001_h3
Version 1.0.61 (2007-11-
09
, Current)
Version 1.0.61 (2007-11-
10
, Current)
@download_1002_a
Windows Installer
...
...
@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
Download
@mainWeb_1007_td
Version 1.0.61 (2007-11-
09
):
Version 1.0.61 (2007-11-
10
):
@mainWeb_1008_a
Windows Installer (2.8 MB)
...
...
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
f24001c8
...
...
@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
ダウンロード
@download_1001_h3
#Version 1.0.61 (2007-11-
09
, Current)
#Version 1.0.61 (2007-11-
10
, Current)
@download_1002_a
Windows Installer
...
...
@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード
@mainWeb_1007_td
#Version 1.0.61 (2007-11-
09
):
#Version 1.0.61 (2007-11-
10
):
@mainWeb_1008_a
#Windows Installer (2.8 MB)
...
...
h2/src/main/org/h2/security/SecureSocketFactory.java
浏览文件 @
f24001c8
...
...
@@ -59,7 +59,7 @@ public class SecureSocketFactory {
return
factory
;
}
public
Socket
createSocket
(
InetAddress
address
,
int
port
)
throws
SQLException
,
IOException
{
public
Socket
createSocket
(
InetAddress
address
,
int
port
)
throws
IOException
{
Socket
socket
=
null
;
//#ifdef JDK14
setKeystore
();
...
...
@@ -96,17 +96,17 @@ public class SecureSocketFactory {
return
ByteUtils
.
convertStringToBytes
(
hex
);
}
private
static
byte
[]
getKeyStoreBytes
(
KeyStore
store
,
String
password
)
throws
SQLException
{
private
static
byte
[]
getKeyStoreBytes
(
KeyStore
store
,
String
password
)
throws
IOException
{
ByteArrayOutputStream
bout
=
new
ByteArrayOutputStream
();
try
{
ByteArrayOutputStream
bout
=
new
ByteArrayOutputStream
();
store
.
store
(
bout
,
KEYSTORE_PASSWORD
.
toCharArray
());
return
bout
.
toByteArray
();
}
catch
(
Exception
e
)
{
throw
Message
.
convert
(
e
);
throw
Message
.
convert
ToIOException
(
e
);
}
return
bout
.
toByteArray
();
}
public
static
KeyStore
getKeyStore
(
String
password
)
throws
SQL
Exception
{
public
static
KeyStore
getKeyStore
(
String
password
)
throws
IO
Exception
{
try
{
// The following source code can be re-generated when you have a keystore file.
// This code is (hopefully) more Java version independent than using keystores directly.
...
...
@@ -130,11 +130,11 @@ public class SecureSocketFactory {
// --- generated code end ---
return
store
;
}
catch
(
Exception
e
)
{
throw
Message
.
convert
(
e
);
throw
Message
.
convert
ToIOException
(
e
);
}
}
private
void
setKeystore
()
throws
IOException
,
SQLException
{
private
void
setKeystore
()
throws
IOException
{
Properties
p
=
System
.
getProperties
();
if
(
p
.
getProperty
(
KEYSTORE_KEY
)
==
null
)
{
String
fileName
=
FileUtils
.
getFileInUserHome
(
KEYSTORE
);
...
...
@@ -149,9 +149,13 @@ public class SecureSocketFactory {
}
}
if
(
needWrite
)
{
OutputStream
out
=
FileUtils
.
openFileOutputStream
(
fileName
,
false
);
out
.
write
(
data
);
out
.
close
();
try
{
OutputStream
out
=
FileUtils
.
openFileOutputStream
(
fileName
,
false
);
out
.
write
(
data
);
out
.
close
();
}
catch
(
SQLException
e
)
{
throw
Message
.
convertToIOException
(
e
);
}
}
String
absolutePath
=
FileUtils
.
getAbsolutePath
(
fileName
);
System
.
setProperty
(
KEYSTORE_KEY
,
absolutePath
);
...
...
h2/src/main/org/h2/util/NetUtils.java
浏览文件 @
f24001c8
...
...
@@ -17,11 +17,11 @@ import org.h2.security.SecureSocketFactory;
public
class
NetUtils
{
public
static
Socket
createLoopbackSocket
(
int
port
,
boolean
ssl
)
throws
SQL
Exception
{
public
static
Socket
createLoopbackSocket
(
int
port
,
boolean
ssl
)
throws
IO
Exception
{
return
createSocket
(
"127.0.0.1"
,
port
,
ssl
);
}
public
static
Socket
createSocket
(
String
server
,
int
defaultPort
,
boolean
ssl
)
throws
SQL
Exception
{
public
static
Socket
createSocket
(
String
server
,
int
defaultPort
,
boolean
ssl
)
throws
IO
Exception
{
int
port
=
defaultPort
;
// IPv6: RFC 2732 format is '[a:b:c:d:e:f:g:h]' or
// '[a:b:c:d:e:f:g:h]:port'
...
...
@@ -33,24 +33,16 @@ public class NetUtils {
port
=
MathUtils
.
decodeInt
(
server
.
substring
(
idx
+
1
));
server
=
server
.
substring
(
0
,
idx
);
}
try
{
InetAddress
address
=
InetAddress
.
getByName
(
server
);
return
createSocket
(
address
,
port
,
ssl
);
}
catch
(
IOException
e
)
{
throw
Message
.
convert
(
e
);
}
InetAddress
address
=
InetAddress
.
getByName
(
server
);
return
createSocket
(
address
,
port
,
ssl
);
}
public
static
Socket
createSocket
(
InetAddress
address
,
int
port
,
boolean
ssl
)
throws
SQLException
{
try
{
if
(
ssl
)
{
SecureSocketFactory
f
=
SecureSocketFactory
.
getInstance
();
return
f
.
createSocket
(
address
,
port
);
}
else
{
return
new
Socket
(
address
,
port
);
}
}
catch
(
IOException
e
)
{
throw
Message
.
convert
(
e
);
public
static
Socket
createSocket
(
InetAddress
address
,
int
port
,
boolean
ssl
)
throws
IOException
{
if
(
ssl
)
{
SecureSocketFactory
f
=
SecureSocketFactory
.
getInstance
();
return
f
.
createSocket
(
address
,
port
);
}
else
{
return
new
Socket
(
address
,
port
);
}
}
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
f24001c8
...
...
@@ -163,6 +163,11 @@ This can be disabled by adding this to the database URL: ;DB_CLOSE_DELAY=-1
That means to keep the contents of an in-memory database as long as the virtual machine is alive, use
jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
History:
The default value for h2.emergencySpaceInitial is now 256 KB (to speed up creating encrypted databases)
Eduardo Velasques has translated the H2 Console and the error messages to Brazilian Portuguese. Thanks a lot!
Creating a table from GROUP_CONCAT didn't work if the data was longer than 255 characters
document translation (what files to translate)
Known Problems:
...
...
@@ -565,16 +570,16 @@ Features of H2
// mvcc = true;
// db
new
TestScriptSimple
().
runTest
(
this
);
new
TestScript
().
runTest
(
this
);
new
TestAutoRecompile
().
runTest
(
this
);
new
TestBackup
().
runTest
(
this
);
new
TestBatchUpdates
().
runTest
(
this
);
new
TestBigDb
().
runTest
(
this
);
new
TestBigResult
().
runTest
(
this
);
new
TestCache
().
runTest
(
this
);
new
TestCases
().
runTest
(
this
);
new
TestCheckpoint
().
runTest
(
this
);
//
new TestScriptSimple().runTest(this);
//
new TestScript().runTest(this);
//
new TestAutoRecompile().runTest(this);
//
new TestBackup().runTest(this);
//
new TestBatchUpdates().runTest(this);
//
new TestBigDb().runTest(this);
//
new TestBigResult().runTest(this);
//
new TestCache().runTest(this);
//
new TestCases().runTest(this);
//
new TestCheckpoint().runTest(this);
new
TestCluster
().
runTest
(
this
);
new
TestCompatibility
().
runTest
(
this
);
new
TestCsv
().
runTest
(
this
);
...
...
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
f24001c8
...
...
@@ -47,7 +47,6 @@ public class TestCluster extends TestBase {
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-serverlist"
,
"localhost:9091,localhost:9092"
});
Server
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
new
String
[]
{
"-tcpPort"
,
"9091"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
Server
n2
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
...
...
@@ -67,9 +66,31 @@ public class TestCluster extends TestBase {
checkNotGeneralException
(
e
);
}
// test regular cluster connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9091,localhost:9092/test"
,
"sa"
,
""
);
check
(
conn
,
len
);
conn
.
close
();
// test if only one server is available at the beginning
n2
.
stop
();
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9091,localhost:9092/test"
,
"sa"
,
""
);
stat
=
conn
.
createStatement
();
check
(
conn
,
len
);
conn
.
close
();
// disable the cluster
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9091/test;CLUSTER=''"
,
"sa"
,
""
);
conn
.
close
();
n1
.
stop
();
// re-create the cluster
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-serverlist"
,
"localhost:9091,localhost:9092"
});
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
new
String
[]
{
"-tcpPort"
,
"9091"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
n2
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
new
String
[]
{
"-tcpPort"
,
"9092"
,
"-baseDir"
,
baseDir
+
"/node2"
}).
start
();
stat
.
execute
(
"CREATE TABLE BOTH(ID INT)"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论