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


Java SerialArray类代码示例

本文整理汇总了Java中javax.sql.rowset.serial.SerialArray的典型用法代码示例。如果您正苦于以下问题:Java SerialArray类的具体用法?Java SerialArray怎么用?Java SerialArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SerialArray类属于javax.sql.rowset.serial包,在下文中一共展示了SerialArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAdvancedParameters

import javax.sql.rowset.serial.SerialArray; //导入依赖的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

示例2: test04

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(enabled = true)
public void test04() throws Exception {
    Object[] coffees = new Object[]{"Espresso", "Colombian", "French Roast",
        "Cappuccino"};
    Array a = new StubArray("VARCHAR", coffees);
    outImpl.writeArray(a);
    SerialArray sa = (SerialArray) results.get(0);
    assertTrue(Arrays.equals(coffees, (Object[]) sa.getArray()));
    assertTrue(a.getBaseTypeName().equals(sa.getBaseTypeName()));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:SQLOutputImplTests.java

示例3: setArray

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
public void setArray(int parameterIndex, Array x) throws SQLException {
	if (x instanceof ArrayImpl) {
		setObject(parameterIndex, x);
	} else {
		setObject(parameterIndex, new SerialArray(x));
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:8,代码来源:PreparedStatementImpl.java

示例4: setArray

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
public void setArray(int parameterIndex, Array array) throws SQLException {
    if (parameterIndex < 1) {
        throw new SQLException();
    }
    if (params == null) {
        throw new SQLException();
    }
    params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:BaseRowSet.java

示例5: testSetArray

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
public void testSetArray() throws SQLException {
    BaseRowSetImpl brs = new BaseRowSetImpl();
    brs.initParams();
    Array a = new MockArray();
    brs.setArray(1, a);
    Object[] params = brs.getParams();
    assertNotNull(params);
    assertEquals(1, params.length);
    assertTrue("Should have stored a SerialArray",
            params[0] instanceof SerialArray);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BaseRowSetTest.java

示例6: test_writeArrayLjava_sql_Array

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
/**
 * @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeArray(Array)}
 */
public void test_writeArrayLjava_sql_Array() throws SQLException {
    Array array = new MockArray();
    impl.writeArray(array);
    assertEquals(1, attr.size());
    assertTrue(attr.get(0) instanceof SerialArray);

    impl.writeArray(null);
    assertNull(attr.get(1));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:SQLOutputImplTest.java

示例7: setUp

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();
    testElements = new Object[4];
    testElements[0] = "test1";
    testElements[1] = "test2";
    testElements[2] = new SQLException();
    testElements[3] = new HashMap();
    sa = new SerialArray(mock);
    map = new HashMap<String, Class<?>>();
    map.put("String", MockStringSQLData.class);
    map.put("Object", null);
    badmap = new HashMap<String, Class<?>>();
    badmap.put("Something", HashMap.class);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:SerialArrayTest.java

示例8: test01

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test
public void test01() throws Exception {
    SerialArray sa = new SerialArray(a);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SerialArrayTests.java

示例9: test02

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SQLException.class)
public void test02() throws Exception {
    SerialArray sa = new SerialArray(a, null);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SerialArrayTests.java

示例10: test03

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test03() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例11: test04

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test04() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(null);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例12: test05

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(1, 1);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例13: test06

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test06() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(1, 1, null);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例14: test07

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SerialArrayTests.java

示例15: test08

import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray(map);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SerialArrayTests.java


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