Search in sources :

Example 1 with ByteColumn

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());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) ByteColumn(org.apache.jena.jdbc.results.metadata.columns.ByteColumn) Test(org.junit.Test)

Example 2 with ByteColumn

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());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) ByteColumn(org.apache.jena.jdbc.results.metadata.columns.ByteColumn) Test(org.junit.Test)

Example 3 with ByteColumn

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());
}
Also used : MetaResultSet(org.apache.jena.jdbc.metadata.results.MetaResultSet) ByteColumn(org.apache.jena.jdbc.results.metadata.columns.ByteColumn) Test(org.junit.Test)

Aggregations

MetaResultSet (org.apache.jena.jdbc.metadata.results.MetaResultSet)3 ByteColumn (org.apache.jena.jdbc.results.metadata.columns.ByteColumn)3 Test (org.junit.Test)3