use of org.apache.jena.jdbc.results.metadata.columns.ByteColumn in project jena by apache.
the class TestMetaResultSet method meta_result_set_byte_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_byte_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ByteColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { (byte) 0x10 } });
Assert.assertTrue(results.next());
byte value = results.getByte(1);
Assert.assertEquals(0x10, value);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.results.metadata.columns.ByteColumn in project jena by apache.
the class TestMetaResultSet method meta_result_set_byte_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_byte_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ByteColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
byte value = results.getByte(1);
Assert.assertEquals(0x0, value);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.results.metadata.columns.ByteColumn in project jena by apache.
the class TestMetaResultSet method meta_result_set_double_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_double_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ByteColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
double value = results.getDouble(1);
Assert.assertEquals(0d, value, 0d);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
Aggregations