Java Code Examples for java.sql.Statement.CLOSE_CURRENT_RESULT

The following are Jave code examples for showing how to use CLOSE_CURRENT_RESULT of the java.sql.Statement class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: sstore-soft   File: JDBC4Statement.java   Source Code and License Vote up 5 votes
@Override
public boolean getMoreResults(int current) throws SQLException
{
    checkClosed();
    switch(current)
    {
        case Statement.KEEP_CURRENT_RESULT:
            this.openResults.add(this.result);
            this.result = null;
            this.lastUpdateCount = -1;
            break;
        case Statement.CLOSE_CURRENT_RESULT:
            closeCurrentResult();
            break;
        case Statement.CLOSE_ALL_RESULTS:
            closeCurrentResult();
            closeAllOpenResults();
            break;
        default:
            throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, current);
    }
    if (current != Statement.CLOSE_ALL_RESULTS)
    {
        this.tableResultIndex++;
        if (this.tableResultIndex < this.tableResults.length)
        {
            VoltTable table = this.tableResults[this.tableResultIndex];
            if (VoltSQL.isUpdateResult(table)) {
                this.lastUpdateCount = (int)table.fetchRow(0).getLong(0);
            } else
            {
                this.result = createTrimmedResultSet(table);
                return true;
            }
        }
    }
    return false;
}
 
Example 2
Project: the-vigilantes   File: StatementWrapper.java   Source Code and License Vote up 5 votes
public int getResultSetHoldability() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return this.wrappedStmt.getResultSetHoldability();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return Statement.CLOSE_CURRENT_RESULT;
}
 
Example 3
Project: the-vigilantes   File: ConnectionWrapper.java   Source Code and License Vote up 5 votes
/**
 * @see Connection#getHoldability()
 */
public int getHoldability() throws SQLException {
    checkClosed();

    try {
        return this.mc.getHoldability();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
    // compiler can't tell
}
 
Example 4
Project: s-store   File: JDBC4Statement.java   Source Code and License Vote up 5 votes
@Override
public boolean getMoreResults(int current) throws SQLException
{
    checkClosed();
    switch(current)
    {
        case Statement.KEEP_CURRENT_RESULT:
            this.openResults.add(this.result);
            this.result = null;
            this.lastUpdateCount = -1;
            break;
        case Statement.CLOSE_CURRENT_RESULT:
            closeCurrentResult();
            break;
        case Statement.CLOSE_ALL_RESULTS:
            closeCurrentResult();
            closeAllOpenResults();
            break;
        default:
            throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, current);
    }
    if (current != Statement.CLOSE_ALL_RESULTS)
    {
        this.tableResultIndex++;
        if (this.tableResultIndex < this.tableResults.length)
        {
            VoltTable table = this.tableResults[this.tableResultIndex];
            if (VoltSQL.isUpdateResult(table)) {
                this.lastUpdateCount = (int)table.fetchRow(0).getLong(0);
            } else
            {
                this.result = createTrimmedResultSet(table);
                return true;
            }
        }
    }
    return false;
}
 
Example 5
Project: OpenVertretung   File: StatementWrapper.java   Source Code and License Vote up 5 votes
public int getResultSetHoldability() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return this.wrappedStmt.getResultSetHoldability();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return Statement.CLOSE_CURRENT_RESULT;
}
 
Example 6
Project: OpenVertretung   File: ConnectionWrapper.java   Source Code and License Vote up 5 votes
/**
 * @see Connection#getHoldability()
 */
public int getHoldability() throws SQLException {
    checkClosed();

    try {
        return this.mc.getHoldability();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
    // compiler can't tell
}
 
Example 7
Project: lams   File: StatementWrapper.java   Source Code and License Vote up 5 votes
public int getResultSetHoldability() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return this.wrappedStmt.getResultSetHoldability();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return Statement.CLOSE_CURRENT_RESULT;
}
 
Example 8
Project: lams   File: ConnectionWrapper.java   Source Code and License Vote up 5 votes
/**
 * @see Connection#getHoldability()
 */
public int getHoldability() throws SQLException {
    checkClosed();

    try {
        return this.mc.getHoldability();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
    // compiler can't tell
}
 
Example 9
Project: ProyectoPacientes   File: StatementWrapper.java   Source Code and License Vote up 5 votes
public int getResultSetHoldability() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return this.wrappedStmt.getResultSetHoldability();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return Statement.CLOSE_CURRENT_RESULT;
}
 
Example 10
Project: ProyectoPacientes   File: ConnectionWrapper.java   Source Code and License Vote up 5 votes
/**
 * @see Connection#getHoldability()
 */
public int getHoldability() throws SQLException {
    checkClosed();

    try {
        return this.mc.getHoldability();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
    // compiler can't tell
}
 
Example 11
Project: BibliotecaPS   File: StatementWrapper.java   Source Code and License Vote up 5 votes
public int getResultSetHoldability() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return this.wrappedStmt.getResultSetHoldability();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return Statement.CLOSE_CURRENT_RESULT;
}
 
Example 12
Project: BibliotecaPS   File: ConnectionWrapper.java   Source Code and License Vote up 5 votes
/**
 * @see Connection#getHoldability()
 */
public int getHoldability() throws SQLException {
    checkClosed();

    try {
        return this.mc.getHoldability();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
    // compiler can't tell
}