Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Handling of Invalid setFetchDirection Input between ResultSet and Statement #596

Open
dwenking opened this issue Nov 16, 2023 · 0 comments

Comments

@dwenking
Copy link

When an invalid fetch direction value is passed to setFetchDirection, the ResultSet object accepts it without throwing an exception, whereas the Statement object correctly throws a SQLException for the same invalid input.

@Test
public void test() throws SQLException {
    Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/test11?user=user&password=password");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.getGeneratedKeys();
    rs.setFetchDirection(425635067); // succeed
    System.out.println(rs.getFetchDirection());
    stmt.setFetchDirection(425635067); // java.sql.SQLException: Illegal argument
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant