Java Code Examples for java.sql.ResultSet#FETCH_REVERSE

The following examples show how to use java.sql.ResultSet#FETCH_REVERSE . 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: JtdsStatement.java    From jTDS with GNU Lesser General Public License v2.1 6 votes vote down vote up
public void setFetchDirection(int direction) throws SQLException {
    checkOpen();
    switch (direction) {
    case ResultSet.FETCH_UNKNOWN:
    case ResultSet.FETCH_REVERSE:
    case ResultSet.FETCH_FORWARD:
        fetchDirection = direction;
        break;

    default:
        throw new SQLException(
                Messages.get("error.generic.badoption",
                        Integer.toString(direction),
                        "direction"),
                "24000");
    }
}
 
Example 2
Source File: ClientStatement.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void setFetchDirection(int direction) throws SQLException {
  checkClosed();
  if (direction == ResultSet.FETCH_REVERSE) {
    this.attrs.setFetchReverse(true);
  }
  else if (direction == ResultSet.FETCH_FORWARD) {
    this.attrs.setFetchReverse(false);
  }
  else if (this.attrs.isSetFetchReverse()) {
    this.attrs.setFetchReverseIsSet(false);
    this.attrs.setFetchReverse(false);
  }
}
 
Example 3
Source File: CassandraStatement.java    From cassandra-jdbc-wrapper with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("boxing")
public void setFetchDirection(int direction) throws SQLException
   {
       checkNotClosed();

       if (direction == ResultSet.FETCH_FORWARD || direction == ResultSet.FETCH_REVERSE || direction == ResultSet.FETCH_UNKNOWN)
       {
           if ((getResultSetType() == ResultSet.TYPE_FORWARD_ONLY) && (direction != ResultSet.FETCH_FORWARD))
               throw new SQLSyntaxErrorException(String.format(BAD_FETCH_DIR, direction));
           fetchDirection = direction;
       }
       else throw new SQLSyntaxErrorException(String.format(BAD_FETCH_DIR, direction));
   }
 
Example 4
Source File: ClientStatement.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public int getFetchDirection() throws SQLException {
  if (this.attrs.isSetFetchReverse()) {
    return this.attrs.isFetchReverse() ? ResultSet.FETCH_REVERSE
        : ResultSet.FETCH_FORWARD;
  }
  else {
    return ResultSet.FETCH_UNKNOWN;
  }
}
 
Example 5
Source File: ClientStatement.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void setFetchDirection(int direction) throws SQLException {
  checkClosed();
  if (direction == ResultSet.FETCH_REVERSE) {
    this.attrs.setFetchReverse(true);
  }
  else if (direction == ResultSet.FETCH_FORWARD) {
    this.attrs.setFetchReverse(false);
  }
  else if (this.attrs.isSetFetchReverse()) {
    this.attrs.setFetchReverseIsSet(false);
    this.attrs.setFetchReverse(false);
  }
}
 
Example 6
Source File: CsvResultSet.java    From jdbc-driver-csv with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void setFetchDirection(int direction) throws SQLException {
    checkOpen();

    if (direction == ResultSet.FETCH_FORWARD ||
            direction == ResultSet.FETCH_REVERSE ||
            direction == ResultSet.FETCH_UNKNOWN) {
        this.fetchDirection = direction;
    } else {
        throw new SQLException(CsvResources.getString("unsupportedDirection") + ": " + direction);
    }
}
 
Example 7
Source File: CsvStatement.java    From jdbc-driver-csv with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void setFetchDirection(int direction) throws SQLException {
    checkOpen();

    if (direction == ResultSet.FETCH_FORWARD ||
            direction == ResultSet.FETCH_REVERSE ||
            direction == ResultSet.FETCH_UNKNOWN) {
        this.fetchDirection = direction;
    } else {
        throw new SQLFeatureNotSupportedException(CsvResources.getString("unsupportedDirection") + ": " + direction);
    }
}
 
Example 8
Source File: CommonRowSetTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 9
Source File: ClientStatement.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public int getFetchDirection() throws SQLException {
  if (this.attrs.isSetFetchReverse()) {
    return this.attrs.isFetchReverse() ? ResultSet.FETCH_REVERSE
        : ResultSet.FETCH_FORWARD;
  }
  else {
    return ResultSet.FETCH_UNKNOWN;
  }
}
 
Example 10
Source File: CommonRowSetTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 11
Source File: CommonRowSetTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 12
Source File: CommonRowSetTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 13
Source File: CommonRowSetTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 14
Source File: CommonRowSetTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 15
Source File: CommonRowSetTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 16
Source File: CommonRowSetTests.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 17
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetFetchDirection")
protected Object[][] rowSetFetchDirection() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, ResultSet.FETCH_FORWARD},
        {rs, ResultSet.FETCH_REVERSE},
        {rs, ResultSet.FETCH_UNKNOWN}
    };
}
 
Example 18
Source File: PrestoStatement.java    From presto with Apache License 2.0 4 votes vote down vote up
private static boolean validFetchDirection(int direction)
{
    return (direction == ResultSet.FETCH_FORWARD) ||
            (direction == ResultSet.FETCH_REVERSE) ||
            (direction == ResultSet.FETCH_UNKNOWN);
}