Examples of ParameterizedSparqlString


Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_20() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, 123, Types.BIGINT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_21() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, (short) 123, Types.BIGINT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_22() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, (byte) 123, Types.BIGINT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_23() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, Quad.defaultGraphIRI);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<urn:x-arq:DefaultGraph>"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_24() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, ModelFactory.createDefaultModel().createResource("urn:x-arq:DefaultGraph"));
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<urn:x-arq:DefaultGraph>"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        Calendar c = Calendar.getInstance();
        stmt.setObject(1, c);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_28() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setBigDecimal(1, BigDecimal.valueOf(1234, 1));
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123.4"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_29() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setBoolean(1, true);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("true"));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_30() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setByte(1, (byte) 123);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));

        stmt.close();
        conn.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.ParameterizedSparqlString

    public void prepared_statement_setters_31() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setFloat(1, 12.3f);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("12.3"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));

        stmt.close();
        conn.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.