use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_string_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_string_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new StringColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
String value = results.getString(1);
Assert.assertEquals(null, value);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_short_integer_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_short_integer_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ShortIntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
short value = results.getShort(1);
Assert.assertEquals((short) 0, value);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_float_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_float_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new FloatColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { 0.123f } });
Assert.assertTrue(results.next());
float value = results.getFloat(1);
Assert.assertEquals(0.123f, value, 0f);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
Aggregations