本文整理汇总了Java中javax.sql.rowset.serial.SerialClob.setString方法的典型用法代码示例。如果您正苦于以下问题:Java SerialClob.setString方法的具体用法?Java SerialClob.setString怎么用?Java SerialClob.setString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.serial.SerialClob
的用法示例。
在下文中一共展示了SerialClob.setString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test31
import javax.sql.rowset.serial.SerialClob; //导入方法依赖的package包/类
@Test
public void test31() throws Exception {
String val = "Hello, I am Bruce Wayne";
String val1 = "the Batman!";
String expected = "Hello, I am the Batman!";
SerialClob sc = new SerialClob(val.toCharArray());
int written = sc.setString(13, val1);
assertEquals(val1.length(), written);
assertTrue(expected.equals(sc.getSubString(1, (int) sc.length())));
}
示例2: test32
import javax.sql.rowset.serial.SerialClob; //导入方法依赖的package包/类
@Test(enabled = false)
public void test32() throws Exception {
int expectedWritten = 9;
String val = "Hi, I am Catwoman!!!!!!";
String val1 = "Hahaha the Joker, who are you?!";
String expected = "Hi, I am the Joker!";
SerialClob sc = new SerialClob(val.toCharArray());
int written = sc.setString(10, val1, 8, expectedWritten+1);
assertEquals(written, expectedWritten);
}
示例3: test12
import javax.sql.rowset.serial.SerialClob; //导入方法依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test12() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.free();
sc.setString(1, "hello");
}
示例4: test13
import javax.sql.rowset.serial.SerialClob; //导入方法依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test13() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.free();
sc.setString(1, "hello", 0, 5);
}