提交 f24001c8 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 9d04c1e4
......@@ -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>
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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 {
try {
private static byte[] getKeyStoreBytes(KeyStore store, String password) throws IOException {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
try {
store.store(bout, KEYSTORE_PASSWORD.toCharArray());
return bout.toByteArray();
} catch (Exception e) {
throw Message.convert(e);
throw Message.convertToIOException(e);
}
return bout.toByteArray();
}
public static KeyStore getKeyStore(String password) throws SQLException {
public static KeyStore getKeyStore(String password) throws IOException {
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.convertToIOException(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) {
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);
......
......@@ -17,11 +17,11 @@ import org.h2.security.SecureSocketFactory;
public class NetUtils {
public static Socket createLoopbackSocket(int port, boolean ssl) throws SQLException {
public static Socket createLoopbackSocket(int port, boolean ssl) throws IOException {
return createSocket("127.0.0.1", port, ssl);
}
public static Socket createSocket(String server, int defaultPort, boolean ssl) throws SQLException {
public static Socket createSocket(String server, int defaultPort, boolean ssl) throws IOException {
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,25 +33,17 @@ 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);
}
}
public static Socket createSocket(InetAddress address, int port, boolean ssl) throws SQLException {
try {
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);
}
} catch (IOException e) {
throw Message.convert(e);
}
}
public static ServerSocket createServerSocket(int port, boolean ssl) throws SQLException {
......
......@@ -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);
......
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论