Search in sources :

Example 6 with StringColumn

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

the class TestMetaResultSet method meta_result_set_string_02.

/**
     * Test retrieving meta column values
     * 
     * @throws SQLException
     */
@Test
public void meta_result_set_string_02() throws SQLException {
    MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new StringColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
    Assert.assertTrue(results.next());
    String value = results.getString(1);
    Assert.assertEquals(null, 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) StringColumn(org.apache.jena.jdbc.results.metadata.columns.StringColumn) Test(org.junit.Test)

Aggregations

StringColumn (org.apache.jena.jdbc.results.metadata.columns.StringColumn)6 MetaResultSet (org.apache.jena.jdbc.metadata.results.MetaResultSet)3 ColumnInfo (org.apache.jena.jdbc.results.metadata.columns.ColumnInfo)3 Test (org.junit.Test)3 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)2 SparqlColumnInfo (org.apache.jena.jdbc.results.metadata.columns.SparqlColumnInfo)2 ResultSetMetaData (java.sql.ResultSetMetaData)1 SQLException (java.sql.SQLException)1 Node (org.apache.jena.graph.Node)1 Triple (org.apache.jena.graph.Triple)1 BooleanColumn (org.apache.jena.jdbc.results.metadata.columns.BooleanColumn)1 IntegerColumn (org.apache.jena.jdbc.results.metadata.columns.IntegerColumn)1 ShortIntegerColumn (org.apache.jena.jdbc.results.metadata.columns.ShortIntegerColumn)1 Binding (org.apache.jena.sparql.engine.binding.Binding)1