use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_time_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_time_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new TimeColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
Time value = results.getTime(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_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_short_integer_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ShortIntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { (short) 1234 } });
Assert.assertTrue(results.next());
short value = results.getShort(1);
Assert.assertEquals((short) 1234, value);
Assert.assertFalse(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 empty_meta_result_set_02.
/**
* Check empty meta result set with a single column
*
* @throws SQLException
*/
@Test
public void empty_meta_result_set_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new StringColumn("Test", ResultSetMetaData.columnNullable) });
// Check results metadata
ResultSetMetaData metadata = results.getMetaData();
Assert.assertEquals(1, metadata.getColumnCount());
// Check results
Assert.assertTrue(results.isBeforeFirst());
Assert.assertFalse(results.next());
Assert.assertTrue(results.isAfterLast());
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_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.metadata.results.MetaResultSet 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