本文整理汇总了Java中javax.sql.rowset.serial.SQLInputImpl.readObject方法的典型用法代码示例。如果您正苦于以下问题:Java SQLInputImpl.readObject方法的具体用法?Java SQLInputImpl.readObject怎么用?Java SQLInputImpl.readObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.serial.SQLInputImpl
的用法示例。
在下文中一共展示了SQLInputImpl.readObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReadObject
import javax.sql.rowset.serial.SQLInputImpl; //导入方法依赖的package包/类
/**
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readObject()}
*/
public void testReadObject() throws SQLException {
Object[] structAttributes = { "hello", Boolean.TRUE, "abc",
Integer.valueOf(99) };
Struct struct = new MockStruct(structAttributes,
"harmonytests.MockSQLData");
Struct struct2 = new MockStruct(structAttributes, "not stored name");
HashMap<String, Class<?>> types = new HashMap<String, Class<?>>();
types.put("harmonytests.MockSQLData", MockSQLData.class);
Object[] attributes = new Object[] { struct, struct2, null, "xyz" };
SQLInputImpl impl = new SQLInputImpl(attributes, types);
Object obj = impl.readObject();
assertTrue(obj instanceof MockSQLData);
MockSQLData sqlData = (MockSQLData) obj;
assertEquals(structAttributes[0], sqlData.firstAttribute);
assertEquals(structAttributes[1], sqlData.secondAttribute);
assertEquals(structAttributes[2], sqlData.thirdAttribute);
assertEquals(structAttributes[3], sqlData.fourthAttribute);
Object obj2 = impl.readObject();
assertEquals(struct2, obj2);
Object obj3 = impl.readObject();
assertNull(obj3);
Object obj4 = impl.readObject();
assertEquals(attributes[3], obj4);
}
示例2: test05
import javax.sql.rowset.serial.SQLInputImpl; //导入方法依赖的package包/类
@Test()
public void test05() throws Exception {
Object[] values = {hero};
SQLInputImpl sqli = new SQLInputImpl(values, map);
Object o = sqli.readObject();
assertTrue(hero.equals(o));
}
示例3: test11
import javax.sql.rowset.serial.SQLInputImpl; //导入方法依赖的package包/类
@Test()
public void test11() throws Exception {
Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
"Batman"};
map.put(sqlType, Class.forName("util.SuperHero"));
Struct struct = new StubStruct(sqlType, attributes);
Object[] values = {struct};
SQLInputImpl sqli = new SQLInputImpl(values, map);
Object o = sqli.readObject();
assertTrue(hero.equals(o));
}