Package org.apache.jena.jdbc.connections

Examples of org.apache.jena.jdbc.connections.JenaConnection.prepareStatement()


     * @throws MalformedURLException
     */
    @Test
    public void prepared_statement_setters_12() throws SQLException, MalformedURLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, new URL("http://example.org"));
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<http://example.org>"));

View Full Code Here


     * @throws URISyntaxException
     */
    @Test
    public void prepared_statement_setters_13() throws SQLException, MalformedURLException, URISyntaxException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, new URI("http://example.org"));
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<http://example.org>"));

View Full Code Here

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

        stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"));
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<http://example.org>"));

View Full Code Here

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

        stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"), Types.NVARCHAR);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("\"http://example.org\""));

View Full Code Here

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

        stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"), Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("<http://example.org>"));

View Full Code Here

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

        stmt.setObject(1, 12.3f, Types.DOUBLE);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("12.3"));
        Assert.assertFalse(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
View Full Code Here

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

        stmt.setObject(1, 12.3d, Types.DOUBLE);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("12.3"));

View Full Code Here

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

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

View Full Code Here

     * @throws SQLException
     */
    @Test
    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"));

View Full Code Here

     * @throws SQLException
     */
    @Test
    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"));

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.