Search in sources :

Example 1 with FloatColumn

use of org.apache.jena.jdbc.results.metadata.columns.FloatColumn in project jena by apache.

the class TestMetaResultSet method meta_result_set_float_02.

/**
     * Test retrieving meta column values
     * 
     * @throws SQLException
     */
@Test
public void meta_result_set_float_02() throws SQLException {
    MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new FloatColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
    Assert.assertTrue(results.next());
    float value = results.getFloat(1);
    Assert.assertEquals(0f, value, 0f);
    Assert.assertTrue(results.wasNull());
    Assert.assertFalse(results.next());
    results.close();
    Assert.assertTrue(results.isClosed());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) FloatColumn(org.apache.jena.jdbc.results.metadata.columns.FloatColumn) Test(org.junit.Test)

Example 2 with FloatColumn

use of org.apache.jena.jdbc.results.metadata.columns.FloatColumn 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());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) FloatColumn(org.apache.jena.jdbc.results.metadata.columns.FloatColumn) Test(org.junit.Test)

Aggregations

MetaResultSet (org.apache.jena.jdbc.metadata.results.MetaResultSet)2 FloatColumn (org.apache.jena.jdbc.results.metadata.columns.FloatColumn)2 Test (org.junit.Test)2