Java 类javax.sql.rowset.serial.SerialClob 实例源码

项目:ChronoBike    文件:SQLClause.java   
/** 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;
}
项目:ChronoBike    文件:SQLClause.java   
/**Added by Jilali Raki. Needed for ROA
 * 
 * @param nColNumber  Column number
 * @return Serial Clob data
 * @throws TechnicalException
 */
public SerialClob getClob(int nColNumber) throws TechnicalException
{       
    if(m_resultSet != null)
    {
        try
        {
            Clob blVal = m_resultSet.getClob(nColNumber);
            SerialClob sb = new SerialClob(blVal); 
            return sb;
        }
        catch (SQLException e)
        {
            forceCloseOnExceptionCatched();
            ProgrammingException.throwException(ProgrammingException.DB_ERROR_RESULT_SET_COL_ACCESS_INT+nColNumber, m_csQuery, e);
        }           
    }
    return null;
}
项目:sstore-soft    文件:JDBC4ResultSet.java   
@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);
    }
}
项目:s-store    文件:JDBC4ResultSet.java   
@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);
    }
}
项目:jdk8u-jdk    文件:BaseRowSetTests.java   
@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}
    };
}
项目:jdk8u-jdk    文件:SQLOutputImplTests.java   
@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())));
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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())));
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);

}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
    }
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@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);
    }
}
项目:jdk8u-jdk    文件:SetCharacterStream.java   
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");
    }
}
项目:jdk8u-jdk    文件:SetAsciiStream.java   
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setAsciiStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
项目:openjdk-jdk10    文件:BaseRowSetTests.java   
@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}
    };
}
项目:openjdk-jdk10    文件:SQLOutputImplTests.java   
@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())));
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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())));
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);

}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
    }
}
项目:openjdk-jdk10    文件:SerialClobTests.java   
@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);
    }
}
项目:openjdk-jdk10    文件:SetCharacterStream.java   
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");
    }
}
项目:openjdk-jdk10    文件:SetAsciiStream.java   
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setAsciiStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
项目:openjdk9    文件:BaseRowSetTests.java   
@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}
    };
}
项目:openjdk9    文件:SQLOutputImplTests.java   
@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())));
}
项目:lookaside_java-1.8.0-openjdk    文件:SerialClobTests.java   
@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);
}
项目:openjdk9    文件:SerialClobTests.java   
@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);
}
项目:openjdk9    文件:SerialClobTests.java   
@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);
}
项目:openjdk9    文件:SerialClobTests.java   
@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);
}
项目:openjdk9    文件:SerialClobTests.java   
@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);
}
项目:openjdk9    文件:SerialClobTests.java   
@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);
}