Package org.apache.jena.jdbc.connections

Examples of org.apache.jena.jdbc.connections.JenaConnection


     *
     * @throws SQLException
     */
    @Test
    public void statement_metadata_02() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY,
                ResultSet.HOLD_CURSORS_OVER_COMMIT);

        Assert.assertEquals(ResultSet.TYPE_SCROLL_INSENSITIVE, stmt.getResultSetType());
        Assert.assertEquals(ResultSet.HOLD_CURSORS_OVER_COMMIT, stmt.getResultSetHoldability());
        Assert.assertEquals(ResultSet.CONCUR_READ_ONLY, stmt.getResultSetConcurrency());
View Full Code Here


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

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

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

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

     *
     * @throws SQLException
     */
    @Test
    public void prepared_statement_execution_03() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("DELETE WHERE { ?s ?p ?o }");

        Assert.assertEquals(0, stmt.executeUpdate());
        stmt.close();
        conn.close();
    }
View Full Code Here

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

        Assert.assertNull(stmt.getMetaData());
    }
View Full Code Here

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void prepared_statement_unsupported_setters_01() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");

        try {
            stmt.setArray(1, null);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void prepared_statement_unsupported_setters_02() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");

        try {
            stmt.setAsciiStream(1, null);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void prepared_statement_unsupported_setters_03() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");

        try {
            stmt.setAsciiStream(1, null, 0);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void prepared_statement_unsupported_setters_04() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");

        try {
            stmt.setAsciiStream(1, null, 0l);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void prepared_statement_unsupported_setters_05() throws SQLException {
        JenaConnection conn = this.getConnection();
        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");

        try {
            stmt.setBinaryStream(1, null);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.jdbc.connections.JenaConnection

Copyright © 2018 www.massapicom. 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.