Java Code Examples for java.sql.CallableStatement#setFetchSize()

The following examples show how to use java.sql.CallableStatement#setFetchSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: J2EEDataSourceTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
private CallableStatement createFloatCallForStateChecking(
    int[] parameterExpectedValues, int[] CallableStatementExpectedValues,
    Connection conn, String sql) 
throws SQLException 
{
    CallableStatement s = 
        internalCreateFloatCallForStateChecking(conn, sql);
    s.setCursorName("StokeNewington");
    s.setFetchDirection(ResultSet.FETCH_REVERSE);
    s.setFetchSize(999);
    s.setMaxFieldSize(137);
    s.setMaxRows(85);

    // Callable Statement Create
    assertStatementState(
        parameterExpectedValues, CallableStatementExpectedValues, s);
    return s;
}
 
Example 2
Source File: J2EEDataSourceTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
private CallableStatement createFloatCallForStateChecking(
    int[] parameterExpectedValues, int[] CallableStatementExpectedValues,
    Connection conn, String sql) 
throws SQLException 
{
    CallableStatement s = 
        internalCreateFloatCallForStateChecking(conn, sql);
    s.setCursorName("StokeNewington");
    s.setFetchDirection(ResultSet.FETCH_REVERSE);
    s.setFetchSize(999);
    s.setMaxFieldSize(137);
    s.setMaxRows(85);

    // Callable Statement Create
    assertStatementState(
        parameterExpectedValues, CallableStatementExpectedValues, s);
    return s;
}
 
Example 3
Source File: J2EEDataSourceTest.java    From spliceengine with GNU Affero General Public License v3.0 6 votes vote down vote up
private CallableStatement createFloatCallForStateChecking(
        int[] parameterExpectedValues, int[] CallableStatementExpectedValues,
        Connection conn, String sql)
        throws SQLException
{
    CallableStatement s =
            internalCreateFloatCallForStateChecking(conn, sql);
    s.setCursorName("StokeNewington");
    s.setFetchDirection(ResultSet.FETCH_REVERSE);
    s.setFetchSize(999);
    s.setMaxFieldSize(137);
    s.setMaxRows(85);

    // Callable Statement Create
    assertStatementState(
            parameterExpectedValues, CallableStatementExpectedValues, s);
    return s;
}
 
Example 4
Source File: SWCallableStatementTest.java    From skywalking with Apache License 2.0 4 votes vote down vote up
@Test
public void testCallableStatementConfig() throws SQLException {
    CallableStatement callableStatement = swConnection.prepareCall("INSERT INTO test VALUES( ? , ?)", 1, 1);
    callableStatement.setInt(1, 1);
    callableStatement.setString(2, "a");
    callableStatement.getUpdateCount();
    callableStatement.setFetchDirection(1);
    callableStatement.getFetchDirection();
    callableStatement.getResultSetConcurrency();
    callableStatement.getResultSetType();
    callableStatement.isClosed();
    callableStatement.setPoolable(false);
    callableStatement.isPoolable();
    callableStatement.getWarnings();
    callableStatement.clearWarnings();
    callableStatement.setCursorName("test");
    callableStatement.setMaxFieldSize(11);
    callableStatement.getMaxFieldSize();
    callableStatement.setMaxRows(10);
    callableStatement.getMaxRows();
    callableStatement.getParameterMetaData();
    callableStatement.setEscapeProcessing(true);
    callableStatement.setFetchSize(1);
    callableStatement.getFetchSize();
    callableStatement.setQueryTimeout(1);
    callableStatement.getQueryTimeout();
    Connection connection = callableStatement.getConnection();

    callableStatement.execute();

    callableStatement.getMoreResults();
    callableStatement.getMoreResults(1);
    callableStatement.getResultSetHoldability();
    callableStatement.getMetaData();
    callableStatement.getResultSet();

    callableStatement.close();
    verify(mysqlCallableStatement).getUpdateCount();
    verify(mysqlCallableStatement).getMoreResults();
    verify(mysqlCallableStatement).setFetchDirection(anyInt());
    verify(mysqlCallableStatement).getFetchDirection();
    verify(mysqlCallableStatement).getResultSetType();
    verify(mysqlCallableStatement).isClosed();
    verify(mysqlCallableStatement).setPoolable(anyBoolean());
    verify(mysqlCallableStatement).getWarnings();
    verify(mysqlCallableStatement).clearWarnings();
    verify(mysqlCallableStatement).setCursorName(anyString());
    verify(mysqlCallableStatement).setMaxFieldSize(anyInt());
    verify(mysqlCallableStatement).getMaxFieldSize();
    verify(mysqlCallableStatement).setMaxRows(anyInt());
    verify(mysqlCallableStatement).getMaxRows();
    verify(mysqlCallableStatement).setEscapeProcessing(anyBoolean());
    verify(mysqlCallableStatement).getResultSetConcurrency();
    verify(mysqlCallableStatement).getResultSetConcurrency();
    verify(mysqlCallableStatement).getResultSetType();
    verify(mysqlCallableStatement).getMetaData();
    verify(mysqlCallableStatement).getParameterMetaData();
    verify(mysqlCallableStatement).getMoreResults(anyInt());
    verify(mysqlCallableStatement).setFetchSize(anyInt());
    verify(mysqlCallableStatement).getFetchSize();
    verify(mysqlCallableStatement).getQueryTimeout();
    verify(mysqlCallableStatement).setQueryTimeout(anyInt());
    verify(mysqlCallableStatement).getResultSet();
    assertThat(connection, CoreMatchers.<Connection>is(swConnection));
}