use of org.apache.jena.jdbc.results.metadata.columns.DecimalColumn in project jena by apache.
the class TestMetaResultSet method meta_result_set_decimal_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_decimal_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new DecimalColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { new BigDecimal("123.4") } });
Assert.assertTrue(results.next());
BigDecimal value = results.getBigDecimal(1);
Assert.assertEquals(new BigDecimal("123.4"), value);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.results.metadata.columns.DecimalColumn in project jena by apache.
the class TestMetaResultSet method meta_result_set_decimal_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_decimal_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new DecimalColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
BigDecimal value = results.getBigDecimal(1);
Assert.assertEquals(null, value);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
Aggregations