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

Inconsistency between rs.getType() and stmt.getResultSetType() #595

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

Inconsistency between rs.getType() and stmt.getResultSetType() #595

dwenking opened this issue Nov 16, 2023 · 0 comments

Comments

@dwenking
Copy link

In the provided test case, a Statement object is created with specific ResultSet type parameters, and a query is executed to obtain a ResultSet. However, the type of the ResultSet as reported by rs.getType() does not match the type specified in the Statement object and returned by stmt.getResultSetType().

@Test
public void test() throws SQLException {
    Connection con;
    Statement stmt;
    ResultSet rs;

    con = DriverManager.getConnection("jdbc:pgsql://localhost:5432/test11?user=user&password=password");
    stmt = con.createStatement(1005, 1007, 2);
    stmt.execute("CREATE TABLE table11_0(id VARCHAR(5) PRIMARY KEY,value BIT);");
    rs = stmt.executeQuery("SELECT * FROM table11_0;");

    System.out.println(rs.getType());
    System.out.println(stmt.getResultSetType());

    rs.close();
    stmt.close();
    con.close();
}
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