当前位置: 首页>>代码示例>>Java>>正文


Java SerialClob类代码示例

本文整理汇总了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;
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:25,代码来源:SQLClause.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:SerialClobTests.java

示例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);
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:11,代码来源:JDBC4ResultSet.java

示例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}
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:34,代码来源:BaseRowSetTests.java

示例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())));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SQLOutputImplTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SerialClobTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SerialClobTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SerialClobTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SerialClobTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:SerialClobTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SerialClobTests.java

示例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())));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:SerialClobTests.java

示例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);

}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:SerialClobTests.java

示例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);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SerialClobTests.java

示例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");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SetCharacterStream.java


注:本文中的javax.sql.rowset.serial.SerialClob类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。