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

In the server mode, BLOB and CLOB objects are no longer closed when the result…

In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec).
上级 3a7317fa
......@@ -468,7 +468,7 @@ public class TestLob extends TestBase {
PreparedStatement prep = conn.prepareStatement("insert into test values(2, ?)");
if (stream) {
String large = new String(new char[1024 * 1024 * 2]).replace((char) 0, 'x');
prep.setCharacterStream(1, new StringReader(large));
prep.setCharacterStream(1, new StringReader(large), -1);
large = null;
prep.execute();
} else {
......
......@@ -82,10 +82,10 @@ public class TestLobApi extends TestBase {
chars[i] = (char) r.nextInt(10000);
}
String d = new String(chars);
prep.setCharacterStream(1, new StringReader(d));
prep.setCharacterStream(1, new StringReader(d), -1);
byte[] bytes = new byte[100000];
r.nextBytes(bytes);
prep.setBinaryStream(2, new ByteArrayInputStream(bytes));
prep.setBinaryStream(2, new ByteArrayInputStream(bytes), -1);
prep.execute();
conn.setAutoCommit(false);
ResultSet rs = stat.executeQuery("select * from test order by id");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论