Search in sources :

Example 1 with TimeColumn

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

Example 2 with TimeColumn

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

the class TestMetaResultSet method meta_result_set_time_01.

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

Aggregations

Time (java.sql.Time)2 MetaResultSet (org.apache.jena.jdbc.metadata.results.MetaResultSet)2 TimeColumn (org.apache.jena.jdbc.results.metadata.columns.TimeColumn)2 Test (org.junit.Test)2