Examples of JenaConnection


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

     *
     * @throws SQLException
     */
    @Test(expected = SQLException.class)
    public void statememt_readonly_execute_update_04() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();
        conn.setReadOnly(true);

        try {
            stmt.executeUpdate("DELETE WHERE { ?s ?p ?o }", new String[0]);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_01() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(0, stmt.getMaxRows());
        stmt.setMaxRows(10);
        Assert.assertEquals(10, stmt.getMaxRows());
        stmt.setMaxRows(-1);
        Assert.assertEquals(0, stmt.getMaxRows());

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

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_02() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(0, stmt.getMaxFieldSize());

        // Max field size is ignored
        stmt.setMaxFieldSize(100);
        Assert.assertEquals(0, stmt.getMaxFieldSize());

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

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_03() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(0, stmt.getFetchSize());
        stmt.setFetchSize(10);
        Assert.assertEquals(10, stmt.getFetchSize());

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

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_04() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertTrue(stmt.isPoolable());

        // Poolable setting is ignored
        stmt.setPoolable(false);
        Assert.assertTrue(stmt.isPoolable());

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

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_05() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(0, stmt.getQueryTimeout());
        stmt.setQueryTimeout(10);
        Assert.assertEquals(10, stmt.getQueryTimeout());
        stmt.setQueryTimeout(-1);
        Assert.assertEquals(0, stmt.getQueryTimeout());

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

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

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void statement_settings_06() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(ResultSet.FETCH_FORWARD, stmt.getFetchDirection());
        stmt.setFetchDirection(ResultSet.FETCH_FORWARD);
        Assert.assertEquals(ResultSet.FETCH_FORWARD, stmt.getFetchDirection());
        try {
            stmt.setFetchDirection(ResultSet.FETCH_REVERSE);
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_settings_07() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        stmt.setEscapeProcessing(true);

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

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

     *
     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void statement_settings_08() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        try {
            stmt.setCursorName("test");
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

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

     *
     * @throws SQLException
     */
    @Test
    public void statement_metadata_01() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        Assert.assertEquals(ResultSet.TYPE_FORWARD_ONLY, stmt.getResultSetType());
        Assert.assertEquals(conn.getHoldability(), stmt.getResultSetHoldability());
        Assert.assertEquals(ResultSet.CONCUR_READ_ONLY, stmt.getResultSetConcurrency());
    }
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.