本文整理汇总了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}
};
}
示例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()));
}
示例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));
}
}
示例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));
}
示例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);
}
示例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));
}
示例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);
}
示例8: test01
import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test
public void test01() throws Exception {
SerialArray sa = new SerialArray(a);
}
示例9: test02
import javax.sql.rowset.serial.SerialArray; //导入依赖的package包/类
@Test(expectedExceptions = SQLException.class)
public void test02() throws Exception {
SerialArray sa = new SerialArray(a, null);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}