Skip to content

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

@dwenking

Description

@dwenking

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions