Search in sources :

Example 16 with ColumnInfo

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

the class TestCompatibility method test_column_type_detection_integer_04.

/**
     * Expect xsd:unsignedInteger to be typed as integers
     * @throws SQLException 
     */
@Test
public void test_column_type_detection_integer_04() throws SQLException {
    ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("1234", XSDDatatype.XSDunsignedInt), true, Types.BIGINT, Long.class.getCanonicalName());
    Assert.assertEquals(0, info.getScale());
    Assert.assertFalse(info.isSigned());
}
Also used : ColumnInfo(org.apache.jena.jdbc.results.metadata.columns.ColumnInfo) Test(org.junit.Test)

Example 17 with ColumnInfo

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

the class TestCompatibility method test_column_type_detection_integer_05.

/**
     * Expect xsd:unsignedLong to be typed as integers
     * @throws SQLException 
     */
@Test
public void test_column_type_detection_integer_05() throws SQLException {
    ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("1234", XSDDatatype.XSDunsignedLong), true, Types.BIGINT, Long.class.getCanonicalName());
    Assert.assertEquals(0, info.getScale());
    Assert.assertFalse(info.isSigned());
}
Also used : ColumnInfo(org.apache.jena.jdbc.results.metadata.columns.ColumnInfo) Test(org.junit.Test)

Aggregations

ColumnInfo (org.apache.jena.jdbc.results.metadata.columns.ColumnInfo)17 Test (org.junit.Test)12 StringColumn (org.apache.jena.jdbc.results.metadata.columns.StringColumn)3 SQLException (java.sql.SQLException)2 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)2 Node (org.apache.jena.graph.Node)2 SparqlColumnInfo (org.apache.jena.jdbc.results.metadata.columns.SparqlColumnInfo)2 BigDecimal (java.math.BigDecimal)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