本文整理汇总了Java中javax.sql.rowset.serial.SerialClob类的典型用法代码示例。如果您正苦于以下问题:Java SerialClob类的具体用法?Java SerialClob怎么用?Java SerialClob使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SerialClob类属于javax.sql.rowset.serial包,在下文中一共展示了SerialClob类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClob
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
/** Added by Jilali Raki. Needed for ROA
*
* @param csColName Column name
* @return Serial Clob data
* @throws TechnicalException
*/
public SerialClob getClob(String csColName) throws TechnicalException
{
if(m_resultSet != null)
{
try
{
Clob blVal = m_resultSet.getClob(csColName);
SerialClob sb = new SerialClob(blVal);
return sb;
}
catch (SQLException e)
{
forceCloseOnExceptionCatched();
ProgrammingException.throwException(ProgrammingException.DB_ERROR_RESULT_SET_COL_ACCESS_STRING+csColName, m_csQuery, e);
}
}
return null;
}
示例2: test37
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test(enabled = false)
public void test37() throws Exception {
SerialClob sc = new SerialClob(chars);
String expected = "ello w";
Reader r = sc.getCharacterStream(2, 6);
for (char c : expected.toCharArray()) {
char val = (char) r.read();
assertTrue(c == val, val + " does not match " + c);
}
}
示例3: getClob
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Override
public Clob getClob(int columnIndex) throws SQLException {
checkColumnBounds(columnIndex);
try {
return new SerialClob(table.getString(columnIndex - 1)
.toCharArray());
} catch (Exception x) {
throw SQLError.get(x);
}
}
示例4: testAdvancedParameters
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@DataProvider(name = "testAdvancedParameters")
private Object[][] testAdvancedParameters() throws SQLException {
byte[] bytes = new byte[10];
Ref aRef = new SerialRef(new StubRef("INTEGER", query));
Array aArray = new SerialArray(new StubArray("INTEGER", new Object[1]));
Blob aBlob = new SerialBlob(new StubBlob());
Clob aClob = new SerialClob(new StubClob());
Reader rdr = new StringReader(query);
InputStream is = new StringBufferInputStream(query);;
brs = new StubBaseRowSet();
brs.setBytes(1, bytes);
brs.setAsciiStream(2, is, query.length());
brs.setRef(3, aRef);
brs.setArray(4, aArray);
brs.setBlob(5, aBlob);
brs.setClob(6, aClob);
brs.setBinaryStream(7, is, query.length());
brs.setUnicodeStream(8, is, query.length());
brs.setCharacterStream(9, rdr, query.length());
return new Object[][]{
{1, bytes},
{2, is},
{3, aRef},
{4, aArray},
{5, aBlob},
{6, aClob},
{7, is},
{8, is},
{9, rdr}
};
}
示例5: test06
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test(enabled = true)
public void test06() throws Exception {
Clob c = new StubClob();
outImpl.writeClob(c);
SerialClob sc = (SerialClob) results.get(0);
assertTrue(c.getSubString(1,
(int) c.length()).equals(sc.getSubString(1, (int) sc.length())));
}
示例6: test25
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test25() throws Exception {
long expectedPos = 5;
SerialClob sc = new SerialClob(new StubClob());
String expected = "test string";
long pos = sc.position(expected, 1);
assertEquals(expectedPos, pos);
}
示例7: test26
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test26() throws Exception {
long expectedPos = -1;
SerialClob sc = new SerialClob(chars);
String expected = "test string";
long pos = sc.position(expected, 1);
assertEquals(expectedPos, pos);
}
示例8: test27
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test27() throws Exception {
long expectedPos = -1;
SerialClob sc = new SerialClob(new StubClob());
String expected = "I am Batman";
long pos = sc.position(expected, 2);
assertEquals(expectedPos, pos);
}
示例9: test28
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test28() throws Exception {
long expectedPos = 2;
SerialClob sc = new SerialClob(chars);
String expected = "ello";
long pos = sc.position(expected, 1);
assertEquals(expectedPos, pos);
}
示例10: test29
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test29() throws Exception {
long expectedPos = 21;
String expected = "Batman";
String buf = "I am Joker, not the Batman, hahaha";
SerialClob sc = new SerialClob(expected.toCharArray());
SerialClob sc1 = new SerialClob(buf.toCharArray());
long pos = sc1.position(sc, 1);
assertEquals(expectedPos, pos);
}
示例11: test30
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test30() throws Exception {
long expectedPos = 17;
String expected = "012";
SerialClob sc = new SerialClob(expected.toCharArray());
SerialClob sc1 = new SerialClob(new StubClob());
long pos = sc1.position(sc, 1);
assertEquals(expectedPos, pos);
}
示例12: 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())));
}
示例13: 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);
}
示例14: test36
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
@Test
public void test36() throws Exception {
SerialClob sc = new SerialClob(chars);
Reader r = sc.getCharacterStream();
for (char c : chars) {
char val = (char) r.read();
assertTrue(c == val, val + " does not match " + c);
}
}
示例15: main
import javax.sql.rowset.serial.SerialClob; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SerialClob clob = new SerialClob(new char[0]);
try {
clob.setCharacterStream(0);
} catch (SerialException e) {
System.out.println("Test PASSED");
}
}