Search in sources :

Example 1 with LongIntegerColumn

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

the class TestMetaResultSet method meta_result_set_long_integer_02.

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

Example 2 with LongIntegerColumn

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

the class TestMetaResultSet method meta_result_set_long_integer_01.

/**
     * Test retrieving meta column values
     * 
     * @throws SQLException
     */
@Test
public void meta_result_set_long_integer_01() throws SQLException {
    MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new LongIntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { 1234l } });
    Assert.assertTrue(results.next());
    long value = results.getLong(1);
    Assert.assertEquals(1234, value);
    Assert.assertFalse(results.wasNull());
    Assert.assertFalse(results.next());
    results.close();
    Assert.assertTrue(results.isClosed());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) LongIntegerColumn(org.apache.jena.jdbc.results.metadata.columns.LongIntegerColumn) Test(org.junit.Test)

Aggregations

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