提交 546872b7 authored 作者: Thomas Mueller's avatar Thomas Mueller

Connection-created Clob and Blob objects can now be filled using…

Connection-created Clob and Blob objects can now be filled using Clob.setCharacterStream(1), Clob.setString(1, s), Blob.setBytes(1, x), Blob.setBinaryStream(1). Issue 235.
上级 8ac34844
...@@ -40,6 +40,7 @@ public class TestLob extends TestBase { ...@@ -40,6 +40,7 @@ public class TestLob extends TestBase {
conn = getConnection("lob"); conn = getConnection("lob");
stat = conn.createStatement(); stat = conn.createStatement();
stat.execute("create table test(id int, x blob)"); stat.execute("create table test(id int, x blob)");
//## Java 1.6 begin ##
testBlob(0); testBlob(0);
testBlob(1); testBlob(1);
testBlob(100); testBlob(100);
...@@ -50,9 +51,12 @@ public class TestLob extends TestBase { ...@@ -50,9 +51,12 @@ public class TestLob extends TestBase {
testClob(1); testClob(1);
testClob(100); testClob(100);
testClob(100000); testClob(100000);
//## Java 1.6 end ##
stat.execute("drop table test");
conn.close(); conn.close();
} }
//## Java 1.6 begin ##
private void testBlob(int length) throws Exception { private void testBlob(int length) throws Exception {
Random r = new Random(length); Random r = new Random(length);
byte[] data = new byte[length]; byte[] data = new byte[length];
...@@ -129,5 +133,6 @@ public class TestLob extends TestBase { ...@@ -129,5 +133,6 @@ public class TestLob extends TestBase {
s2 = c2.getSubString(1, length); s2 = c2.getSubString(1, length);
assertEquals(s, s2); assertEquals(s, s2);
} }
//## Java 1.6 end ##
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论