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

--no commit message

--no commit message
上级 9d04c1e4
...@@ -71,6 +71,7 @@ via PayPal: ...@@ -71,6 +71,7 @@ via PayPal:
</li><li>Jun Iyama, Japan </li><li>Jun Iyama, Japan
</li><li>Antonio Casqueiro, Portugal </li><li>Antonio Casqueiro, Portugal
</li><li>lumber-mill.co.jp, Japan </li><li>lumber-mill.co.jp, Japan
</li><li>Oliver Computing LLC, USA
</li></ul> </li></ul>
</div></td></tr></table></body></html> </div></td></tr></table></body></html>
...@@ -1130,7 +1130,7 @@ Mit Maven 2 ...@@ -1130,7 +1130,7 @@ Mit Maven 2
#Downloads #Downloads
@download_1001_h3 @download_1001_h3
#Version 1.0.61 (2007-11-09, Current) #Version 1.0.61 (2007-11-10, Current)
@download_1002_a @download_1002_a
#Windows Installer #Windows Installer
...@@ -3122,7 +3122,7 @@ Mit Maven 2 ...@@ -3122,7 +3122,7 @@ Mit Maven 2
#Download #Download
@mainWeb_1007_td @mainWeb_1007_td
#Version 1.0.61 (2007-11-09): #Version 1.0.61 (2007-11-10):
@mainWeb_1008_a @mainWeb_1008_a
#Windows Installer (2.8 MB) #Windows Installer (2.8 MB)
......
...@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency ...@@ -1130,7 +1130,7 @@ Afterwards, you can include the database in your Maven 2 project as a dependency
Downloads Downloads
@download_1001_h3 @download_1001_h3
Version 1.0.61 (2007-11-09, Current) Version 1.0.61 (2007-11-10, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application ...@@ -3122,7 +3122,7 @@ JDBC and (partial) ODBC API; Web Client application
Download Download
@mainWeb_1007_td @mainWeb_1007_td
Version 1.0.61 (2007-11-09): Version 1.0.61 (2007-11-10):
@mainWeb_1008_a @mainWeb_1008_a
Windows Installer (2.8 MB) Windows Installer (2.8 MB)
......
...@@ -1132,7 +1132,7 @@ Centralリポジトリの利用 ...@@ -1132,7 +1132,7 @@ Centralリポジトリの利用
ダウンロード ダウンロード
@download_1001_h3 @download_1001_h3
#Version 1.0.61 (2007-11-09, Current) #Version 1.0.61 (2007-11-10, Current)
@download_1002_a @download_1002_a
Windows Installer Windows Installer
...@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション ...@@ -3124,7 +3124,7 @@ JDBC、 (部分的な) ODBC API; Web クライアントアプリケーション
ダウンロード ダウンロード
@mainWeb_1007_td @mainWeb_1007_td
#Version 1.0.61 (2007-11-09): #Version 1.0.61 (2007-11-10):
@mainWeb_1008_a @mainWeb_1008_a
#Windows Installer (2.8 MB) #Windows Installer (2.8 MB)
......
...@@ -59,7 +59,7 @@ public class SecureSocketFactory { ...@@ -59,7 +59,7 @@ public class SecureSocketFactory {
return factory; return factory;
} }
public Socket createSocket(InetAddress address, int port) throws SQLException, IOException { public Socket createSocket(InetAddress address, int port) throws IOException {
Socket socket = null; Socket socket = null;
//#ifdef JDK14 //#ifdef JDK14
setKeystore(); setKeystore();
...@@ -96,17 +96,17 @@ public class SecureSocketFactory { ...@@ -96,17 +96,17 @@ public class SecureSocketFactory {
return ByteUtils.convertStringToBytes(hex); 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 { try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
store.store(bout, KEYSTORE_PASSWORD.toCharArray()); store.store(bout, KEYSTORE_PASSWORD.toCharArray());
return bout.toByteArray();
} catch (Exception e) { } 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 { try {
// The following source code can be re-generated when you have a keystore file. // 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. // This code is (hopefully) more Java version independent than using keystores directly.
...@@ -130,11 +130,11 @@ public class SecureSocketFactory { ...@@ -130,11 +130,11 @@ public class SecureSocketFactory {
// --- generated code end --- // --- generated code end ---
return store; return store;
} catch (Exception e) { } 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(); Properties p = System.getProperties();
if (p.getProperty(KEYSTORE_KEY) == null) { if (p.getProperty(KEYSTORE_KEY) == null) {
String fileName = FileUtils.getFileInUserHome(KEYSTORE); String fileName = FileUtils.getFileInUserHome(KEYSTORE);
...@@ -149,9 +149,13 @@ public class SecureSocketFactory { ...@@ -149,9 +149,13 @@ public class SecureSocketFactory {
} }
} }
if (needWrite) { if (needWrite) {
OutputStream out = FileUtils.openFileOutputStream(fileName, false); try {
out.write(data); OutputStream out = FileUtils.openFileOutputStream(fileName, false);
out.close(); out.write(data);
out.close();
} catch (SQLException e) {
throw Message.convertToIOException(e);
}
} }
String absolutePath = FileUtils.getAbsolutePath(fileName); String absolutePath = FileUtils.getAbsolutePath(fileName);
System.setProperty(KEYSTORE_KEY, absolutePath); System.setProperty(KEYSTORE_KEY, absolutePath);
......
...@@ -17,11 +17,11 @@ import org.h2.security.SecureSocketFactory; ...@@ -17,11 +17,11 @@ import org.h2.security.SecureSocketFactory;
public class NetUtils { 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); 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; int port = defaultPort;
// IPv6: RFC 2732 format is '[a:b:c:d:e:f:g:h]' or // IPv6: RFC 2732 format is '[a:b:c:d:e:f:g:h]' or
// '[a:b:c:d:e:f:g:h]:port' // '[a:b:c:d:e:f:g:h]:port'
...@@ -33,24 +33,16 @@ public class NetUtils { ...@@ -33,24 +33,16 @@ public class NetUtils {
port = MathUtils.decodeInt(server.substring(idx + 1)); port = MathUtils.decodeInt(server.substring(idx + 1));
server = server.substring(0, idx); server = server.substring(0, idx);
} }
try { InetAddress address = InetAddress.getByName(server);
InetAddress address = InetAddress.getByName(server); return createSocket(address, port, ssl);
return createSocket(address, port, ssl);
} catch (IOException e) {
throw Message.convert(e);
}
} }
public static Socket createSocket(InetAddress address, int port, boolean ssl) throws SQLException { public static Socket createSocket(InetAddress address, int port, boolean ssl) throws IOException {
try { if (ssl) {
if (ssl) { SecureSocketFactory f = SecureSocketFactory.getInstance();
SecureSocketFactory f = SecureSocketFactory.getInstance(); return f.createSocket(address, port);
return f.createSocket(address, port); } else {
} else { return new Socket(address, port);
return new Socket(address, port);
}
} catch (IOException e) {
throw Message.convert(e);
} }
} }
......
...@@ -163,6 +163,11 @@ This can be disabled by adding this to the database URL: ;DB_CLOSE_DELAY=-1 ...@@ -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 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 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) document translation (what files to translate)
Known Problems: Known Problems:
...@@ -565,16 +570,16 @@ Features of H2 ...@@ -565,16 +570,16 @@ Features of H2
// mvcc = true; // mvcc = true;
// db // db
new TestScriptSimple().runTest(this); // new TestScriptSimple().runTest(this);
new TestScript().runTest(this); // new TestScript().runTest(this);
new TestAutoRecompile().runTest(this); // new TestAutoRecompile().runTest(this);
new TestBackup().runTest(this); // new TestBackup().runTest(this);
new TestBatchUpdates().runTest(this); // new TestBatchUpdates().runTest(this);
new TestBigDb().runTest(this); // new TestBigDb().runTest(this);
new TestBigResult().runTest(this); // new TestBigResult().runTest(this);
new TestCache().runTest(this); // new TestCache().runTest(this);
new TestCases().runTest(this); // new TestCases().runTest(this);
new TestCheckpoint().runTest(this); // new TestCheckpoint().runTest(this);
new TestCluster().runTest(this); new TestCluster().runTest(this);
new TestCompatibility().runTest(this); new TestCompatibility().runTest(this);
new TestCsv().runTest(this); new TestCsv().runTest(this);
......
...@@ -47,7 +47,6 @@ public class TestCluster extends TestBase { ...@@ -47,7 +47,6 @@ public class TestCluster extends TestBase {
CreateCluster.main(new String[] { "-urlSource", "jdbc:h2:file:" + baseDir + "/node1/test", "-urlTarget", CreateCluster.main(new String[] { "-urlSource", "jdbc:h2:file:" + baseDir + "/node1/test", "-urlTarget",
"jdbc:h2:file:" + baseDir + "/node2/test", "-user", "sa", "-serverlist", "jdbc:h2:file:" + baseDir + "/node2/test", "-user", "sa", "-serverlist",
"localhost:9091,localhost:9092" }); "localhost:9091,localhost:9092" });
Server n1 = org.h2.tools.Server.createTcpServer( Server n1 = org.h2.tools.Server.createTcpServer(
new String[] { "-tcpPort", "9091", "-baseDir", baseDir + "/node1" }).start(); new String[] { "-tcpPort", "9091", "-baseDir", baseDir + "/node1" }).start();
Server n2 = org.h2.tools.Server.createTcpServer( Server n2 = org.h2.tools.Server.createTcpServer(
...@@ -67,9 +66,31 @@ public class TestCluster extends TestBase { ...@@ -67,9 +66,31 @@ public class TestCluster extends TestBase {
checkNotGeneralException(e); 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", ""); conn = DriverManager.getConnection("jdbc:h2:tcp://localhost:9091,localhost:9092/test", "sa", "");
stat = conn.createStatement(); stat = conn.createStatement();
check(conn, len); 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)"); stat.execute("CREATE TABLE BOTH(ID INT)");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论